From 44bf32f49bef3a32a4964e993586e209c10d28e8 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 21 Nov 2018 12:10:55 -0800 Subject: [PATCH 01/15] [AutoPR billing/resource-manager] [Microsoft.Billing]: Updating swagger with rename changes required. (#3813) * Generated from 00929e5f098aa4815bb216071aa6f22d5bc0e170 [Microsoft.Billing]: Updating swagger with rename changes required. * Packaging update of azure-mgmt-billing --- azure-mgmt-billing/MANIFEST.in | 4 +- azure-mgmt-billing/README.rst | 8 +-- azure-mgmt-billing/azure/__init__.py | 2 +- azure-mgmt-billing/azure/mgmt/__init__.py | 2 +- .../mgmt/billing/billing_management_client.py | 6 +- .../azure/mgmt/billing/models/__init__.py | 29 ++++++--- .../mgmt/billing/models/billing_period.py | 4 +- .../mgmt/billing/models/billing_period_py3.py | 59 +++++++++++++++++ .../azure/mgmt/billing/models/download_url.py | 4 +- .../mgmt/billing/models/download_url_py3.py | 41 ++++++++++++ .../mgmt/billing/models/enrollment_account.py | 4 +- .../billing/models/enrollment_account_py3.py | 47 ++++++++++++++ .../mgmt/billing/models/error_details.py | 4 +- .../mgmt/billing/models/error_details_py3.py | 45 +++++++++++++ .../mgmt/billing/models/error_response.py | 6 +- .../mgmt/billing/models/error_response_py3.py | 42 ++++++++++++ .../azure/mgmt/billing/models/invoice.py | 6 +- .../azure/mgmt/billing/models/invoice_py3.py | 65 +++++++++++++++++++ .../azure/mgmt/billing/models/operation.py | 6 +- .../mgmt/billing/models/operation_display.py | 4 +- .../billing/models/operation_display_py3.py | 46 +++++++++++++ .../mgmt/billing/models/operation_py3.py | 39 +++++++++++ .../azure/mgmt/billing/models/resource.py | 4 +- .../azure/mgmt/billing/models/resource_py3.py | 45 +++++++++++++ .../operations/billing_periods_operations.py | 13 ++-- .../enrollment_accounts_operations.py | 13 ++-- .../billing/operations/invoices_operations.py | 19 +++--- .../mgmt/billing/operations/operations.py | 7 +- azure-mgmt-billing/azure_bdist_wheel.py | 54 --------------- azure-mgmt-billing/sdk_packaging.toml | 8 +++ azure-mgmt-billing/setup.cfg | 1 - azure-mgmt-billing/setup.py | 23 ++++--- 32 files changed, 527 insertions(+), 133 deletions(-) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_period_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/download_url_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/error_details_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/error_response_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/operation_display_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/operation_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/resource_py3.py delete mode 100644 azure-mgmt-billing/azure_bdist_wheel.py create mode 100644 azure-mgmt-billing/sdk_packaging.toml diff --git a/azure-mgmt-billing/MANIFEST.in b/azure-mgmt-billing/MANIFEST.in index 9ecaeb15de50..6ceb27f7a96e 100644 --- a/azure-mgmt-billing/MANIFEST.in +++ b/azure-mgmt-billing/MANIFEST.in @@ -1,2 +1,4 @@ include *.rst -include azure_bdist_wheel.py \ No newline at end of file +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-billing/README.rst b/azure-mgmt-billing/README.rst index 945a404aaa53..45de4e6b43dd 100644 --- a/azure-mgmt-billing/README.rst +++ b/azure-mgmt-billing/README.rst @@ -1,12 +1,12 @@ Microsoft Azure SDK for Python ============================== -This is the Microsoft Azure Billing Client Library. +This is the Microsoft Azure MyService Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -36,8 +36,8 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `Billing -`__ +For code examples, see `MyService Management +`__ on docs.microsoft.com. diff --git a/azure-mgmt-billing/azure/__init__.py b/azure-mgmt-billing/azure/__init__.py index de40ea7ca058..0260537a02bb 100644 --- a/azure-mgmt-billing/azure/__init__.py +++ b/azure-mgmt-billing/azure/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-billing/azure/mgmt/__init__.py b/azure-mgmt-billing/azure/mgmt/__init__.py index de40ea7ca058..0260537a02bb 100644 --- a/azure-mgmt-billing/azure/mgmt/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index 7806b688963f..528867b0d1ce 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -9,7 +9,7 @@ # 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 @@ -52,7 +52,7 @@ def __init__( self.subscription_id = subscription_id -class BillingManagementClient(object): +class BillingManagementClient(SDKClient): """Billing client provides access to billing resources for Azure subscriptions. :ivar config: Configuration for client. @@ -79,7 +79,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = BillingManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(BillingManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2018-03-01-preview' diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py index b49fd4a67883..4e5a8bfe9975 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py @@ -9,15 +9,26 @@ # regenerated. # -------------------------------------------------------------------------- -from .enrollment_account import EnrollmentAccount -from .billing_period import BillingPeriod -from .download_url import DownloadUrl -from .error_details import ErrorDetails -from .error_response import ErrorResponse, ErrorResponseException -from .invoice import Invoice -from .operation_display import OperationDisplay -from .operation import Operation -from .resource import Resource +try: + from .enrollment_account_py3 import EnrollmentAccount + from .billing_period_py3 import BillingPeriod + from .download_url_py3 import DownloadUrl + from .error_details_py3 import ErrorDetails + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .invoice_py3 import Invoice + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .resource_py3 import Resource +except (SyntaxError, ImportError): + from .enrollment_account import EnrollmentAccount + from .billing_period import BillingPeriod + from .download_url import DownloadUrl + from .error_details import ErrorDetails + from .error_response import ErrorResponse, ErrorResponseException + from .invoice import Invoice + from .operation_display import OperationDisplay + from .operation import Operation + from .resource import Resource from .enrollment_account_paged import EnrollmentAccountPaged from .billing_period_paged import BillingPeriodPaged from .invoice_paged import InvoicePaged diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_period.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_period.py index a8a38c17d40f..ec1f2039ea1d 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_period.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_period.py @@ -52,8 +52,8 @@ class BillingPeriod(Resource): 'invoice_ids': {'key': 'properties.invoiceIds', 'type': '[str]'}, } - def __init__(self): - super(BillingPeriod, self).__init__() + def __init__(self, **kwargs): + super(BillingPeriod, self).__init__(**kwargs) self.billing_period_start_date = None self.billing_period_end_date = None self.invoice_ids = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_period_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_period_py3.py new file mode 100644 index 000000000000..7d5ecbe3a0a8 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_period_py3.py @@ -0,0 +1,59 @@ +# 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 .resource_py3 import Resource + + +class BillingPeriod(Resource): + """A billing period resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar billing_period_start_date: The start of the date range covered by + the billing period. + :vartype billing_period_start_date: date + :ivar billing_period_end_date: The end of the date range covered by the + billing period. + :vartype billing_period_end_date: date + :ivar invoice_ids: Array of invoice ids that associated with. + :vartype invoice_ids: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'billing_period_start_date': {'readonly': True}, + 'billing_period_end_date': {'readonly': True}, + 'invoice_ids': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'billing_period_start_date': {'key': 'properties.billingPeriodStartDate', 'type': 'date'}, + 'billing_period_end_date': {'key': 'properties.billingPeriodEndDate', 'type': 'date'}, + 'invoice_ids': {'key': 'properties.invoiceIds', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingPeriod, self).__init__(**kwargs) + self.billing_period_start_date = None + self.billing_period_end_date = None + self.invoice_ids = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/download_url.py b/azure-mgmt-billing/azure/mgmt/billing/models/download_url.py index 175264024ae9..ddc0f2214803 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/download_url.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/download_url.py @@ -35,7 +35,7 @@ class DownloadUrl(Model): 'url': {'key': 'url', 'type': 'str'}, } - def __init__(self): - super(DownloadUrl, self).__init__() + def __init__(self, **kwargs): + super(DownloadUrl, self).__init__(**kwargs) self.expiry_time = None self.url = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/download_url_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/download_url_py3.py new file mode 100644 index 000000000000..8d6cbc611329 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/download_url_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 + + +class DownloadUrl(Model): + """A secure URL that can be used to download a PDF invoice until the URL + expires. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar expiry_time: The time in UTC at which this download URL will expire. + :vartype expiry_time: datetime + :ivar url: The URL to the PDF file. + :vartype url: str + """ + + _validation = { + 'expiry_time': {'readonly': True}, + 'url': {'readonly': True}, + } + + _attribute_map = { + 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DownloadUrl, self).__init__(**kwargs) + self.expiry_time = None + self.url = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py index 3e8e6cb69204..0936208a7cd9 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py @@ -42,6 +42,6 @@ class EnrollmentAccount(Resource): 'principal_name': {'key': 'properties.principalName', 'type': 'str'}, } - def __init__(self): - super(EnrollmentAccount, self).__init__() + def __init__(self, **kwargs): + super(EnrollmentAccount, self).__init__(**kwargs) self.principal_name = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py new file mode 100644 index 000000000000..0d1d9bc36553 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py @@ -0,0 +1,47 @@ +# 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 .resource_py3 import Resource + + +class EnrollmentAccount(Resource): + """An enrollment account resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar principal_name: The account owner's principal name. + :vartype principal_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'principal_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'principal_name': {'key': 'properties.principalName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(EnrollmentAccount, self).__init__(**kwargs) + self.principal_name = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/error_details.py b/azure-mgmt-billing/azure/mgmt/billing/models/error_details.py index 91d77d6df46b..ebdc3b5e9aaf 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/error_details.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/error_details.py @@ -38,8 +38,8 @@ class ErrorDetails(Model): 'target': {'key': 'target', 'type': 'str'}, } - def __init__(self): - super(ErrorDetails, self).__init__() + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) self.code = None self.message = None self.target = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/error_details_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/error_details_py3.py new file mode 100644 index 000000000000..08aeaf2b35a5 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/error_details_py3.py @@ -0,0 +1,45 @@ +# 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 ErrorDetails(Model): + """The details of the error. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + :ivar target: The target of the particular error. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/error_response.py b/azure-mgmt-billing/azure/mgmt/billing/models/error_response.py index 06441e8c4e75..97452d9adf1c 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/error_response.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/error_response.py @@ -25,9 +25,9 @@ class ErrorResponse(Model): 'error': {'key': 'error', 'type': 'ErrorDetails'}, } - def __init__(self, error=None): - super(ErrorResponse, self).__init__() - self.error = error + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) class ErrorResponseException(HttpOperationError): diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/error_response_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/error_response_py3.py new file mode 100644 index 000000000000..6449a49ab342 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/error_response_py3.py @@ -0,0 +1,42 @@ +# 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 ErrorResponse(Model): + """Error response indicates that the service is not able to process the + incoming request. The reason is provided in the error message. + + :param error: The details of the error. + :type error: ~azure.mgmt.billing.models.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py index c97af83790a2..bd55bc268a9e 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py @@ -57,9 +57,9 @@ class Invoice(Resource): 'billing_period_ids': {'key': 'properties.billingPeriodIds', 'type': '[str]'}, } - def __init__(self, download_url=None): - super(Invoice, self).__init__() - self.download_url = download_url + def __init__(self, **kwargs): + super(Invoice, self).__init__(**kwargs) + self.download_url = kwargs.get('download_url', None) self.invoice_period_start_date = None self.invoice_period_end_date = None self.billing_period_ids = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py new file mode 100644 index 000000000000..bf69d1a66f82 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py @@ -0,0 +1,65 @@ +# 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 .resource_py3 import Resource + + +class Invoice(Resource): + """An invoice resource can be used download a PDF version of an invoice. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param download_url: A secure link to download the PDF version of an + invoice. The link will cease to work after its expiry time is reached. + :type download_url: ~azure.mgmt.billing.models.DownloadUrl + :ivar invoice_period_start_date: The start of the date range covered by + the invoice. + :vartype invoice_period_start_date: date + :ivar invoice_period_end_date: The end of the date range covered by the + invoice. + :vartype invoice_period_end_date: date + :ivar billing_period_ids: Array of billing perdiod ids that the invoice is + attributed to. + :vartype billing_period_ids: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'invoice_period_start_date': {'readonly': True}, + 'invoice_period_end_date': {'readonly': True}, + 'billing_period_ids': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'download_url': {'key': 'properties.downloadUrl', 'type': 'DownloadUrl'}, + 'invoice_period_start_date': {'key': 'properties.invoicePeriodStartDate', 'type': 'date'}, + 'invoice_period_end_date': {'key': 'properties.invoicePeriodEndDate', 'type': 'date'}, + 'billing_period_ids': {'key': 'properties.billingPeriodIds', 'type': '[str]'}, + } + + def __init__(self, *, download_url=None, **kwargs) -> None: + super(Invoice, self).__init__(**kwargs) + self.download_url = download_url + self.invoice_period_start_date = None + self.invoice_period_end_date = None + self.billing_period_ids = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/operation.py b/azure-mgmt-billing/azure/mgmt/billing/models/operation.py index c2aae214fd34..0e458f6ea690 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/operation.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/operation.py @@ -33,7 +33,7 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, } - def __init__(self, display=None): - super(Operation, self).__init__() + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) self.name = None - self.display = display + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/operation_display.py b/azure-mgmt-billing/azure/mgmt/billing/models/operation_display.py index 0dcad2d20d02..ef6f1093f01a 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/operation_display.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/operation_display.py @@ -39,8 +39,8 @@ class OperationDisplay(Model): 'operation': {'key': 'operation', 'type': 'str'}, } - def __init__(self): - super(OperationDisplay, self).__init__() + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) self.provider = None self.resource = None self.operation = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/operation_display_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/operation_display_py3.py new file mode 100644 index 000000000000..4ff84a2893e2 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/operation_display_py3.py @@ -0,0 +1,46 @@ +# 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): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.Billing. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Invoice, + etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/operation_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/operation_py3.py new file mode 100644 index 000000000000..6006624920fe --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/operation_py3.py @@ -0,0 +1,39 @@ +# 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 Operation(Model): + """A Billing REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.billing.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/resource.py b/azure-mgmt-billing/azure/mgmt/billing/models/resource.py index ff02c012b072..246fb19f8a1a 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/resource.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/resource.py @@ -38,8 +38,8 @@ class Resource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/resource_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/resource_py3.py new file mode 100644 index 000000000000..b4cf9627c55d --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/resource_py3.py @@ -0,0 +1,45 @@ +# 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 Resource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_periods_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_periods_operations.py index 7f382587610d..337a3d705411 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_periods_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_periods_operations.py @@ -93,7 +93,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -102,9 +102,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -156,7 +155,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -165,8 +164,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py index 071d1ce3c75c..58199cd31644 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py @@ -67,7 +67,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -76,9 +76,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -126,7 +125,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -135,8 +134,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py index e56ced653ad8..e16ef92f5af0 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py @@ -102,7 +102,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -111,9 +111,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -166,7 +165,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -175,8 +174,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -225,7 +224,7 @@ def get_latest( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -234,8 +233,8 @@ def get_latest( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py index 5d38dd4b2ce2..07621b06039f 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py @@ -67,7 +67,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -76,9 +76,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) diff --git a/azure-mgmt-billing/azure_bdist_wheel.py b/azure-mgmt-billing/azure_bdist_wheel.py deleted file mode 100644 index 8a81d1b61775..000000000000 --- a/azure-mgmt-billing/azure_bdist_wheel.py +++ /dev/null @@ -1,54 +0,0 @@ -#------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -#-------------------------------------------------------------------------- - -from distutils import log as logger -import os.path - -from wheel.bdist_wheel import bdist_wheel -class azure_bdist_wheel(bdist_wheel): - """The purpose of this class is to build wheel a little differently than the sdist, - without requiring to build the wheel from the sdist (i.e. you can build the wheel - directly from source). - """ - - description = "Create an Azure wheel distribution" - - user_options = bdist_wheel.user_options + \ - [('azure-namespace-package=', None, - "Name of the deepest nspkg used")] - - def initialize_options(self): - bdist_wheel.initialize_options(self) - self.azure_namespace_package = None - - def finalize_options(self): - bdist_wheel.finalize_options(self) - if self.azure_namespace_package and not self.azure_namespace_package.endswith("-nspkg"): - raise ValueError("azure_namespace_package must finish by -nspkg") - - def run(self): - if not self.distribution.install_requires: - self.distribution.install_requires = [] - self.distribution.install_requires.append( - "{}>=2.0.0".format(self.azure_namespace_package)) - bdist_wheel.run(self) - - def write_record(self, bdist_dir, distinfo_dir): - if self.azure_namespace_package: - # Split and remove last part, assuming it's "nspkg" - subparts = self.azure_namespace_package.split('-')[0:-1] - folder_with_init = [os.path.join(*subparts[0:i+1]) for i in range(len(subparts))] - for azure_sub_package in folder_with_init: - init_file = os.path.join(bdist_dir, azure_sub_package, '__init__.py') - if os.path.isfile(init_file): - logger.info("manually remove {} while building the wheel".format(init_file)) - os.remove(init_file) - else: - raise ValueError("Unable to find {}. Are you sure of your namespace package?".format(init_file)) - bdist_wheel.write_record(self, bdist_dir, distinfo_dir) -cmdclass = { - 'bdist_wheel': azure_bdist_wheel, -} diff --git a/azure-mgmt-billing/sdk_packaging.toml b/azure-mgmt-billing/sdk_packaging.toml new file mode 100644 index 000000000000..37e5b38d73c5 --- /dev/null +++ b/azure-mgmt-billing/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-billing" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/azure-mgmt-billing/setup.cfg b/azure-mgmt-billing/setup.cfg index 856f4164982c..3c6e79cf31da 100644 --- a/azure-mgmt-billing/setup.cfg +++ b/azure-mgmt-billing/setup.cfg @@ -1,3 +1,2 @@ [bdist_wheel] universal=1 -azure-namespace-package=azure-mgmt-nspkg \ No newline at end of file diff --git a/azure-mgmt-billing/setup.py b/azure-mgmt-billing/setup.py index e7e8f635cd99..b2aa12bf873f 100644 --- a/azure-mgmt-billing/setup.py +++ b/azure-mgmt-billing/setup.py @@ -10,16 +10,10 @@ import os.path from io import open from setuptools import find_packages, setup -try: - from azure_bdist_wheel import cmdclass -except ImportError: - from distutils import log as logger - logger.warn("Wheel is not available, disabling bdist_wheel hook") - cmdclass = {} # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-mgmt-billing" -PACKAGE_PPRINT_NAME = "Billing" +PACKAGE_PPRINT_NAME = "MyService Management" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') @@ -72,13 +66,22 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'License :: OSI Approved :: MIT License', ], zip_safe=False, - packages=find_packages(exclude=["tests"]), + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), install_requires=[ - 'msrestazure>=0.4.20,<2.0.0', + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', ], - cmdclass=cmdclass + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } ) From b7fe65524752b870445b4754d7ae46b65f5acfbd Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 3 Dec 2018 09:51:55 -0800 Subject: [PATCH 02/15] Generated from a4f0a37cbb165a4a161a960caed3a6a3f89ed645 (#3905) typo: Microsoft.Billing - perdiod -> period - prouct -> product - setion -> section --- azure-mgmt-billing/azure/mgmt/billing/models/invoice.py | 2 +- azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py index bd55bc268a9e..25e3930f0ce3 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py @@ -33,7 +33,7 @@ class Invoice(Resource): :ivar invoice_period_end_date: The end of the date range covered by the invoice. :vartype invoice_period_end_date: date - :ivar billing_period_ids: Array of billing perdiod ids that the invoice is + :ivar billing_period_ids: Array of billing period ids that the invoice is attributed to. :vartype billing_period_ids: list[str] """ diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py index bf69d1a66f82..9afed4eac660 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py @@ -33,7 +33,7 @@ class Invoice(Resource): :ivar invoice_period_end_date: The end of the date range covered by the invoice. :vartype invoice_period_end_date: date - :ivar billing_period_ids: Array of billing perdiod ids that the invoice is + :ivar billing_period_ids: Array of billing period ids that the invoice is attributed to. :vartype billing_period_ids: list[str] """ From 51556e96056173e03e15db88d8eb1d0896c7f54e Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 25 Mar 2019 16:31:38 -0700 Subject: [PATCH 03/15] [AutoPR billing/resource-manager] Add GTM APIs. (#4614) * Generated from 8745db772f6c09718c39873dd39f84cb96266c28 Separate StatusType enums. * Packaging update of azure-mgmt-billing * Generated from be56341bb4b65410ec13ba0af477c8a87179c7a5 Add back availableBalance/default. * Generated from e51d10380f487b7a3703deae13d9f9824d56fd0a typo * Generated from eb7c9238276302bff4fbe0eff259d6417afe80b7 Fix typos/casings. * Generated from f6c76e2b360ce261fc784a0b0111907b827c3000 more typos/casing fixes * Generated from 0c43fc1e5550599a0df891a84034d4b3836eb7dc Add missing parameters/fix casing. * Generated from 1b2e4dd688f49f222cce286b8e0603643e3df045 Consolidate operationId naming. --- azure-mgmt-billing/MANIFEST.in | 1 + azure-mgmt-billing/README.rst | 22 +- .../mgmt/billing/billing_management_client.py | 414 +++++++++++++++++- .../azure/mgmt/billing/models/__init__.py | 207 ++++++++- .../billing/models/accept_transfer_request.py | 28 ++ .../models/accept_transfer_request_py3.py | 28 ++ .../azure/mgmt/billing/models/address.py | 64 +++ .../azure/mgmt/billing/models/address_py3.py | 64 +++ .../azure/mgmt/billing/models/amount.py | 40 ++ .../azure/mgmt/billing/models/amount_py3.py | 40 ++ ...billing_period.py => available_balance.py} | 28 +- ...period_py3.py => available_balance_py3.py} | 28 +- .../mgmt/billing/models/billing_account.py | 93 ++++ .../models/billing_account_list_result.py | 40 ++ .../models/billing_account_list_result_py3.py | 40 ++ .../billing/models/billing_account_py3.py | 93 ++++ .../models/billing_management_client_enums.py | 96 ++++ .../billing/models/billing_permissions.py | 41 ++ .../models/billing_permissions_list_result.py | 36 ++ .../billing_permissions_list_result_py3.py | 36 ++ .../billing/models/billing_permissions_py3.py | 41 ++ .../mgmt/billing/models/billing_profile.py | 85 ++++ .../models/billing_profile_list_result.py | 40 ++ .../models/billing_profile_list_result_py3.py | 40 ++ .../billing/models/billing_profile_py3.py | 85 ++++ .../mgmt/billing/models/billing_property.py | 80 ++++ .../billing/models/billing_property_py3.py | 80 ++++ .../billing/models/billing_role_assignment.py | 77 ++++ .../billing_role_assignment_list_result.py | 35 ++ ...billing_role_assignment_list_result_py3.py | 35 ++ .../models/billing_role_assignment_payload.py | 40 ++ .../billing_role_assignment_payload_py3.py | 40 ++ .../models/billing_role_assignment_py3.py | 77 ++++ .../billing/models/billing_role_definition.py | 58 +++ .../billing_role_definition_list_result.py | 35 ++ ...billing_role_definition_list_result_py3.py | 35 ++ .../models/billing_role_definition_py3.py | 58 +++ .../models/billing_subscription_summary.py | 95 ++++ ... => billing_subscription_summary_paged.py} | 8 +- .../billing_subscription_summary_py3.py | 95 ++++ .../billing_subscriptions_list_result.py | 41 ++ .../billing_subscriptions_list_result_py3.py | 41 ++ .../azure/mgmt/billing/models/department.py | 60 +++ .../billing/models/department_list_result.py | 40 ++ .../models/department_list_result_py3.py | 40 ++ .../mgmt/billing/models/department_py3.py | 60 +++ .../models/detailed_transfer_status.py | 52 +++ .../models/detailed_transfer_status_py3.py | 52 +++ .../billing/models/download_properties.py | 41 ++ .../billing/models/download_properties_py3.py | 41 ++ .../azure/mgmt/billing/models/download_url.py | 2 +- .../mgmt/billing/models/download_url_py3.py | 2 +- .../billing/models/enabled_azure_sk_us.py | 39 ++ .../billing/models/enabled_azure_sk_us_py3.py | 39 ++ .../azure/mgmt/billing/models/enrollment.py | 73 +++ .../mgmt/billing/models/enrollment_account.py | 36 +- .../models/enrollment_account_context.py | 40 ++ .../models/enrollment_account_context_py3.py | 40 ++ .../models/enrollment_account_list_result.py | 40 ++ .../enrollment_account_list_result_py3.py | 40 ++ .../billing/models/enrollment_account_py3.py | 38 +- .../billing/models/enrollment_policies.py | 53 +++ .../billing/models/enrollment_policies_py3.py | 53 +++ .../mgmt/billing/models/enrollment_py3.py | 73 +++ .../azure/mgmt/billing/models/error.py | 40 ++ .../azure/mgmt/billing/models/error_py3.py | 40 ++ .../models/initiate_transfer_request.py | 32 ++ .../models/initiate_transfer_request_py3.py | 32 ++ .../azure/mgmt/billing/models/invoice.py | 65 --- .../billing/models/invoice_list_result.py | 40 ++ .../billing/models/invoice_list_result_py3.py | 40 ++ .../azure/mgmt/billing/models/invoice_py3.py | 65 --- .../mgmt/billing/models/invoice_section.py | 51 +++ .../models/invoice_section_list_result.py | 40 ++ .../models/invoice_section_list_result_py3.py | 40 ++ .../models/invoice_section_properties.py | 33 ++ .../models/invoice_section_properties_py3.py | 33 ++ .../billing/models/invoice_section_py3.py | 51 +++ .../mgmt/billing/models/invoice_summary.py | 105 +++++ .../billing/models/invoice_summary_py3.py | 105 +++++ .../mgmt/billing/models/operation_status.py | 43 ++ .../billing/models/operation_status_py3.py | 43 ++ .../mgmt/billing/models/payment_method.py | 62 +++ ...voice_paged.py => payment_method_paged.py} | 8 +- .../mgmt/billing/models/payment_method_py3.py | 62 +++ .../mgmt/billing/models/payment_properties.py | 45 ++ .../billing/models/payment_properties_py3.py | 45 ++ .../azure/mgmt/billing/models/policy.py | 52 +++ .../azure/mgmt/billing/models/policy_py3.py | 52 +++ .../mgmt/billing/models/product_details.py | 33 ++ .../billing/models/product_details_py3.py | 33 ++ .../mgmt/billing/models/product_summary.py | 138 ++++++ ...ount_paged.py => product_summary_paged.py} | 8 +- .../billing/models/product_summary_py3.py | 138 ++++++ .../billing/models/products_list_result.py | 41 ++ .../models/products_list_result_py3.py | 41 ++ .../models/recipient_transfer_details.py | 79 ++++ .../recipient_transfer_details_paged.py | 27 ++ .../models/recipient_transfer_details_py3.py | 79 ++++ .../models/transactions_list_result.py | 40 ++ .../models/transactions_list_result_py3.py | 40 ++ .../billing/models/transactions_summary.py | 131 ++++++ .../models/transactions_summary_paged.py | 27 ++ .../models/transactions_summary_py3.py | 131 ++++++ .../transfer_billing_subscription_request.py | 29 ++ ...billing_subscription_request_properties.py | 29 ++ ...ing_subscription_request_properties_py3.py | 29 ++ ...ansfer_billing_subscription_request_py3.py | 29 ++ .../transfer_billing_subscription_result.py | 28 ++ ...ransfer_billing_subscription_result_py3.py | 28 ++ .../mgmt/billing/models/transfer_details.py | 83 ++++ .../billing/models/transfer_details_paged.py | 27 ++ .../billing/models/transfer_details_py3.py | 83 ++++ .../transfer_product_request_properties.py | 28 ++ ...transfer_product_request_properties_py3.py | 28 ++ .../update_auto_renew_operation_summary.py | 28 ++ ...update_auto_renew_operation_summary_py3.py | 28 ++ .../models/update_auto_renew_request.py | 29 ++ .../models/update_auto_renew_request_py3.py | 29 ++ .../azure/mgmt/billing/operations/__init__.py | 78 +++- ...e_balance_by_billing_profile_operations.py | 98 +++++ ..._account_billing_permissions_operations.py | 94 ++++ ...ount_billing_role_assignment_operations.py | 279 ++++++++++++ ...ount_billing_role_definition_operations.py | 155 +++++++ .../operations/billing_accounts_operations.py | 155 +++++++ ...e_invoice_section_permission_operations.py | 94 ++++ .../operations/billing_periods_operations.py | 183 -------- ..._profile_billing_permissions_operations.py | 97 ++++ ...file_billing_role_assignment_operations.py | 291 ++++++++++++ ...file_billing_role_definition_operations.py | 161 +++++++ ...iles_by_billing_account_name_operations.py | 98 +++++ .../operations/billing_profiles_operations.py | 213 +++++++++ .../operations/billing_property_operations.py | 92 ++++ .../billing_subscription_operations.py | 221 ++++++++++ ...criptions_by_billing_profile_operations.py | 98 +++++ ...criptions_by_invoice_section_operations.py | 98 +++++ ...ents_by_billing_account_name_operations.py | 105 +++++ .../operations/departments_operations.py | 108 +++++ ...unts_by_billing_account_name_operations.py | 105 +++++ .../enrollment_accounts_operations.py | 95 ++-- .../billing/operations/invoice_operations.py | 100 +++++ .../invoice_pricesheet_operations.py | 145 ++++++ ...tion_billing_role_assignment_operations.py | 291 ++++++++++++ ...tion_billing_role_definition_operations.py | 161 +++++++ ...sections_billing_permissions_operations.py | 97 ++++ ...ions_by_billing_account_name_operations.py | 104 +++++ .../operations/invoice_sections_operations.py | 333 ++++++++++++++ ...eate_subscription_permission_operations.py | 105 +++++ .../invoices_by_billing_account_operations.py | 100 +++++ .../invoices_by_billing_profile_operations.py | 103 +++++ .../mgmt/billing/operations/operations.py | 4 +- ...t_methods_by_billing_profile_operations.py | 105 +++++ .../billing/operations/policy_operations.py | 169 +++++++ .../products_by_billing_account_operations.py | 109 +++++ ...cts_by_billing_subscriptions_operations.py | 102 +++++ .../products_by_invoice_section_operations.py | 104 +++++ .../billing/operations/products_operations.py | 179 ++++++++ ...s.py => recipient_transfers_operations.py} | 235 +++++----- ...nsactions_by_billing_account_operations.py | 116 +++++ .../operations/transfers_operations.py | 297 +++++++++++++ 160 files changed, 11628 insertions(+), 608 deletions(-) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/address.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/address_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/amount.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/amount_py3.py rename azure-mgmt-billing/azure/mgmt/billing/models/{billing_period.py => available_balance.py} (51%) rename azure-mgmt-billing/azure/mgmt/billing/models/{billing_period_py3.py => available_balance_py3.py} (51%) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py rename azure-mgmt-billing/azure/mgmt/billing/models/{billing_period_paged.py => billing_subscription_summary_paged.py} (71%) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/department.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/department_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/department_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/department_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/download_properties.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/download_properties_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enrollment.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enrollment_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/error.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/error_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result_py3.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/operation_status.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py rename azure-mgmt-billing/azure/mgmt/billing/models/{invoice_paged.py => payment_method_paged.py} (69%) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/payment_properties.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/payment_properties_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/policy.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/product_details.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/product_details_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/product_summary.py rename azure-mgmt-billing/azure/mgmt/billing/models/{enrollment_account_paged.py => product_summary_paged.py} (67%) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/product_summary_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/products_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/products_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_paged.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_paged.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_paged.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/available_balance_by_billing_profile_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_permissions_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_assignment_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_definition_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_with_create_invoice_section_permission_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_periods_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_permissions_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_assignment_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_definition_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_by_billing_account_name_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_property_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_invoice_section_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/departments_by_billing_account_name_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_by_billing_account_name_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_pricesheet_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_assignment_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_definition_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_billing_permissions_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_name_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_account_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_profile_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_by_billing_profile_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_account_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_subscriptions_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/products_by_invoice_section_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py rename azure-mgmt-billing/azure/mgmt/billing/operations/{invoices_operations.py => recipient_transfers_operations.py} (53%) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_account_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py diff --git a/azure-mgmt-billing/MANIFEST.in b/azure-mgmt-billing/MANIFEST.in index 6ceb27f7a96e..e4884efef41b 100644 --- a/azure-mgmt-billing/MANIFEST.in +++ b/azure-mgmt-billing/MANIFEST.in @@ -1,3 +1,4 @@ +recursive-include tests *.py *.yaml include *.rst include azure/__init__.py include azure/mgmt/__init__.py diff --git a/azure-mgmt-billing/README.rst b/azure-mgmt-billing/README.rst index 45de4e6b43dd..6b85fb2289e3 100644 --- a/azure-mgmt-billing/README.rst +++ b/azure-mgmt-billing/README.rst @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see For a more complete set of Azure libraries, see the `azure `__ bundle package. -Compatibility -============= - -**IMPORTANT**: If you have an earlier version of the azure package -(version < 1.0), you should uninstall it before installing this package. - -You can check the version using pip: - -.. code:: shell - - pip freeze - -If you see azure==0.11.0 (or any version below 1.0), uninstall it first: - -.. code:: shell - - pip uninstall azure - - Usage ===== @@ -47,3 +28,6 @@ Provide Feedback If you encounter any bugs or have suggestions, please file an issue in the `Issues `__ section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-billing%2FREADME.png diff --git a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index 528867b0d1ce..88371287f0cd 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -13,10 +13,49 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling +import uuid +from .operations.billing_accounts_operations import BillingAccountsOperations +from .operations.billing_accounts_with_create_invoice_section_permission_operations import BillingAccountsWithCreateInvoiceSectionPermissionOperations +from .operations.available_balance_by_billing_profile_operations import AvailableBalanceByBillingProfileOperations +from .operations.payment_methods_by_billing_profile_operations import PaymentMethodsByBillingProfileOperations +from .operations.billing_profiles_by_billing_account_name_operations import BillingProfilesByBillingAccountNameOperations +from .operations.billing_profiles_operations import BillingProfilesOperations +from .operations.invoice_sections_by_billing_account_name_operations import InvoiceSectionsByBillingAccountNameOperations +from .operations.invoice_sections_operations import InvoiceSectionsOperations +from .operations.invoice_sections_with_create_subscription_permission_operations import InvoiceSectionsWithCreateSubscriptionPermissionOperations +from .operations.departments_by_billing_account_name_operations import DepartmentsByBillingAccountNameOperations +from .operations.departments_operations import DepartmentsOperations +from .operations.enrollment_accounts_by_billing_account_name_operations import EnrollmentAccountsByBillingAccountNameOperations from .operations.enrollment_accounts_operations import EnrollmentAccountsOperations -from .operations.billing_periods_operations import BillingPeriodsOperations -from .operations.invoices_operations import InvoicesOperations +from .operations.invoices_by_billing_account_operations import InvoicesByBillingAccountOperations +from .operations.invoice_pricesheet_operations import InvoicePricesheetOperations +from .operations.invoices_by_billing_profile_operations import InvoicesByBillingProfileOperations +from .operations.invoice_operations import InvoiceOperations +from .operations.products_by_billing_subscriptions_operations import ProductsByBillingSubscriptionsOperations +from .operations.billing_subscriptions_by_billing_profile_operations import BillingSubscriptionsByBillingProfileOperations +from .operations.billing_subscriptions_by_invoice_section_operations import BillingSubscriptionsByInvoiceSectionOperations +from .operations.billing_subscription_operations import BillingSubscriptionOperations +from .operations.products_by_billing_account_operations import ProductsByBillingAccountOperations +from .operations.products_by_invoice_section_operations import ProductsByInvoiceSectionOperations +from .operations.products_operations import ProductsOperations +from .operations.transactions_by_billing_account_operations import TransactionsByBillingAccountOperations +from .operations.policy_operations import PolicyOperations +from .operations.billing_property_operations import BillingPropertyOperations +from .operations.transfers_operations import TransfersOperations +from .operations.recipient_transfers_operations import RecipientTransfersOperations from .operations.operations import Operations +from .operations.billing_account_billing_permissions_operations import BillingAccountBillingPermissionsOperations +from .operations.invoice_sections_billing_permissions_operations import InvoiceSectionsBillingPermissionsOperations +from .operations.billing_profile_billing_permissions_operations import BillingProfileBillingPermissionsOperations +from .operations.billing_account_billing_role_definition_operations import BillingAccountBillingRoleDefinitionOperations +from .operations.invoice_section_billing_role_definition_operations import InvoiceSectionBillingRoleDefinitionOperations +from .operations.billing_profile_billing_role_definition_operations import BillingProfileBillingRoleDefinitionOperations +from .operations.billing_account_billing_role_assignment_operations import BillingAccountBillingRoleAssignmentOperations +from .operations.invoice_section_billing_role_assignment_operations import InvoiceSectionBillingRoleAssignmentOperations +from .operations.billing_profile_billing_role_assignment_operations import BillingProfileBillingRoleAssignmentOperations from . import models @@ -58,14 +97,84 @@ class BillingManagementClient(SDKClient): :ivar config: Configuration for client. :vartype config: BillingManagementClientConfiguration + :ivar billing_accounts: BillingAccounts operations + :vartype billing_accounts: azure.mgmt.billing.operations.BillingAccountsOperations + :ivar billing_accounts_with_create_invoice_section_permission: BillingAccountsWithCreateInvoiceSectionPermission operations + :vartype billing_accounts_with_create_invoice_section_permission: azure.mgmt.billing.operations.BillingAccountsWithCreateInvoiceSectionPermissionOperations + :ivar available_balance_by_billing_profile: AvailableBalanceByBillingProfile operations + :vartype available_balance_by_billing_profile: azure.mgmt.billing.operations.AvailableBalanceByBillingProfileOperations + :ivar payment_methods_by_billing_profile: PaymentMethodsByBillingProfile operations + :vartype payment_methods_by_billing_profile: azure.mgmt.billing.operations.PaymentMethodsByBillingProfileOperations + :ivar billing_profiles_by_billing_account_name: BillingProfilesByBillingAccountName operations + :vartype billing_profiles_by_billing_account_name: azure.mgmt.billing.operations.BillingProfilesByBillingAccountNameOperations + :ivar billing_profiles: BillingProfiles operations + :vartype billing_profiles: azure.mgmt.billing.operations.BillingProfilesOperations + :ivar invoice_sections_by_billing_account_name: InvoiceSectionsByBillingAccountName operations + :vartype invoice_sections_by_billing_account_name: azure.mgmt.billing.operations.InvoiceSectionsByBillingAccountNameOperations + :ivar invoice_sections: InvoiceSections operations + :vartype invoice_sections: azure.mgmt.billing.operations.InvoiceSectionsOperations + :ivar invoice_sections_with_create_subscription_permission: InvoiceSectionsWithCreateSubscriptionPermission operations + :vartype invoice_sections_with_create_subscription_permission: azure.mgmt.billing.operations.InvoiceSectionsWithCreateSubscriptionPermissionOperations + :ivar departments_by_billing_account_name: DepartmentsByBillingAccountName operations + :vartype departments_by_billing_account_name: azure.mgmt.billing.operations.DepartmentsByBillingAccountNameOperations + :ivar departments: Departments operations + :vartype departments: azure.mgmt.billing.operations.DepartmentsOperations + :ivar enrollment_accounts_by_billing_account_name: EnrollmentAccountsByBillingAccountName operations + :vartype enrollment_accounts_by_billing_account_name: azure.mgmt.billing.operations.EnrollmentAccountsByBillingAccountNameOperations :ivar enrollment_accounts: EnrollmentAccounts operations :vartype enrollment_accounts: azure.mgmt.billing.operations.EnrollmentAccountsOperations - :ivar billing_periods: BillingPeriods operations - :vartype billing_periods: azure.mgmt.billing.operations.BillingPeriodsOperations - :ivar invoices: Invoices operations - :vartype invoices: azure.mgmt.billing.operations.InvoicesOperations + :ivar invoices_by_billing_account: InvoicesByBillingAccount operations + :vartype invoices_by_billing_account: azure.mgmt.billing.operations.InvoicesByBillingAccountOperations + :ivar invoice_pricesheet: InvoicePricesheet operations + :vartype invoice_pricesheet: azure.mgmt.billing.operations.InvoicePricesheetOperations + :ivar invoices_by_billing_profile: InvoicesByBillingProfile operations + :vartype invoices_by_billing_profile: azure.mgmt.billing.operations.InvoicesByBillingProfileOperations + :ivar invoice: Invoice operations + :vartype invoice: azure.mgmt.billing.operations.InvoiceOperations + :ivar products_by_billing_subscriptions: ProductsByBillingSubscriptions operations + :vartype products_by_billing_subscriptions: azure.mgmt.billing.operations.ProductsByBillingSubscriptionsOperations + :ivar billing_subscriptions_by_billing_profile: BillingSubscriptionsByBillingProfile operations + :vartype billing_subscriptions_by_billing_profile: azure.mgmt.billing.operations.BillingSubscriptionsByBillingProfileOperations + :ivar billing_subscriptions_by_invoice_section: BillingSubscriptionsByInvoiceSection operations + :vartype billing_subscriptions_by_invoice_section: azure.mgmt.billing.operations.BillingSubscriptionsByInvoiceSectionOperations + :ivar billing_subscription: BillingSubscription operations + :vartype billing_subscription: azure.mgmt.billing.operations.BillingSubscriptionOperations + :ivar products_by_billing_account: ProductsByBillingAccount operations + :vartype products_by_billing_account: azure.mgmt.billing.operations.ProductsByBillingAccountOperations + :ivar products_by_invoice_section: ProductsByInvoiceSection operations + :vartype products_by_invoice_section: azure.mgmt.billing.operations.ProductsByInvoiceSectionOperations + :ivar products: Products operations + :vartype products: azure.mgmt.billing.operations.ProductsOperations + :ivar transactions_by_billing_account: TransactionsByBillingAccount operations + :vartype transactions_by_billing_account: azure.mgmt.billing.operations.TransactionsByBillingAccountOperations + :ivar policy: Policy operations + :vartype policy: azure.mgmt.billing.operations.PolicyOperations + :ivar billing_property: BillingProperty operations + :vartype billing_property: azure.mgmt.billing.operations.BillingPropertyOperations + :ivar transfers: Transfers operations + :vartype transfers: azure.mgmt.billing.operations.TransfersOperations + :ivar recipient_transfers: RecipientTransfers operations + :vartype recipient_transfers: azure.mgmt.billing.operations.RecipientTransfersOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.billing.operations.Operations + :ivar billing_account_billing_permissions: BillingAccountBillingPermissions operations + :vartype billing_account_billing_permissions: azure.mgmt.billing.operations.BillingAccountBillingPermissionsOperations + :ivar invoice_sections_billing_permissions: InvoiceSectionsBillingPermissions operations + :vartype invoice_sections_billing_permissions: azure.mgmt.billing.operations.InvoiceSectionsBillingPermissionsOperations + :ivar billing_profile_billing_permissions: BillingProfileBillingPermissions operations + :vartype billing_profile_billing_permissions: azure.mgmt.billing.operations.BillingProfileBillingPermissionsOperations + :ivar billing_account_billing_role_definition: BillingAccountBillingRoleDefinition operations + :vartype billing_account_billing_role_definition: azure.mgmt.billing.operations.BillingAccountBillingRoleDefinitionOperations + :ivar invoice_section_billing_role_definition: InvoiceSectionBillingRoleDefinition operations + :vartype invoice_section_billing_role_definition: azure.mgmt.billing.operations.InvoiceSectionBillingRoleDefinitionOperations + :ivar billing_profile_billing_role_definition: BillingProfileBillingRoleDefinition operations + :vartype billing_profile_billing_role_definition: azure.mgmt.billing.operations.BillingProfileBillingRoleDefinitionOperations + :ivar billing_account_billing_role_assignment: BillingAccountBillingRoleAssignment operations + :vartype billing_account_billing_role_assignment: azure.mgmt.billing.operations.BillingAccountBillingRoleAssignmentOperations + :ivar invoice_section_billing_role_assignment: InvoiceSectionBillingRoleAssignment operations + :vartype invoice_section_billing_role_assignment: azure.mgmt.billing.operations.InvoiceSectionBillingRoleAssignmentOperations + :ivar billing_profile_billing_role_assignment: BillingProfileBillingRoleAssignment operations + :vartype billing_profile_billing_role_assignment: azure.mgmt.billing.operations.BillingProfileBillingRoleAssignmentOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -82,15 +191,302 @@ def __init__( super(BillingManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2018-03-01-preview' + self.api_version = '2018-11-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.billing_accounts = BillingAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_accounts_with_create_invoice_section_permission = BillingAccountsWithCreateInvoiceSectionPermissionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.available_balance_by_billing_profile = AvailableBalanceByBillingProfileOperations( + self._client, self.config, self._serialize, self._deserialize) + self.payment_methods_by_billing_profile = PaymentMethodsByBillingProfileOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_profiles_by_billing_account_name = BillingProfilesByBillingAccountNameOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_profiles = BillingProfilesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoice_sections_by_billing_account_name = InvoiceSectionsByBillingAccountNameOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoice_sections = InvoiceSectionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoice_sections_with_create_subscription_permission = InvoiceSectionsWithCreateSubscriptionPermissionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.departments_by_billing_account_name = DepartmentsByBillingAccountNameOperations( + self._client, self.config, self._serialize, self._deserialize) + self.departments = DepartmentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.enrollment_accounts_by_billing_account_name = EnrollmentAccountsByBillingAccountNameOperations( + self._client, self.config, self._serialize, self._deserialize) self.enrollment_accounts = EnrollmentAccountsOperations( self._client, self.config, self._serialize, self._deserialize) - self.billing_periods = BillingPeriodsOperations( + self.invoices_by_billing_account = InvoicesByBillingAccountOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoice_pricesheet = InvoicePricesheetOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoices_by_billing_profile = InvoicesByBillingProfileOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoice = InvoiceOperations( + self._client, self.config, self._serialize, self._deserialize) + self.products_by_billing_subscriptions = ProductsByBillingSubscriptionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_subscriptions_by_billing_profile = BillingSubscriptionsByBillingProfileOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_subscriptions_by_invoice_section = BillingSubscriptionsByInvoiceSectionOperations( self._client, self.config, self._serialize, self._deserialize) - self.invoices = InvoicesOperations( + self.billing_subscription = BillingSubscriptionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.products_by_billing_account = ProductsByBillingAccountOperations( + self._client, self.config, self._serialize, self._deserialize) + self.products_by_invoice_section = ProductsByInvoiceSectionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.products = ProductsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.transactions_by_billing_account = TransactionsByBillingAccountOperations( + self._client, self.config, self._serialize, self._deserialize) + self.policy = PolicyOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_property = BillingPropertyOperations( + self._client, self.config, self._serialize, self._deserialize) + self.transfers = TransfersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.recipient_transfers = RecipientTransfersOperations( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) + self.billing_account_billing_permissions = BillingAccountBillingPermissionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoice_sections_billing_permissions = InvoiceSectionsBillingPermissionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_profile_billing_permissions = BillingProfileBillingPermissionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_account_billing_role_definition = BillingAccountBillingRoleDefinitionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoice_section_billing_role_definition = InvoiceSectionBillingRoleDefinitionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_profile_billing_role_definition = BillingProfileBillingRoleDefinitionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_account_billing_role_assignment = BillingAccountBillingRoleAssignmentOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoice_section_billing_role_assignment = InvoiceSectionBillingRoleAssignmentOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_profile_billing_role_assignment = BillingProfileBillingRoleAssignmentOperations( + self._client, self.config, self._serialize, self._deserialize) + + def transactions_by_billing_profile( + self, billing_account_name, billing_profile_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the transactions by billingProfileName for given start date and + end date. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param start_date: Start date + :type start_date: str + :param end_date: End date + :type end_date: str + :param filter: May be used to filter by transaction kind. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: 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: TransactionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransactionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.transactions_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransactionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + transactions_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/transactions'} + + def update_auto_renew_for_billing_account( + self, billing_account_name, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): + """Cancel product by product id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param product_name: Invoice Id. + :type product_name: str + :param auto_renew: Request parameters to update auto renew policy a + product. Possible values include: 'true', 'false' + :type auto_renew: str or ~azure.mgmt.billing.models.UpdateAutoRenew + :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: UpdateAutoRenewOperationSummary or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.UpdateAutoRenewOperationSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + body = models.UpdateAutoRenewRequest(auto_renew=auto_renew) + + # Construct URL + url = self.update_auto_renew_for_billing_account.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'productName': self._serialize.url("product_name", product_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'UpdateAutoRenewRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('UpdateAutoRenewOperationSummary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_auto_renew_for_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/updateAutoRenew'} + + def update_auto_renew_for_invoice_section( + self, billing_account_name, invoice_section_name, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): + """Cancel auto renew for product by product id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param product_name: Invoice Id. + :type product_name: str + :param auto_renew: Request parameters to update auto renew policy a + product. Possible values include: 'true', 'false' + :type auto_renew: str or ~azure.mgmt.billing.models.UpdateAutoRenew + :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: UpdateAutoRenewOperationSummary or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.UpdateAutoRenewOperationSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + body = models.UpdateAutoRenewRequest(auto_renew=auto_renew) + + # Construct URL + url = self.update_auto_renew_for_invoice_section.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'productName': self._serialize.url("product_name", product_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'UpdateAutoRenewRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('UpdateAutoRenewOperationSummary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_auto_renew_for_invoice_section.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}/updateAutoRenew'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py index 4e5a8bfe9975..1f3d0ce9efe6 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py @@ -10,42 +10,219 @@ # -------------------------------------------------------------------------- try: + from .initiate_transfer_request_py3 import InitiateTransferRequest + from .product_details_py3 import ProductDetails + from .accept_transfer_request_py3 import AcceptTransferRequest + from .error_py3 import Error + from .detailed_transfer_status_py3 import DetailedTransferStatus + from .transfer_details_py3 import TransferDetails + from .recipient_transfer_details_py3 import RecipientTransferDetails + from .transfer_product_request_properties_py3 import TransferProductRequestProperties + from .transfer_billing_subscription_result_py3 import TransferBillingSubscriptionResult + from .transfer_billing_subscription_request_properties_py3 import TransferBillingSubscriptionRequestProperties + from .transfer_billing_subscription_request_py3 import TransferBillingSubscriptionRequest + from .update_auto_renew_operation_summary_py3 import UpdateAutoRenewOperationSummary + from .address_py3 import Address + from .enabled_azure_sk_us_py3 import EnabledAzureSKUs + from .billing_profile_py3 import BillingProfile + from .invoice_section_properties_py3 import InvoiceSectionProperties + from .invoice_section_py3 import InvoiceSection + from .enrollment_policies_py3 import EnrollmentPolicies + from .enrollment_py3 import Enrollment from .enrollment_account_py3 import EnrollmentAccount - from .billing_period_py3 import BillingPeriod + from .department_py3 import Department + from .billing_account_py3 import BillingAccount + from .billing_account_list_result_py3 import BillingAccountListResult + from .billing_property_py3 import BillingProperty + from .department_list_result_py3 import DepartmentListResult + from .enrollment_account_list_result_py3 import EnrollmentAccountListResult + from .billing_profile_list_result_py3 import BillingProfileListResult + from .invoice_section_list_result_py3 import InvoiceSectionListResult + from .operation_status_py3 import OperationStatus from .download_url_py3 import DownloadUrl from .error_details_py3 import ErrorDetails from .error_response_py3 import ErrorResponse, ErrorResponseException - from .invoice_py3 import Invoice + from .resource_py3 import Resource + from .amount_py3 import Amount + from .download_properties_py3 import DownloadProperties + from .payment_properties_py3 import PaymentProperties + from .invoice_summary_py3 import InvoiceSummary + from .invoice_list_result_py3 import InvoiceListResult + from .product_summary_py3 import ProductSummary + from .products_list_result_py3 import ProductsListResult + from .enrollment_account_context_py3 import EnrollmentAccountContext + from .billing_subscription_summary_py3 import BillingSubscriptionSummary + from .billing_subscriptions_list_result_py3 import BillingSubscriptionsListResult + from .transactions_summary_py3 import TransactionsSummary + from .transactions_list_result_py3 import TransactionsListResult + from .policy_py3 import Policy + from .available_balance_py3 import AvailableBalance + from .payment_method_py3 import PaymentMethod + from .update_auto_renew_request_py3 import UpdateAutoRenewRequest from .operation_display_py3 import OperationDisplay from .operation_py3 import Operation - from .resource_py3 import Resource + from .billing_role_assignment_payload_py3 import BillingRoleAssignmentPayload + from .billing_role_assignment_py3 import BillingRoleAssignment + from .billing_role_assignment_list_result_py3 import BillingRoleAssignmentListResult + from .billing_permissions_py3 import BillingPermissions + from .billing_permissions_list_result_py3 import BillingPermissionsListResult + from .billing_role_definition_py3 import BillingRoleDefinition + from .billing_role_definition_list_result_py3 import BillingRoleDefinitionListResult except (SyntaxError, ImportError): + from .initiate_transfer_request import InitiateTransferRequest + from .product_details import ProductDetails + from .accept_transfer_request import AcceptTransferRequest + from .error import Error + from .detailed_transfer_status import DetailedTransferStatus + from .transfer_details import TransferDetails + from .recipient_transfer_details import RecipientTransferDetails + from .transfer_product_request_properties import TransferProductRequestProperties + from .transfer_billing_subscription_result import TransferBillingSubscriptionResult + from .transfer_billing_subscription_request_properties import TransferBillingSubscriptionRequestProperties + from .transfer_billing_subscription_request import TransferBillingSubscriptionRequest + from .update_auto_renew_operation_summary import UpdateAutoRenewOperationSummary + from .address import Address + from .enabled_azure_sk_us import EnabledAzureSKUs + from .billing_profile import BillingProfile + from .invoice_section_properties import InvoiceSectionProperties + from .invoice_section import InvoiceSection + from .enrollment_policies import EnrollmentPolicies + from .enrollment import Enrollment from .enrollment_account import EnrollmentAccount - from .billing_period import BillingPeriod + from .department import Department + from .billing_account import BillingAccount + from .billing_account_list_result import BillingAccountListResult + from .billing_property import BillingProperty + from .department_list_result import DepartmentListResult + from .enrollment_account_list_result import EnrollmentAccountListResult + from .billing_profile_list_result import BillingProfileListResult + from .invoice_section_list_result import InvoiceSectionListResult + from .operation_status import OperationStatus from .download_url import DownloadUrl from .error_details import ErrorDetails from .error_response import ErrorResponse, ErrorResponseException - from .invoice import Invoice + from .resource import Resource + from .amount import Amount + from .download_properties import DownloadProperties + from .payment_properties import PaymentProperties + from .invoice_summary import InvoiceSummary + from .invoice_list_result import InvoiceListResult + from .product_summary import ProductSummary + from .products_list_result import ProductsListResult + from .enrollment_account_context import EnrollmentAccountContext + from .billing_subscription_summary import BillingSubscriptionSummary + from .billing_subscriptions_list_result import BillingSubscriptionsListResult + from .transactions_summary import TransactionsSummary + from .transactions_list_result import TransactionsListResult + from .policy import Policy + from .available_balance import AvailableBalance + from .payment_method import PaymentMethod + from .update_auto_renew_request import UpdateAutoRenewRequest from .operation_display import OperationDisplay from .operation import Operation - from .resource import Resource -from .enrollment_account_paged import EnrollmentAccountPaged -from .billing_period_paged import BillingPeriodPaged -from .invoice_paged import InvoicePaged + from .billing_role_assignment_payload import BillingRoleAssignmentPayload + from .billing_role_assignment import BillingRoleAssignment + from .billing_role_assignment_list_result import BillingRoleAssignmentListResult + from .billing_permissions import BillingPermissions + from .billing_permissions_list_result import BillingPermissionsListResult + from .billing_role_definition import BillingRoleDefinition + from .billing_role_definition_list_result import BillingRoleDefinitionListResult +from .payment_method_paged import PaymentMethodPaged +from .billing_subscription_summary_paged import BillingSubscriptionSummaryPaged +from .product_summary_paged import ProductSummaryPaged +from .transactions_summary_paged import TransactionsSummaryPaged +from .transfer_details_paged import TransferDetailsPaged +from .recipient_transfer_details_paged import RecipientTransferDetailsPaged from .operation_paged import OperationPaged +from .billing_management_client_enums import ( + ProductType, + TransferStatus, + ProductTransferStatus, + EligibleProductType, + ProductStatusType, + BillingFrequency, + BillingSubscriptionStatusType, + TransactionTypeKind, + ReservationType, + PaymentMethodType, + UpdateAutoRenew, +) __all__ = [ + 'InitiateTransferRequest', + 'ProductDetails', + 'AcceptTransferRequest', + 'Error', + 'DetailedTransferStatus', + 'TransferDetails', + 'RecipientTransferDetails', + 'TransferProductRequestProperties', + 'TransferBillingSubscriptionResult', + 'TransferBillingSubscriptionRequestProperties', + 'TransferBillingSubscriptionRequest', + 'UpdateAutoRenewOperationSummary', + 'Address', + 'EnabledAzureSKUs', + 'BillingProfile', + 'InvoiceSectionProperties', + 'InvoiceSection', + 'EnrollmentPolicies', + 'Enrollment', 'EnrollmentAccount', - 'BillingPeriod', + 'Department', + 'BillingAccount', + 'BillingAccountListResult', + 'BillingProperty', + 'DepartmentListResult', + 'EnrollmentAccountListResult', + 'BillingProfileListResult', + 'InvoiceSectionListResult', + 'OperationStatus', 'DownloadUrl', 'ErrorDetails', 'ErrorResponse', 'ErrorResponseException', - 'Invoice', + 'Resource', + 'Amount', + 'DownloadProperties', + 'PaymentProperties', + 'InvoiceSummary', + 'InvoiceListResult', + 'ProductSummary', + 'ProductsListResult', + 'EnrollmentAccountContext', + 'BillingSubscriptionSummary', + 'BillingSubscriptionsListResult', + 'TransactionsSummary', + 'TransactionsListResult', + 'Policy', + 'AvailableBalance', + 'PaymentMethod', + 'UpdateAutoRenewRequest', 'OperationDisplay', 'Operation', - 'Resource', - 'EnrollmentAccountPaged', - 'BillingPeriodPaged', - 'InvoicePaged', + 'BillingRoleAssignmentPayload', + 'BillingRoleAssignment', + 'BillingRoleAssignmentListResult', + 'BillingPermissions', + 'BillingPermissionsListResult', + 'BillingRoleDefinition', + 'BillingRoleDefinitionListResult', + 'PaymentMethodPaged', + 'BillingSubscriptionSummaryPaged', + 'ProductSummaryPaged', + 'TransactionsSummaryPaged', + 'TransferDetailsPaged', + 'RecipientTransferDetailsPaged', 'OperationPaged', + 'ProductType', + 'TransferStatus', + 'ProductTransferStatus', + 'EligibleProductType', + 'ProductStatusType', + 'BillingFrequency', + 'BillingSubscriptionStatusType', + 'TransactionTypeKind', + 'ReservationType', + 'PaymentMethodType', + 'UpdateAutoRenew', ] diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request.py b/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request.py new file mode 100644 index 000000000000..375360756bcd --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request.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 AcceptTransferRequest(Model): + """Request parameters to accept transfer. + + :param product_details: Request parameters to accept transfer. + :type product_details: list[~azure.mgmt.billing.models.ProductDetails] + """ + + _attribute_map = { + 'product_details': {'key': 'properties.productDetails', 'type': '[ProductDetails]'}, + } + + def __init__(self, **kwargs): + super(AcceptTransferRequest, self).__init__(**kwargs) + self.product_details = kwargs.get('product_details', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request_py3.py new file mode 100644 index 000000000000..3c82c015bb09 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request_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 AcceptTransferRequest(Model): + """Request parameters to accept transfer. + + :param product_details: Request parameters to accept transfer. + :type product_details: list[~azure.mgmt.billing.models.ProductDetails] + """ + + _attribute_map = { + 'product_details': {'key': 'properties.productDetails', 'type': '[ProductDetails]'}, + } + + def __init__(self, *, product_details=None, **kwargs) -> None: + super(AcceptTransferRequest, self).__init__(**kwargs) + self.product_details = product_details diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/address.py b/azure-mgmt-billing/azure/mgmt/billing/models/address.py new file mode 100644 index 000000000000..062465328263 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/address.py @@ -0,0 +1,64 @@ +# 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 Address(Model): + """Address details. + + :param first_name: First Name. + :type first_name: str + :param last_name: Last Name. + :type last_name: str + :param company_name: Company Name. + :type company_name: str + :param address_line1: Address Line1. + :type address_line1: str + :param address_line2: Address Line2. + :type address_line2: str + :param address_line3: Address Line3. + :type address_line3: str + :param city: Address City. + :type city: str + :param region: Address Region. + :type region: str + :param country: Country code uses ISO2, 2-digit format. + :type country: str + :param postal_code: Address Postal Code. + :type postal_code: str + """ + + _attribute_map = { + 'first_name': {'key': 'firstName', 'type': 'str'}, + 'last_name': {'key': 'lastName', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'address_line1': {'key': 'addressLine1', 'type': 'str'}, + 'address_line2': {'key': 'addressLine2', 'type': 'str'}, + 'address_line3': {'key': 'addressLine3', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Address, self).__init__(**kwargs) + self.first_name = kwargs.get('first_name', None) + self.last_name = kwargs.get('last_name', None) + self.company_name = kwargs.get('company_name', None) + self.address_line1 = kwargs.get('address_line1', None) + self.address_line2 = kwargs.get('address_line2', None) + self.address_line3 = kwargs.get('address_line3', None) + self.city = kwargs.get('city', None) + self.region = kwargs.get('region', None) + self.country = kwargs.get('country', None) + self.postal_code = kwargs.get('postal_code', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/address_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/address_py3.py new file mode 100644 index 000000000000..df46f07863f2 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/address_py3.py @@ -0,0 +1,64 @@ +# 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 Address(Model): + """Address details. + + :param first_name: First Name. + :type first_name: str + :param last_name: Last Name. + :type last_name: str + :param company_name: Company Name. + :type company_name: str + :param address_line1: Address Line1. + :type address_line1: str + :param address_line2: Address Line2. + :type address_line2: str + :param address_line3: Address Line3. + :type address_line3: str + :param city: Address City. + :type city: str + :param region: Address Region. + :type region: str + :param country: Country code uses ISO2, 2-digit format. + :type country: str + :param postal_code: Address Postal Code. + :type postal_code: str + """ + + _attribute_map = { + 'first_name': {'key': 'firstName', 'type': 'str'}, + 'last_name': {'key': 'lastName', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'address_line1': {'key': 'addressLine1', 'type': 'str'}, + 'address_line2': {'key': 'addressLine2', 'type': 'str'}, + 'address_line3': {'key': 'addressLine3', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + } + + def __init__(self, *, first_name: str=None, last_name: str=None, company_name: str=None, address_line1: str=None, address_line2: str=None, address_line3: str=None, city: str=None, region: str=None, country: str=None, postal_code: str=None, **kwargs) -> None: + super(Address, self).__init__(**kwargs) + self.first_name = first_name + self.last_name = last_name + self.company_name = company_name + self.address_line1 = address_line1 + self.address_line2 = address_line2 + self.address_line3 = address_line3 + self.city = city + self.region = region + self.country = country + self.postal_code = postal_code diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/amount.py b/azure-mgmt-billing/azure/mgmt/billing/models/amount.py new file mode 100644 index 000000000000..2707d55dcac7 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/amount.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 Amount(Model): + """The Amount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar currency: The currency for the amount value. + :vartype currency: str + :ivar value: Amount value. + :vartype value: float + """ + + _validation = { + 'currency': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'currency': {'key': 'currency', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(Amount, self).__init__(**kwargs) + self.currency = None + self.value = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/amount_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/amount_py3.py new file mode 100644 index 000000000000..2f992f1c63c5 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/amount_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 Amount(Model): + """The Amount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar currency: The currency for the amount value. + :vartype currency: str + :ivar value: Amount value. + :vartype value: float + """ + + _validation = { + 'currency': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'currency': {'key': 'currency', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(Amount, self).__init__(**kwargs) + self.currency = None + self.value = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_period.py b/azure-mgmt-billing/azure/mgmt/billing/models/available_balance.py similarity index 51% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_period.py rename to azure-mgmt-billing/azure/mgmt/billing/models/available_balance.py index ec1f2039ea1d..61b66201e156 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_period.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/available_balance.py @@ -12,8 +12,8 @@ from .resource import Resource -class BillingPeriod(Resource): - """A billing period resource. +class AvailableBalance(Resource): + """Latest available balance on Monetary Credit PI. Variables are only populated by the server, and will be ignored when sending a request. @@ -24,36 +24,24 @@ class BillingPeriod(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar billing_period_start_date: The start of the date range covered by - the billing period. - :vartype billing_period_start_date: date - :ivar billing_period_end_date: The end of the date range covered by the - billing period. - :vartype billing_period_end_date: date - :ivar invoice_ids: Array of invoice ids that associated with. - :vartype invoice_ids: list[str] + :ivar amount: Balance Amount. + :vartype amount: ~azure.mgmt.billing.models.Amount """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'billing_period_start_date': {'readonly': True}, - 'billing_period_end_date': {'readonly': True}, - 'invoice_ids': {'readonly': True}, + 'amount': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'billing_period_start_date': {'key': 'properties.billingPeriodStartDate', 'type': 'date'}, - 'billing_period_end_date': {'key': 'properties.billingPeriodEndDate', 'type': 'date'}, - 'invoice_ids': {'key': 'properties.invoiceIds', 'type': '[str]'}, + 'amount': {'key': 'properties.amount', 'type': 'Amount'}, } def __init__(self, **kwargs): - super(BillingPeriod, self).__init__(**kwargs) - self.billing_period_start_date = None - self.billing_period_end_date = None - self.invoice_ids = None + super(AvailableBalance, self).__init__(**kwargs) + self.amount = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_period_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/available_balance_py3.py similarity index 51% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_period_py3.py rename to azure-mgmt-billing/azure/mgmt/billing/models/available_balance_py3.py index 7d5ecbe3a0a8..e4c17832fbee 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_period_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/available_balance_py3.py @@ -12,8 +12,8 @@ from .resource_py3 import Resource -class BillingPeriod(Resource): - """A billing period resource. +class AvailableBalance(Resource): + """Latest available balance on Monetary Credit PI. Variables are only populated by the server, and will be ignored when sending a request. @@ -24,36 +24,24 @@ class BillingPeriod(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar billing_period_start_date: The start of the date range covered by - the billing period. - :vartype billing_period_start_date: date - :ivar billing_period_end_date: The end of the date range covered by the - billing period. - :vartype billing_period_end_date: date - :ivar invoice_ids: Array of invoice ids that associated with. - :vartype invoice_ids: list[str] + :ivar amount: Balance Amount. + :vartype amount: ~azure.mgmt.billing.models.Amount """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'billing_period_start_date': {'readonly': True}, - 'billing_period_end_date': {'readonly': True}, - 'invoice_ids': {'readonly': True}, + 'amount': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'billing_period_start_date': {'key': 'properties.billingPeriodStartDate', 'type': 'date'}, - 'billing_period_end_date': {'key': 'properties.billingPeriodEndDate', 'type': 'date'}, - 'invoice_ids': {'key': 'properties.invoiceIds', 'type': '[str]'}, + 'amount': {'key': 'properties.amount', 'type': 'Amount'}, } def __init__(self, **kwargs) -> None: - super(BillingPeriod, self).__init__(**kwargs) - self.billing_period_start_date = None - self.billing_period_end_date = None - self.invoice_ids = None + super(AvailableBalance, self).__init__(**kwargs) + self.amount = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py new file mode 100644 index 000000000000..4769f51c9457 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py @@ -0,0 +1,93 @@ +# 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 .resource import Resource + + +class BillingAccount(Resource): + """A billing account resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: The billing account name. + :vartype display_name: str + :ivar company: The Company this billing account belongs to. + :vartype company: str + :ivar account_type: The billing account Type. Possible values include: + 'Organization', 'Enrollment' + :vartype account_type: str or ~azure.mgmt.billing.models.enum + :param address: The address associated with billing account. + :type address: ~azure.mgmt.billing.models.Address + :ivar country: The country associated with billing account.. + :vartype country: str + :param invoice_sections: The invoice sections associated to the billing + account. + :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] + :param billing_profiles: The billing profiles associated to the billing + account. + :type billing_profiles: list[~azure.mgmt.billing.models.BillingProfile] + :ivar enrollment_details: The details about the associated legacy + enrollment. By default this is not populated, unless it's specified in + $expand. + :vartype enrollment_details: ~azure.mgmt.billing.models.Enrollment + :param departments: The departments associated to the enrollment. + :type departments: list[~azure.mgmt.billing.models.Department] + :param enrollment_accounts: The accounts associated to the enrollment. + :type enrollment_accounts: + list[~azure.mgmt.billing.models.EnrollmentAccount] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'company': {'readonly': True}, + 'account_type': {'readonly': True}, + 'country': {'readonly': True}, + 'enrollment_details': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'company': {'key': 'properties.company', 'type': 'str'}, + 'account_type': {'key': 'properties.accountType', 'type': 'str'}, + 'address': {'key': 'properties.address', 'type': 'Address'}, + 'country': {'key': 'properties.country', 'type': 'str'}, + 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, + 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, + 'enrollment_details': {'key': 'properties.enrollmentDetails', 'type': 'Enrollment'}, + 'departments': {'key': 'properties.departments', 'type': '[Department]'}, + 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, + } + + def __init__(self, **kwargs): + super(BillingAccount, self).__init__(**kwargs) + self.display_name = None + self.company = None + self.account_type = None + self.address = kwargs.get('address', None) + self.country = None + self.invoice_sections = kwargs.get('invoice_sections', None) + self.billing_profiles = kwargs.get('billing_profiles', None) + self.enrollment_details = None + self.departments = kwargs.get('departments', None) + self.enrollment_accounts = kwargs.get('enrollment_accounts', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result.py new file mode 100644 index 000000000000..311bed43f801 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result.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 BillingAccountListResult(Model): + """Result of listing billing accounts. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of billing accounts. + :vartype value: list[~azure.mgmt.billing.models.BillingAccount] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingAccountListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result_py3.py new file mode 100644 index 000000000000..fa94c0d30857 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result_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 BillingAccountListResult(Model): + """Result of listing billing accounts. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of billing accounts. + :vartype value: list[~azure.mgmt.billing.models.BillingAccount] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingAccountListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py new file mode 100644 index 000000000000..06f2f04535b0 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py @@ -0,0 +1,93 @@ +# 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 .resource_py3 import Resource + + +class BillingAccount(Resource): + """A billing account resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: The billing account name. + :vartype display_name: str + :ivar company: The Company this billing account belongs to. + :vartype company: str + :ivar account_type: The billing account Type. Possible values include: + 'Organization', 'Enrollment' + :vartype account_type: str or ~azure.mgmt.billing.models.enum + :param address: The address associated with billing account. + :type address: ~azure.mgmt.billing.models.Address + :ivar country: The country associated with billing account.. + :vartype country: str + :param invoice_sections: The invoice sections associated to the billing + account. + :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] + :param billing_profiles: The billing profiles associated to the billing + account. + :type billing_profiles: list[~azure.mgmt.billing.models.BillingProfile] + :ivar enrollment_details: The details about the associated legacy + enrollment. By default this is not populated, unless it's specified in + $expand. + :vartype enrollment_details: ~azure.mgmt.billing.models.Enrollment + :param departments: The departments associated to the enrollment. + :type departments: list[~azure.mgmt.billing.models.Department] + :param enrollment_accounts: The accounts associated to the enrollment. + :type enrollment_accounts: + list[~azure.mgmt.billing.models.EnrollmentAccount] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'company': {'readonly': True}, + 'account_type': {'readonly': True}, + 'country': {'readonly': True}, + 'enrollment_details': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'company': {'key': 'properties.company', 'type': 'str'}, + 'account_type': {'key': 'properties.accountType', 'type': 'str'}, + 'address': {'key': 'properties.address', 'type': 'Address'}, + 'country': {'key': 'properties.country', 'type': 'str'}, + 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, + 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, + 'enrollment_details': {'key': 'properties.enrollmentDetails', 'type': 'Enrollment'}, + 'departments': {'key': 'properties.departments', 'type': '[Department]'}, + 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, + } + + def __init__(self, *, address=None, invoice_sections=None, billing_profiles=None, departments=None, enrollment_accounts=None, **kwargs) -> None: + super(BillingAccount, self).__init__(**kwargs) + self.display_name = None + self.company = None + self.account_type = None + self.address = address + self.country = None + self.invoice_sections = invoice_sections + self.billing_profiles = billing_profiles + self.enrollment_details = None + self.departments = departments + self.enrollment_accounts = enrollment_accounts diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py new file mode 100644 index 000000000000..39ace87835df --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py @@ -0,0 +1,96 @@ +# 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 enum import Enum + + +class ProductType(str, Enum): + + azure_subscription = "AzureSubscription" + azure_reservation = "AzureReservation" + + +class TransferStatus(str, Enum): + + pending = "Pending" + in_progress = "InProgress" + completed = "Completed" + completed_with_errors = "CompletedWithErrors" + failed = "Failed" + canceled = "Canceled" + declined = "Declined" + + +class ProductTransferStatus(str, Enum): + + not_started = "NotStarted" + in_progress = "InProgress" + completed = "Completed" + failed = "Failed" + + +class EligibleProductType(str, Enum): + + dev_test_azure_subscription = "DevTestAzureSubscription" + standard_azure_subscription = "StandardAzureSubscription" + azure_reservation = "AzureReservation" + + +class ProductStatusType(str, Enum): + + active = "Active" + inactive = "Inactive" + past_due = "PastDue" + expiring = "Expiring" + expired = "Expired" + disabled = "Disabled" + cancelled = "Cancelled" + auto_renew = "AutoRenew" + + +class BillingFrequency(str, Enum): + + one_time = "OneTime" + monthly = "Monthly" + usage_based = "UsageBased" + + +class BillingSubscriptionStatusType(str, Enum): + + active = "Active" + inactive = "Inactive" + abandoned = "Abandoned" + deleted = "Deleted" + warning = "Warning" + + +class TransactionTypeKind(str, Enum): + + all = "all" + reservation = "reservation" + + +class ReservationType(str, Enum): + + purchase = "Purchase" + usage_charge = "Usage Charge" + + +class PaymentMethodType(str, Enum): + + credits = "Credits" + cheque_wire = "ChequeWire" + + +class UpdateAutoRenew(str, Enum): + + true = "true" + false = "false" diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions.py new file mode 100644 index 000000000000..dfb6d75273a2 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions.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 + + +class BillingPermissions(Model): + """The set of allowed action and not allowed actions a caller has on a billing + account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar actions: The set of actions that the caller is allowed to do + :vartype actions: list[str] + :ivar not_actions: The set of actions the caller is not allowed to do + :vartype not_actions: list[str] + """ + + _validation = { + 'actions': {'readonly': True}, + 'not_actions': {'readonly': True}, + } + + _attribute_map = { + 'actions': {'key': 'actions', 'type': '[str]'}, + 'not_actions': {'key': 'notActions', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(BillingPermissions, self).__init__(**kwargs) + self.actions = None + self.not_actions = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.py new file mode 100644 index 000000000000..a2df95cab160 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.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 BillingPermissionsListResult(Model): + """Result of list billingPermissions a caller has on a billing account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list OF billingPermissions a caller has on a billing + account. + :vartype value: list[~azure.mgmt.billing.models.BillingPermissions] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingPermissions]'}, + } + + def __init__(self, **kwargs): + super(BillingPermissionsListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_py3.py new file mode 100644 index 000000000000..dd88a48cdc83 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_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 BillingPermissionsListResult(Model): + """Result of list billingPermissions a caller has on a billing account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list OF billingPermissions a caller has on a billing + account. + :vartype value: list[~azure.mgmt.billing.models.BillingPermissions] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingPermissions]'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingPermissionsListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_py3.py new file mode 100644 index 000000000000..d0a020868a94 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_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 + + +class BillingPermissions(Model): + """The set of allowed action and not allowed actions a caller has on a billing + account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar actions: The set of actions that the caller is allowed to do + :vartype actions: list[str] + :ivar not_actions: The set of actions the caller is not allowed to do + :vartype not_actions: list[str] + """ + + _validation = { + 'actions': {'readonly': True}, + 'not_actions': {'readonly': True}, + } + + _attribute_map = { + 'actions': {'key': 'actions', 'type': '[str]'}, + 'not_actions': {'key': 'notActions', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingPermissions, self).__init__(**kwargs) + self.actions = None + self.not_actions = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py new file mode 100644 index 000000000000..9fbb2d68a214 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py @@ -0,0 +1,85 @@ +# 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 .resource import Resource + + +class BillingProfile(Resource): + """A billing profile resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: The billing profile name. + :type display_name: str + :param po_number: Purchase order number. + :type po_number: str + :param billing_address: Billing address. + :type billing_address: ~azure.mgmt.billing.models.Address + :ivar invoice_email_opt_in: If the billing profile is opted in to receive + invoices via email. + :vartype invoice_email_opt_in: bool + :ivar is_classic: Is OMS bootstrapped billing profile. + :vartype is_classic: bool + :ivar invoice_day: Invoice day. + :vartype invoice_day: int + :ivar currency: The currency associated with the billing profile. + :vartype currency: str + :param enabled_azure_sk_us: Information about the product. + :type enabled_azure_sk_us: + list[~azure.mgmt.billing.models.EnabledAzureSKUs] + :param invoice_sections: The invoice sections associated to the billing + profile. + :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'invoice_email_opt_in': {'readonly': True}, + 'is_classic': {'readonly': True}, + 'invoice_day': {'readonly': True}, + 'currency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'po_number': {'key': 'properties.poNumber', 'type': 'str'}, + 'billing_address': {'key': 'properties.billingAddress', 'type': 'Address'}, + 'invoice_email_opt_in': {'key': 'properties.invoiceEmailOptIn', 'type': 'bool'}, + 'is_classic': {'key': 'properties.isClassic', 'type': 'bool'}, + 'invoice_day': {'key': 'properties.invoiceDay', 'type': 'int'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'enabled_azure_sk_us': {'key': 'properties.enabledAzureSKUs', 'type': '[EnabledAzureSKUs]'}, + 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, + } + + def __init__(self, **kwargs): + super(BillingProfile, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.po_number = kwargs.get('po_number', None) + self.billing_address = kwargs.get('billing_address', None) + self.invoice_email_opt_in = None + self.is_classic = None + self.invoice_day = None + self.currency = None + self.enabled_azure_sk_us = kwargs.get('enabled_azure_sk_us', None) + self.invoice_sections = kwargs.get('invoice_sections', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result.py new file mode 100644 index 000000000000..3a117e471cab --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result.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 BillingProfileListResult(Model): + """Result of listing billing profiles. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of billing profiles. + :vartype value: list[~azure.mgmt.billing.models.BillingProfile] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingProfile]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingProfileListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result_py3.py new file mode 100644 index 000000000000..470cb7f349c8 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result_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 BillingProfileListResult(Model): + """Result of listing billing profiles. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of billing profiles. + :vartype value: list[~azure.mgmt.billing.models.BillingProfile] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingProfile]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingProfileListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py new file mode 100644 index 000000000000..d7113faf83f3 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py @@ -0,0 +1,85 @@ +# 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 .resource_py3 import Resource + + +class BillingProfile(Resource): + """A billing profile resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: The billing profile name. + :type display_name: str + :param po_number: Purchase order number. + :type po_number: str + :param billing_address: Billing address. + :type billing_address: ~azure.mgmt.billing.models.Address + :ivar invoice_email_opt_in: If the billing profile is opted in to receive + invoices via email. + :vartype invoice_email_opt_in: bool + :ivar is_classic: Is OMS bootstrapped billing profile. + :vartype is_classic: bool + :ivar invoice_day: Invoice day. + :vartype invoice_day: int + :ivar currency: The currency associated with the billing profile. + :vartype currency: str + :param enabled_azure_sk_us: Information about the product. + :type enabled_azure_sk_us: + list[~azure.mgmt.billing.models.EnabledAzureSKUs] + :param invoice_sections: The invoice sections associated to the billing + profile. + :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'invoice_email_opt_in': {'readonly': True}, + 'is_classic': {'readonly': True}, + 'invoice_day': {'readonly': True}, + 'currency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'po_number': {'key': 'properties.poNumber', 'type': 'str'}, + 'billing_address': {'key': 'properties.billingAddress', 'type': 'Address'}, + 'invoice_email_opt_in': {'key': 'properties.invoiceEmailOptIn', 'type': 'bool'}, + 'is_classic': {'key': 'properties.isClassic', 'type': 'bool'}, + 'invoice_day': {'key': 'properties.invoiceDay', 'type': 'int'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'enabled_azure_sk_us': {'key': 'properties.enabledAzureSKUs', 'type': '[EnabledAzureSKUs]'}, + 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, + } + + def __init__(self, *, display_name: str=None, po_number: str=None, billing_address=None, enabled_azure_sk_us=None, invoice_sections=None, **kwargs) -> None: + super(BillingProfile, self).__init__(**kwargs) + self.display_name = display_name + self.po_number = po_number + self.billing_address = billing_address + self.invoice_email_opt_in = None + self.is_classic = None + self.invoice_day = None + self.currency = None + self.enabled_azure_sk_us = enabled_azure_sk_us + self.invoice_sections = invoice_sections diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py new file mode 100644 index 000000000000..03e1f2c5c142 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py @@ -0,0 +1,80 @@ +# 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 BillingProperty(Model): + """The billing property. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar product_id: Product Id. + :vartype product_id: str + :ivar billing_tenant_id: Billing tenant Id. + :vartype billing_tenant_id: str + :ivar billing_account_id: Billing account Id. + :vartype billing_account_id: str + :ivar billing_account_name: Billing account name. + :vartype billing_account_name: str + :ivar billing_profile_id: Billing profile Id. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing profile name. + :vartype billing_profile_name: str + :ivar invoice_section_id: Invoice Section Id. + :vartype invoice_section_id: str + :ivar invoice_section_name: Invoice Section name. + :vartype invoice_section_name: str + :ivar sku_id: SKU Id. + :vartype sku_id: str + :ivar sku_description: SKU description. + :vartype sku_description: str + """ + + _validation = { + 'product_id': {'readonly': True}, + 'billing_tenant_id': {'readonly': True}, + 'billing_account_id': {'readonly': True}, + 'billing_account_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'sku_id': {'readonly': True}, + 'sku_description': {'readonly': True}, + } + + _attribute_map = { + 'product_id': {'key': 'productId', 'type': 'str'}, + 'billing_tenant_id': {'key': 'billingTenantId', 'type': 'str'}, + 'billing_account_id': {'key': 'billingAccountId', 'type': 'str'}, + 'billing_account_name': {'key': 'billingAccountName', 'type': 'str'}, + 'billing_profile_id': {'key': 'billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'billingProfileName', 'type': 'str'}, + 'invoice_section_id': {'key': 'invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'invoiceSectionName', 'type': 'str'}, + 'sku_id': {'key': 'skuId', 'type': 'str'}, + 'sku_description': {'key': 'skuDescription', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingProperty, self).__init__(**kwargs) + self.product_id = None + self.billing_tenant_id = None + self.billing_account_id = None + self.billing_account_name = None + self.billing_profile_id = None + self.billing_profile_name = None + self.invoice_section_id = None + self.invoice_section_name = None + self.sku_id = None + self.sku_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py new file mode 100644 index 000000000000..0334fde90ca7 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py @@ -0,0 +1,80 @@ +# 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 BillingProperty(Model): + """The billing property. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar product_id: Product Id. + :vartype product_id: str + :ivar billing_tenant_id: Billing tenant Id. + :vartype billing_tenant_id: str + :ivar billing_account_id: Billing account Id. + :vartype billing_account_id: str + :ivar billing_account_name: Billing account name. + :vartype billing_account_name: str + :ivar billing_profile_id: Billing profile Id. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing profile name. + :vartype billing_profile_name: str + :ivar invoice_section_id: Invoice Section Id. + :vartype invoice_section_id: str + :ivar invoice_section_name: Invoice Section name. + :vartype invoice_section_name: str + :ivar sku_id: SKU Id. + :vartype sku_id: str + :ivar sku_description: SKU description. + :vartype sku_description: str + """ + + _validation = { + 'product_id': {'readonly': True}, + 'billing_tenant_id': {'readonly': True}, + 'billing_account_id': {'readonly': True}, + 'billing_account_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'sku_id': {'readonly': True}, + 'sku_description': {'readonly': True}, + } + + _attribute_map = { + 'product_id': {'key': 'productId', 'type': 'str'}, + 'billing_tenant_id': {'key': 'billingTenantId', 'type': 'str'}, + 'billing_account_id': {'key': 'billingAccountId', 'type': 'str'}, + 'billing_account_name': {'key': 'billingAccountName', 'type': 'str'}, + 'billing_profile_id': {'key': 'billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'billingProfileName', 'type': 'str'}, + 'invoice_section_id': {'key': 'invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'invoiceSectionName', 'type': 'str'}, + 'sku_id': {'key': 'skuId', 'type': 'str'}, + 'sku_description': {'key': 'skuDescription', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingProperty, self).__init__(**kwargs) + self.product_id = None + self.billing_tenant_id = None + self.billing_account_id = None + self.billing_account_name = None + self.billing_profile_id = None + self.billing_profile_name = None + self.invoice_section_id = None + self.invoice_section_name = None + self.sku_id = None + self.sku_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment.py new file mode 100644 index 000000000000..c626a9811a31 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment.py @@ -0,0 +1,77 @@ +# 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 .resource import Resource + + +class BillingRoleAssignment(Resource): + """a role assignment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar created_on: the date the role assignment is created + :vartype created_on: str + :ivar created_by_principal_tenant_id: the creator's tenant Id + :vartype created_by_principal_tenant_id: str + :ivar created_by_principal_id: the creator's principal Id + :vartype created_by_principal_id: str + :ivar billing_role_assignment_name: the name of the role assignment + :vartype billing_role_assignment_name: str + :ivar principal_id: The user's principal id that the role gets assigned to + :vartype principal_id: str + :ivar role_definition_name: The role definition id + :vartype role_definition_name: str + :ivar scope: The scope the role get assigned to + :vartype scope: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_on': {'readonly': True}, + 'created_by_principal_tenant_id': {'readonly': True}, + 'created_by_principal_id': {'readonly': True}, + 'billing_role_assignment_name': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'role_definition_name': {'readonly': True}, + 'scope': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'str'}, + 'created_by_principal_tenant_id': {'key': 'properties.createdByPrincipalTenantId', 'type': 'str'}, + 'created_by_principal_id': {'key': 'properties.createdByPrincipalId', 'type': 'str'}, + 'billing_role_assignment_name': {'key': 'properties.name', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'role_definition_name': {'key': 'properties.roleDefinitionName', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingRoleAssignment, self).__init__(**kwargs) + self.created_on = None + self.created_by_principal_tenant_id = None + self.created_by_principal_id = None + self.billing_role_assignment_name = None + self.principal_id = None + self.role_definition_name = None + self.scope = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result.py new file mode 100644 index 000000000000..e0bd17aae8cc --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result.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 BillingRoleAssignmentListResult(Model): + """Result of get list of role assignments. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list role assignments + :vartype value: list[~azure.mgmt.billing.models.BillingRoleAssignment] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingRoleAssignment]'}, + } + + def __init__(self, **kwargs): + super(BillingRoleAssignmentListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result_py3.py new file mode 100644 index 000000000000..ff36c26cf4dd --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result_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 BillingRoleAssignmentListResult(Model): + """Result of get list of role assignments. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list role assignments + :vartype value: list[~azure.mgmt.billing.models.BillingRoleAssignment] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingRoleAssignment]'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingRoleAssignmentListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.py new file mode 100644 index 000000000000..7cc47de28ff1 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.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 BillingRoleAssignmentPayload(Model): + """The payload use to update role assignment on a scope. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The user's principal id that the role gets assigned to + :vartype principal_id: str + :ivar billing_role_definition_name: The role definition id + :vartype billing_role_definition_name: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'billing_role_definition_name': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'billing_role_definition_name': {'key': 'billingRoleDefinitionName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingRoleAssignmentPayload, self).__init__(**kwargs) + self.principal_id = None + self.billing_role_definition_name = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py new file mode 100644 index 000000000000..966a8fe639df --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_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 BillingRoleAssignmentPayload(Model): + """The payload use to update role assignment on a scope. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The user's principal id that the role gets assigned to + :vartype principal_id: str + :ivar billing_role_definition_name: The role definition id + :vartype billing_role_definition_name: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'billing_role_definition_name': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'billing_role_definition_name': {'key': 'billingRoleDefinitionName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingRoleAssignmentPayload, self).__init__(**kwargs) + self.principal_id = None + self.billing_role_definition_name = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_py3.py new file mode 100644 index 000000000000..05dcf924e246 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_py3.py @@ -0,0 +1,77 @@ +# 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 .resource_py3 import Resource + + +class BillingRoleAssignment(Resource): + """a role assignment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar created_on: the date the role assignment is created + :vartype created_on: str + :ivar created_by_principal_tenant_id: the creator's tenant Id + :vartype created_by_principal_tenant_id: str + :ivar created_by_principal_id: the creator's principal Id + :vartype created_by_principal_id: str + :ivar billing_role_assignment_name: the name of the role assignment + :vartype billing_role_assignment_name: str + :ivar principal_id: The user's principal id that the role gets assigned to + :vartype principal_id: str + :ivar role_definition_name: The role definition id + :vartype role_definition_name: str + :ivar scope: The scope the role get assigned to + :vartype scope: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_on': {'readonly': True}, + 'created_by_principal_tenant_id': {'readonly': True}, + 'created_by_principal_id': {'readonly': True}, + 'billing_role_assignment_name': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'role_definition_name': {'readonly': True}, + 'scope': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'str'}, + 'created_by_principal_tenant_id': {'key': 'properties.createdByPrincipalTenantId', 'type': 'str'}, + 'created_by_principal_id': {'key': 'properties.createdByPrincipalId', 'type': 'str'}, + 'billing_role_assignment_name': {'key': 'properties.name', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'role_definition_name': {'key': 'properties.roleDefinitionName', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingRoleAssignment, self).__init__(**kwargs) + self.created_on = None + self.created_by_principal_tenant_id = None + self.created_by_principal_id = None + self.billing_role_assignment_name = None + self.principal_id = None + self.role_definition_name = None + self.scope = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py new file mode 100644 index 000000000000..6c8655f43301 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py @@ -0,0 +1,58 @@ +# 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 .resource import Resource + + +class BillingRoleDefinition(Resource): + """Result of get role definition for a role. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar description: The role description + :vartype description: str + :ivar value: The list OF billingPermissions a caller has on a billing + account. + :vartype value: list[~azure.mgmt.billing.models.BillingPermissions] + :ivar role_name: The name of the role + :vartype role_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'value': {'readonly': True}, + 'role_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'value': {'key': 'properties.permissions.value', 'type': '[BillingPermissions]'}, + 'role_name': {'key': 'properties.roleName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingRoleDefinition, self).__init__(**kwargs) + self.description = None + self.value = None + self.role_name = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result.py new file mode 100644 index 000000000000..c49aa86ed9c8 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result.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 BillingRoleDefinitionListResult(Model): + """list the role definitions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of role definitions. + :vartype value: list[~azure.mgmt.billing.models.BillingRoleDefinition] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingRoleDefinition]'}, + } + + def __init__(self, **kwargs): + super(BillingRoleDefinitionListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result_py3.py new file mode 100644 index 000000000000..6132318aaed1 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result_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 BillingRoleDefinitionListResult(Model): + """list the role definitions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of role definitions. + :vartype value: list[~azure.mgmt.billing.models.BillingRoleDefinition] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingRoleDefinition]'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingRoleDefinitionListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py new file mode 100644 index 000000000000..7db2564951ed --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py @@ -0,0 +1,58 @@ +# 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 .resource_py3 import Resource + + +class BillingRoleDefinition(Resource): + """Result of get role definition for a role. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar description: The role description + :vartype description: str + :ivar value: The list OF billingPermissions a caller has on a billing + account. + :vartype value: list[~azure.mgmt.billing.models.BillingPermissions] + :ivar role_name: The name of the role + :vartype role_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'value': {'readonly': True}, + 'role_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'value': {'key': 'properties.permissions.value', 'type': '[BillingPermissions]'}, + 'role_name': {'key': 'properties.roleName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingRoleDefinition, self).__init__(**kwargs) + self.description = None + self.value = None + self.role_name = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py new file mode 100644 index 000000000000..3aaab43349f8 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py @@ -0,0 +1,95 @@ +# 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 .resource import Resource + + +class BillingSubscriptionSummary(Resource): + """A billing Subscription summary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: display name. + :vartype display_name: str + :ivar subscription_id: Subscription Id. + :vartype subscription_id: str + :param subscription_billing_status: Subscription billing status. Possible + values include: 'Active', 'Inactive', 'Abandoned', 'Deleted', 'Warning' + :type subscription_billing_status: str or + ~azure.mgmt.billing.models.BillingSubscriptionStatusType + :ivar last_month_charges: Last month charges. + :vartype last_month_charges: ~azure.mgmt.billing.models.Amount + :ivar month_to_date_charges: Month to date charges. + :vartype month_to_date_charges: ~azure.mgmt.billing.models.Amount + :ivar enrollment_account_context: The enrollment account context. + :vartype enrollment_account_context: + ~azure.mgmt.billing.models.EnrollmentAccountContext + :ivar billing_profile_id: Billing Profile id to which this product + belongs. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing Profile name to which this product + belongs. + :vartype billing_profile_name: str + :param sku_id: The sku id. + :type sku_id: str + :ivar sku_description: The sku description. + :vartype sku_description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_month_charges': {'readonly': True}, + 'month_to_date_charges': {'readonly': True}, + 'enrollment_account_context': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'sku_description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'subscription_billing_status': {'key': 'properties.subscriptionBillingStatus', 'type': 'str'}, + 'last_month_charges': {'key': 'properties.lastMonthCharges', 'type': 'Amount'}, + 'month_to_date_charges': {'key': 'properties.monthToDateCharges', 'type': 'Amount'}, + 'enrollment_account_context': {'key': 'properties.enrollmentAccountContext', 'type': 'EnrollmentAccountContext'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingSubscriptionSummary, self).__init__(**kwargs) + self.display_name = None + self.subscription_id = None + self.subscription_billing_status = kwargs.get('subscription_billing_status', None) + self.last_month_charges = None + self.month_to_date_charges = None + self.enrollment_account_context = None + self.billing_profile_id = None + self.billing_profile_name = None + self.sku_id = kwargs.get('sku_id', None) + self.sku_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_period_paged.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_paged.py similarity index 71% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_period_paged.py rename to azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_paged.py index 54fd2546182b..9c32206b6654 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_period_paged.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class BillingPeriodPaged(Paged): +class BillingSubscriptionSummaryPaged(Paged): """ - A paging container for iterating over a list of :class:`BillingPeriod ` object + A paging container for iterating over a list of :class:`BillingSubscriptionSummary ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[BillingPeriod]'} + 'current_page': {'key': 'value', 'type': '[BillingSubscriptionSummary]'} } def __init__(self, *args, **kwargs): - super(BillingPeriodPaged, self).__init__(*args, **kwargs) + super(BillingSubscriptionSummaryPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py new file mode 100644 index 000000000000..38234f197df2 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py @@ -0,0 +1,95 @@ +# 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 .resource_py3 import Resource + + +class BillingSubscriptionSummary(Resource): + """A billing Subscription summary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: display name. + :vartype display_name: str + :ivar subscription_id: Subscription Id. + :vartype subscription_id: str + :param subscription_billing_status: Subscription billing status. Possible + values include: 'Active', 'Inactive', 'Abandoned', 'Deleted', 'Warning' + :type subscription_billing_status: str or + ~azure.mgmt.billing.models.BillingSubscriptionStatusType + :ivar last_month_charges: Last month charges. + :vartype last_month_charges: ~azure.mgmt.billing.models.Amount + :ivar month_to_date_charges: Month to date charges. + :vartype month_to_date_charges: ~azure.mgmt.billing.models.Amount + :ivar enrollment_account_context: The enrollment account context. + :vartype enrollment_account_context: + ~azure.mgmt.billing.models.EnrollmentAccountContext + :ivar billing_profile_id: Billing Profile id to which this product + belongs. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing Profile name to which this product + belongs. + :vartype billing_profile_name: str + :param sku_id: The sku id. + :type sku_id: str + :ivar sku_description: The sku description. + :vartype sku_description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_month_charges': {'readonly': True}, + 'month_to_date_charges': {'readonly': True}, + 'enrollment_account_context': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'sku_description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'subscription_billing_status': {'key': 'properties.subscriptionBillingStatus', 'type': 'str'}, + 'last_month_charges': {'key': 'properties.lastMonthCharges', 'type': 'Amount'}, + 'month_to_date_charges': {'key': 'properties.monthToDateCharges', 'type': 'Amount'}, + 'enrollment_account_context': {'key': 'properties.enrollmentAccountContext', 'type': 'EnrollmentAccountContext'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, + } + + def __init__(self, *, subscription_billing_status=None, sku_id: str=None, **kwargs) -> None: + super(BillingSubscriptionSummary, self).__init__(**kwargs) + self.display_name = None + self.subscription_id = None + self.subscription_billing_status = subscription_billing_status + self.last_month_charges = None + self.month_to_date_charges = None + self.enrollment_account_context = None + self.billing_profile_id = None + self.billing_profile_name = None + self.sku_id = sku_id + self.sku_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py new file mode 100644 index 000000000000..e6f539a0c3de --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.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 + + +class BillingSubscriptionsListResult(Model): + """Result of listing billing subscriptions summary. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of billing subscriptions summary. + :vartype value: + list[~azure.mgmt.billing.models.BillingSubscriptionSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingSubscriptionSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingSubscriptionsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py new file mode 100644 index 000000000000..b5b5de332d98 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_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 + + +class BillingSubscriptionsListResult(Model): + """Result of listing billing subscriptions summary. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of billing subscriptions summary. + :vartype value: + list[~azure.mgmt.billing.models.BillingSubscriptionSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingSubscriptionSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingSubscriptionsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/department.py b/azure-mgmt-billing/azure/mgmt/billing/models/department.py new file mode 100644 index 000000000000..dce10c23e9ab --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/department.py @@ -0,0 +1,60 @@ +# 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 .resource import Resource + + +class Department(Resource): + """A department resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param department_name: The name for department. + :type department_name: str + :param cost_center: The cost center name. + :type cost_center: str + :param status: The status for department. + :type status: str + :param enrollment_accounts: Associated enrollment accounts. By default + this is not populated, unless it's specified in $expand. + :type enrollment_accounts: + list[~azure.mgmt.billing.models.EnrollmentAccount] + """ + + _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'}, + 'department_name': {'key': 'properties.departmentName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, + } + + def __init__(self, **kwargs): + super(Department, self).__init__(**kwargs) + self.department_name = kwargs.get('department_name', None) + self.cost_center = kwargs.get('cost_center', None) + self.status = kwargs.get('status', None) + self.enrollment_accounts = kwargs.get('enrollment_accounts', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result.py new file mode 100644 index 000000000000..0ddf8650748c --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result.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 DepartmentListResult(Model): + """Result of listing departments. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of departments. + :vartype value: list[~azure.mgmt.billing.models.Department] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Department]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DepartmentListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result_py3.py new file mode 100644 index 000000000000..13d02e2a6581 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result_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 DepartmentListResult(Model): + """Result of listing departments. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of departments. + :vartype value: list[~azure.mgmt.billing.models.Department] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Department]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DepartmentListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/department_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/department_py3.py new file mode 100644 index 000000000000..e794a716e58d --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/department_py3.py @@ -0,0 +1,60 @@ +# 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 .resource_py3 import Resource + + +class Department(Resource): + """A department resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param department_name: The name for department. + :type department_name: str + :param cost_center: The cost center name. + :type cost_center: str + :param status: The status for department. + :type status: str + :param enrollment_accounts: Associated enrollment accounts. By default + this is not populated, unless it's specified in $expand. + :type enrollment_accounts: + list[~azure.mgmt.billing.models.EnrollmentAccount] + """ + + _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'}, + 'department_name': {'key': 'properties.departmentName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, + } + + def __init__(self, *, department_name: str=None, cost_center: str=None, status: str=None, enrollment_accounts=None, **kwargs) -> None: + super(Department, self).__init__(**kwargs) + self.department_name = department_name + self.cost_center = cost_center + self.status = status + self.enrollment_accounts = enrollment_accounts diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status.py b/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status.py new file mode 100644 index 000000000000..a63309cd238f --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status.py @@ -0,0 +1,52 @@ +# 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 DetailedTransferStatus(Model): + """Detailed transfer status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar product_type: Type of product being transferred. Possible values + include: 'AzureSubscription', 'AzureReservation' + :vartype product_type: str or ~azure.mgmt.billing.models.ProductType + :ivar product_id: Id of product being transferred. + :vartype product_id: str + :ivar transfer_status: Transfer status. Possible values include: + 'NotStarted', 'InProgress', 'Completed', 'Failed' + :vartype transfer_status: str or + ~azure.mgmt.billing.models.ProductTransferStatus + :param error_details: Error details for transfer execution. + :type error_details: ~azure.mgmt.billing.models.Error + """ + + _validation = { + 'product_type': {'readonly': True}, + 'product_id': {'readonly': True}, + 'transfer_status': {'readonly': True}, + } + + _attribute_map = { + 'product_type': {'key': 'productType', 'type': 'str'}, + 'product_id': {'key': 'productId', 'type': 'str'}, + 'transfer_status': {'key': 'transferStatus', 'type': 'str'}, + 'error_details': {'key': 'errorDetails', 'type': 'Error'}, + } + + def __init__(self, **kwargs): + super(DetailedTransferStatus, self).__init__(**kwargs) + self.product_type = None + self.product_id = None + self.transfer_status = None + self.error_details = kwargs.get('error_details', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status_py3.py new file mode 100644 index 000000000000..3c2cf121483e --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status_py3.py @@ -0,0 +1,52 @@ +# 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 DetailedTransferStatus(Model): + """Detailed transfer status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar product_type: Type of product being transferred. Possible values + include: 'AzureSubscription', 'AzureReservation' + :vartype product_type: str or ~azure.mgmt.billing.models.ProductType + :ivar product_id: Id of product being transferred. + :vartype product_id: str + :ivar transfer_status: Transfer status. Possible values include: + 'NotStarted', 'InProgress', 'Completed', 'Failed' + :vartype transfer_status: str or + ~azure.mgmt.billing.models.ProductTransferStatus + :param error_details: Error details for transfer execution. + :type error_details: ~azure.mgmt.billing.models.Error + """ + + _validation = { + 'product_type': {'readonly': True}, + 'product_id': {'readonly': True}, + 'transfer_status': {'readonly': True}, + } + + _attribute_map = { + 'product_type': {'key': 'productType', 'type': 'str'}, + 'product_id': {'key': 'productId', 'type': 'str'}, + 'transfer_status': {'key': 'transferStatus', 'type': 'str'}, + 'error_details': {'key': 'errorDetails', 'type': 'Error'}, + } + + def __init__(self, *, error_details=None, **kwargs) -> None: + super(DetailedTransferStatus, self).__init__(**kwargs) + self.product_type = None + self.product_id = None + self.transfer_status = None + self.error_details = error_details diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/download_properties.py b/azure-mgmt-billing/azure/mgmt/billing/models/download_properties.py new file mode 100644 index 000000000000..f6b17398e035 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/download_properties.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 + + +class DownloadProperties(Model): + """The properties of the invoice download. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar kind: Document type. Possible values include: 'Invoice', 'VoidNote', + 'Receipt', 'CreditNote' + :vartype kind: str or ~azure.mgmt.billing.models.enum + :ivar url: Document URL. + :vartype url: str + """ + + _validation = { + 'kind': {'readonly': True}, + 'url': {'readonly': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DownloadProperties, self).__init__(**kwargs) + self.kind = None + self.url = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/download_properties_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/download_properties_py3.py new file mode 100644 index 000000000000..b10a00755b25 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/download_properties_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 + + +class DownloadProperties(Model): + """The properties of the invoice download. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar kind: Document type. Possible values include: 'Invoice', 'VoidNote', + 'Receipt', 'CreditNote' + :vartype kind: str or ~azure.mgmt.billing.models.enum + :ivar url: Document URL. + :vartype url: str + """ + + _validation = { + 'kind': {'readonly': True}, + 'url': {'readonly': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DownloadProperties, self).__init__(**kwargs) + self.kind = None + self.url = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/download_url.py b/azure-mgmt-billing/azure/mgmt/billing/models/download_url.py index ddc0f2214803..ffddaf71dfca 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/download_url.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/download_url.py @@ -13,7 +13,7 @@ class DownloadUrl(Model): - """A secure URL that can be used to download a PDF invoice until the URL + """A secure URL that can be used to download a an entity until the URL expires. Variables are only populated by the server, and will be ignored when diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/download_url_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/download_url_py3.py index 8d6cbc611329..a5dd985ca819 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/download_url_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/download_url_py3.py @@ -13,7 +13,7 @@ class DownloadUrl(Model): - """A secure URL that can be used to download a PDF invoice until the URL + """A secure URL that can be used to download a an entity until the URL expires. Variables are only populated by the server, and will be ignored when diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py b/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py new file mode 100644 index 000000000000..234bc54178a6 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py @@ -0,0 +1,39 @@ +# 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 EnabledAzureSKUs(Model): + """Details about the product. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param sku_id: The sku id. + :type sku_id: str + :ivar sku_description: The sku description. + :vartype sku_description: str + """ + + _validation = { + 'sku_description': {'readonly': True}, + } + + _attribute_map = { + 'sku_id': {'key': 'skuId', 'type': 'str'}, + 'sku_description': {'key': 'skuDescription', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EnabledAzureSKUs, self).__init__(**kwargs) + self.sku_id = kwargs.get('sku_id', None) + self.sku_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py new file mode 100644 index 000000000000..9fca814fe284 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py @@ -0,0 +1,39 @@ +# 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 EnabledAzureSKUs(Model): + """Details about the product. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param sku_id: The sku id. + :type sku_id: str + :ivar sku_description: The sku description. + :vartype sku_description: str + """ + + _validation = { + 'sku_description': {'readonly': True}, + } + + _attribute_map = { + 'sku_id': {'key': 'skuId', 'type': 'str'}, + 'sku_description': {'key': 'skuDescription', 'type': 'str'}, + } + + def __init__(self, *, sku_id: str=None, **kwargs) -> None: + super(EnabledAzureSKUs, self).__init__(**kwargs) + self.sku_id = sku_id + self.sku_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment.py new file mode 100644 index 000000000000..f72863ab2de9 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment.py @@ -0,0 +1,73 @@ +# 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 Enrollment(Model): + """Current entity level details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param start_date: Enrollment Start Date + :type start_date: datetime + :param end_date: Enrollment End Date + :type end_date: datetime + :ivar currency: The currency associated with enrollment + :vartype currency: str + :ivar channel: The channel for Enrollment + :vartype channel: str + :ivar policies: The attributes associated with legacy enrollment. + :vartype policies: ~azure.mgmt.billing.models.EnrollmentPolicies + :ivar language: The language for Enrollment + :vartype language: str + :ivar country_code: The countryCode for Enrollment + :vartype country_code: str + :ivar status: Enrollment status + :vartype status: str + :ivar billing_cycle: Enrollment billing cycle + :vartype billing_cycle: str + """ + + _validation = { + 'currency': {'readonly': True}, + 'channel': {'readonly': True}, + 'policies': {'readonly': True}, + 'language': {'readonly': True}, + 'country_code': {'readonly': True}, + 'status': {'readonly': True}, + 'billing_cycle': {'readonly': True}, + } + + _attribute_map = { + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + 'currency': {'key': 'currency', 'type': 'str'}, + 'channel': {'key': 'channel', 'type': 'str'}, + 'policies': {'key': 'policies', 'type': 'EnrollmentPolicies'}, + 'language': {'key': 'language', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'billing_cycle': {'key': 'billingCycle', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Enrollment, self).__init__(**kwargs) + self.start_date = kwargs.get('start_date', None) + self.end_date = kwargs.get('end_date', None) + self.currency = None + self.channel = None + self.policies = None + self.language = None + self.country_code = None + self.status = None + self.billing_cycle = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py index 0936208a7cd9..abfb121b9551 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py @@ -13,7 +13,7 @@ class EnrollmentAccount(Resource): - """An enrollment account resource. + """An account resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -24,24 +24,48 @@ class EnrollmentAccount(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar principal_name: The account owner's principal name. - :vartype principal_name: str + :param account_name: The account name. + :type account_name: str + :param cost_center: The cost center name. + :type cost_center: str + :param account_owner: The account owner + :type account_owner: str + :param status: The status for account. + :type status: str + :param start_date: Account Start Date + :type start_date: datetime + :param end_date: Account End Date + :type end_date: datetime + :param department: Associated department. By default this is not + populated, unless it's specified in $expand. + :type department: ~azure.mgmt.billing.models.Department """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'principal_name': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'principal_name': {'key': 'properties.principalName', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'account_owner': {'key': 'properties.accountOwner', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'start_date': {'key': 'properties.startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, + 'department': {'key': 'properties.department', 'type': 'Department'}, } def __init__(self, **kwargs): super(EnrollmentAccount, self).__init__(**kwargs) - self.principal_name = None + self.account_name = kwargs.get('account_name', None) + self.cost_center = kwargs.get('cost_center', None) + self.account_owner = kwargs.get('account_owner', None) + self.status = kwargs.get('status', None) + self.start_date = kwargs.get('start_date', None) + self.end_date = kwargs.get('end_date', None) + self.department = kwargs.get('department', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context.py new file mode 100644 index 000000000000..ef7372a0c02e --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context.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 EnrollmentAccountContext(Model): + """The rating context. + + :param cost_center: The cost center name. + :type cost_center: str + :param start_date: Account Start Date + :type start_date: datetime + :param end_date: Account End Date + :type end_date: datetime + :param enrollment_account_name: The enrollment account id. + :type enrollment_account_name: str + """ + + _attribute_map = { + 'cost_center': {'key': 'costCenter', 'type': 'str'}, + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + 'enrollment_account_name': {'key': 'enrollmentAccountName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EnrollmentAccountContext, self).__init__(**kwargs) + self.cost_center = kwargs.get('cost_center', None) + self.start_date = kwargs.get('start_date', None) + self.end_date = kwargs.get('end_date', None) + self.enrollment_account_name = kwargs.get('enrollment_account_name', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context_py3.py new file mode 100644 index 000000000000..10dd1f3d0236 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context_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 EnrollmentAccountContext(Model): + """The rating context. + + :param cost_center: The cost center name. + :type cost_center: str + :param start_date: Account Start Date + :type start_date: datetime + :param end_date: Account End Date + :type end_date: datetime + :param enrollment_account_name: The enrollment account id. + :type enrollment_account_name: str + """ + + _attribute_map = { + 'cost_center': {'key': 'costCenter', 'type': 'str'}, + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + 'enrollment_account_name': {'key': 'enrollmentAccountName', 'type': 'str'}, + } + + def __init__(self, *, cost_center: str=None, start_date=None, end_date=None, enrollment_account_name: str=None, **kwargs) -> None: + super(EnrollmentAccountContext, self).__init__(**kwargs) + self.cost_center = cost_center + self.start_date = start_date + self.end_date = end_date + self.enrollment_account_name = enrollment_account_name diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result.py new file mode 100644 index 000000000000..54c13d580c59 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result.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 EnrollmentAccountListResult(Model): + """Result of listing enrollment accounts. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of enrollment accounts. + :vartype value: list[~azure.mgmt.billing.models.EnrollmentAccount] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EnrollmentAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EnrollmentAccountListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result_py3.py new file mode 100644 index 000000000000..1108506a24f3 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result_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 EnrollmentAccountListResult(Model): + """Result of listing enrollment accounts. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of enrollment accounts. + :vartype value: list[~azure.mgmt.billing.models.EnrollmentAccount] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EnrollmentAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(EnrollmentAccountListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py index 0d1d9bc36553..69e19f8db3c2 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py @@ -13,7 +13,7 @@ class EnrollmentAccount(Resource): - """An enrollment account resource. + """An account resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -24,24 +24,48 @@ class EnrollmentAccount(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar principal_name: The account owner's principal name. - :vartype principal_name: str + :param account_name: The account name. + :type account_name: str + :param cost_center: The cost center name. + :type cost_center: str + :param account_owner: The account owner + :type account_owner: str + :param status: The status for account. + :type status: str + :param start_date: Account Start Date + :type start_date: datetime + :param end_date: Account End Date + :type end_date: datetime + :param department: Associated department. By default this is not + populated, unless it's specified in $expand. + :type department: ~azure.mgmt.billing.models.Department """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'principal_name': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'principal_name': {'key': 'properties.principalName', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'account_owner': {'key': 'properties.accountOwner', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'start_date': {'key': 'properties.startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, + 'department': {'key': 'properties.department', 'type': 'Department'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, account_name: str=None, cost_center: str=None, account_owner: str=None, status: str=None, start_date=None, end_date=None, department=None, **kwargs) -> None: super(EnrollmentAccount, self).__init__(**kwargs) - self.principal_name = None + self.account_name = account_name + self.cost_center = cost_center + self.account_owner = account_owner + self.status = status + self.start_date = start_date + self.end_date = end_date + self.department = department diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies.py new file mode 100644 index 000000000000..1d85db932e8f --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies.py @@ -0,0 +1,53 @@ +# 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 EnrollmentPolicies(Model): + """The attributes associated with legacy enrollment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_owner_view_charges: The accountOwnerViewCharges flag for + Enrollment + :vartype account_owner_view_charges: bool + :ivar department_admin_view_charges: The departmentAdminViewCharges flag + for Enrollment + :vartype department_admin_view_charges: bool + :ivar marketplaces_enabled: The marketplaces flag for Enrollment + :vartype marketplaces_enabled: bool + :ivar reserved_instances_enabled: The reserved instances flag for + Enrollment + :vartype reserved_instances_enabled: bool + """ + + _validation = { + 'account_owner_view_charges': {'readonly': True}, + 'department_admin_view_charges': {'readonly': True}, + 'marketplaces_enabled': {'readonly': True}, + 'reserved_instances_enabled': {'readonly': True}, + } + + _attribute_map = { + 'account_owner_view_charges': {'key': 'accountOwnerViewCharges', 'type': 'bool'}, + 'department_admin_view_charges': {'key': 'departmentAdminViewCharges', 'type': 'bool'}, + 'marketplaces_enabled': {'key': 'marketplacesEnabled', 'type': 'bool'}, + 'reserved_instances_enabled': {'key': 'reservedInstancesEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(EnrollmentPolicies, self).__init__(**kwargs) + self.account_owner_view_charges = None + self.department_admin_view_charges = None + self.marketplaces_enabled = None + self.reserved_instances_enabled = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies_py3.py new file mode 100644 index 000000000000..171c895e3374 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies_py3.py @@ -0,0 +1,53 @@ +# 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 EnrollmentPolicies(Model): + """The attributes associated with legacy enrollment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_owner_view_charges: The accountOwnerViewCharges flag for + Enrollment + :vartype account_owner_view_charges: bool + :ivar department_admin_view_charges: The departmentAdminViewCharges flag + for Enrollment + :vartype department_admin_view_charges: bool + :ivar marketplaces_enabled: The marketplaces flag for Enrollment + :vartype marketplaces_enabled: bool + :ivar reserved_instances_enabled: The reserved instances flag for + Enrollment + :vartype reserved_instances_enabled: bool + """ + + _validation = { + 'account_owner_view_charges': {'readonly': True}, + 'department_admin_view_charges': {'readonly': True}, + 'marketplaces_enabled': {'readonly': True}, + 'reserved_instances_enabled': {'readonly': True}, + } + + _attribute_map = { + 'account_owner_view_charges': {'key': 'accountOwnerViewCharges', 'type': 'bool'}, + 'department_admin_view_charges': {'key': 'departmentAdminViewCharges', 'type': 'bool'}, + 'marketplaces_enabled': {'key': 'marketplacesEnabled', 'type': 'bool'}, + 'reserved_instances_enabled': {'key': 'reservedInstancesEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs) -> None: + super(EnrollmentPolicies, self).__init__(**kwargs) + self.account_owner_view_charges = None + self.department_admin_view_charges = None + self.marketplaces_enabled = None + self.reserved_instances_enabled = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_py3.py new file mode 100644 index 000000000000..1c1a8618c379 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_py3.py @@ -0,0 +1,73 @@ +# 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 Enrollment(Model): + """Current entity level details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param start_date: Enrollment Start Date + :type start_date: datetime + :param end_date: Enrollment End Date + :type end_date: datetime + :ivar currency: The currency associated with enrollment + :vartype currency: str + :ivar channel: The channel for Enrollment + :vartype channel: str + :ivar policies: The attributes associated with legacy enrollment. + :vartype policies: ~azure.mgmt.billing.models.EnrollmentPolicies + :ivar language: The language for Enrollment + :vartype language: str + :ivar country_code: The countryCode for Enrollment + :vartype country_code: str + :ivar status: Enrollment status + :vartype status: str + :ivar billing_cycle: Enrollment billing cycle + :vartype billing_cycle: str + """ + + _validation = { + 'currency': {'readonly': True}, + 'channel': {'readonly': True}, + 'policies': {'readonly': True}, + 'language': {'readonly': True}, + 'country_code': {'readonly': True}, + 'status': {'readonly': True}, + 'billing_cycle': {'readonly': True}, + } + + _attribute_map = { + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + 'currency': {'key': 'currency', 'type': 'str'}, + 'channel': {'key': 'channel', 'type': 'str'}, + 'policies': {'key': 'policies', 'type': 'EnrollmentPolicies'}, + 'language': {'key': 'language', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'billing_cycle': {'key': 'billingCycle', 'type': 'str'}, + } + + def __init__(self, *, start_date=None, end_date=None, **kwargs) -> None: + super(Enrollment, self).__init__(**kwargs) + self.start_date = start_date + self.end_date = end_date + self.currency = None + self.channel = None + self.policies = None + self.language = None + self.country_code = None + self.status = None + self.billing_cycle = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/error.py b/azure-mgmt-billing/azure/mgmt/billing/models/error.py new file mode 100644 index 000000000000..dd81e5a5b953 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/error.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 Error(Model): + """Error details for transfer execution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error_code: Error code. + :vartype error_code: str + :ivar error_message: Error message. + :vartype error_message: str + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.error_code = None + self.error_message = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/error_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/error_py3.py new file mode 100644 index 000000000000..d510f6b409ab --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/error_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 Error(Model): + """Error details for transfer execution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error_code: Error code. + :vartype error_code: str + :ivar error_message: Error message. + :vartype error_message: str + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.error_code = None + self.error_message = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py b/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py new file mode 100644 index 000000000000..726b8b201c15 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.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 InitiateTransferRequest(Model): + """Request parameters to initiate transfer. + + :param billing_profile_id: Target Usage context for devTest subscriptions. + :type billing_profile_id: str + :param recipient_email_id: Email Id of recipient for transfer. + :type recipient_email_id: str + """ + + _attribute_map = { + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(InitiateTransferRequest, self).__init__(**kwargs) + self.billing_profile_id = kwargs.get('billing_profile_id', None) + self.recipient_email_id = kwargs.get('recipient_email_id', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py new file mode 100644 index 000000000000..564bdd8fbbb0 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_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 InitiateTransferRequest(Model): + """Request parameters to initiate transfer. + + :param billing_profile_id: Target Usage context for devTest subscriptions. + :type billing_profile_id: str + :param recipient_email_id: Email Id of recipient for transfer. + :type recipient_email_id: str + """ + + _attribute_map = { + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, + } + + def __init__(self, *, billing_profile_id: str=None, recipient_email_id: str=None, **kwargs) -> None: + super(InitiateTransferRequest, self).__init__(**kwargs) + self.billing_profile_id = billing_profile_id + self.recipient_email_id = recipient_email_id diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py deleted file mode 100644 index 25e3930f0ce3..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class Invoice(Resource): - """An invoice resource can be used download a PDF version of an invoice. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param download_url: A secure link to download the PDF version of an - invoice. The link will cease to work after its expiry time is reached. - :type download_url: ~azure.mgmt.billing.models.DownloadUrl - :ivar invoice_period_start_date: The start of the date range covered by - the invoice. - :vartype invoice_period_start_date: date - :ivar invoice_period_end_date: The end of the date range covered by the - invoice. - :vartype invoice_period_end_date: date - :ivar billing_period_ids: Array of billing period ids that the invoice is - attributed to. - :vartype billing_period_ids: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'invoice_period_start_date': {'readonly': True}, - 'invoice_period_end_date': {'readonly': True}, - 'billing_period_ids': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'download_url': {'key': 'properties.downloadUrl', 'type': 'DownloadUrl'}, - 'invoice_period_start_date': {'key': 'properties.invoicePeriodStartDate', 'type': 'date'}, - 'invoice_period_end_date': {'key': 'properties.invoicePeriodEndDate', 'type': 'date'}, - 'billing_period_ids': {'key': 'properties.billingPeriodIds', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(Invoice, self).__init__(**kwargs) - self.download_url = kwargs.get('download_url', None) - self.invoice_period_start_date = None - self.invoice_period_end_date = None - self.billing_period_ids = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result.py new file mode 100644 index 000000000000..0e0156b4eaa6 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result.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 InvoiceListResult(Model): + """Result of listing invoices. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of invoices. + :vartype value: list[~azure.mgmt.billing.models.InvoiceSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InvoiceSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(InvoiceListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result_py3.py new file mode 100644 index 000000000000..cc7db9c465d8 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result_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 InvoiceListResult(Model): + """Result of listing invoices. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of invoices. + :vartype value: list[~azure.mgmt.billing.models.InvoiceSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InvoiceSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(InvoiceListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py deleted file mode 100644 index 9afed4eac660..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class Invoice(Resource): - """An invoice resource can be used download a PDF version of an invoice. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param download_url: A secure link to download the PDF version of an - invoice. The link will cease to work after its expiry time is reached. - :type download_url: ~azure.mgmt.billing.models.DownloadUrl - :ivar invoice_period_start_date: The start of the date range covered by - the invoice. - :vartype invoice_period_start_date: date - :ivar invoice_period_end_date: The end of the date range covered by the - invoice. - :vartype invoice_period_end_date: date - :ivar billing_period_ids: Array of billing period ids that the invoice is - attributed to. - :vartype billing_period_ids: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'invoice_period_start_date': {'readonly': True}, - 'invoice_period_end_date': {'readonly': True}, - 'billing_period_ids': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'download_url': {'key': 'properties.downloadUrl', 'type': 'DownloadUrl'}, - 'invoice_period_start_date': {'key': 'properties.invoicePeriodStartDate', 'type': 'date'}, - 'invoice_period_end_date': {'key': 'properties.invoicePeriodEndDate', 'type': 'date'}, - 'billing_period_ids': {'key': 'properties.billingPeriodIds', 'type': '[str]'}, - } - - def __init__(self, *, download_url=None, **kwargs) -> None: - super(Invoice, self).__init__(**kwargs) - self.download_url = download_url - self.invoice_period_start_date = None - self.invoice_period_end_date = None - self.billing_period_ids = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py new file mode 100644 index 000000000000..00342ac237f9 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py @@ -0,0 +1,51 @@ +# 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 .resource import Resource + + +class InvoiceSection(Resource): + """An InvoiceSection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: The name of the InvoiceSection. + :type display_name: str + :param billing_profiles: The billing profiles associated to the billing + account. + :type billing_profiles: list[~azure.mgmt.billing.models.BillingProfile] + """ + + _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'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, + } + + def __init__(self, **kwargs): + super(InvoiceSection, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.billing_profiles = kwargs.get('billing_profiles', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result.py new file mode 100644 index 000000000000..cf43e8aede6a --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result.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 InvoiceSectionListResult(Model): + """Result of listing invoice sections. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of invoice sections. + :vartype value: list[~azure.mgmt.billing.models.InvoiceSection] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InvoiceSection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(InvoiceSectionListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result_py3.py new file mode 100644 index 000000000000..91d43ba0544d --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result_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 InvoiceSectionListResult(Model): + """Result of listing invoice sections. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of invoice sections. + :vartype value: list[~azure.mgmt.billing.models.InvoiceSection] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InvoiceSection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(InvoiceSectionListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties.py new file mode 100644 index 000000000000..0699364eac65 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InvoiceSectionProperties(Model): + """The properties of an InvoiceSection. + + :param display_name: The name of the InvoiceSection. + :type display_name: str + :param billing_profiles: The billing profiles associated to the billing + account. + :type billing_profiles: list[~azure.mgmt.billing.models.BillingProfile] + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'billing_profiles': {'key': 'billingProfiles', 'type': '[BillingProfile]'}, + } + + def __init__(self, **kwargs): + super(InvoiceSectionProperties, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.billing_profiles = kwargs.get('billing_profiles', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties_py3.py new file mode 100644 index 000000000000..27b07396070f --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InvoiceSectionProperties(Model): + """The properties of an InvoiceSection. + + :param display_name: The name of the InvoiceSection. + :type display_name: str + :param billing_profiles: The billing profiles associated to the billing + account. + :type billing_profiles: list[~azure.mgmt.billing.models.BillingProfile] + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'billing_profiles': {'key': 'billingProfiles', 'type': '[BillingProfile]'}, + } + + def __init__(self, *, display_name: str=None, billing_profiles=None, **kwargs) -> None: + super(InvoiceSectionProperties, self).__init__(**kwargs) + self.display_name = display_name + self.billing_profiles = billing_profiles diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py new file mode 100644 index 000000000000..16420f33e703 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py @@ -0,0 +1,51 @@ +# 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 .resource_py3 import Resource + + +class InvoiceSection(Resource): + """An InvoiceSection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: The name of the InvoiceSection. + :type display_name: str + :param billing_profiles: The billing profiles associated to the billing + account. + :type billing_profiles: list[~azure.mgmt.billing.models.BillingProfile] + """ + + _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'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, + } + + def __init__(self, *, display_name: str=None, billing_profiles=None, **kwargs) -> None: + super(InvoiceSection, self).__init__(**kwargs) + self.display_name = display_name + self.billing_profiles = billing_profiles diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py new file mode 100644 index 000000000000..3698b45764ea --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py @@ -0,0 +1,105 @@ +# 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 .resource import Resource + + +class InvoiceSummary(Resource): + """An invoice resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar due_date: The due date for invoice. + :vartype due_date: datetime + :ivar invoice_date: The date when invoice was created. + :vartype invoice_date: datetime + :ivar status: Invoice status. Possible values include: 'PastDue', 'Due', + 'Paid', 'Void' + :vartype status: str or ~azure.mgmt.billing.models.enum + :ivar amount_due: Amount due. + :vartype amount_due: ~azure.mgmt.billing.models.Amount + :ivar billed_amount: Amount billed. + :vartype billed_amount: ~azure.mgmt.billing.models.Amount + :ivar invoice_period_start_date: The start date of the billing period. + :vartype invoice_period_start_date: datetime + :ivar invoice_period_end_date: The end date of the billing period. + :vartype invoice_period_end_date: datetime + :ivar billing_profile: The profile id which invoice belongs to. + :vartype billing_profile: str + :ivar billing_profile_name: The profile name which invoice belongs to. + :vartype billing_profile_name: str + :ivar purchase_order_number: The purchase identifier for the invoice. + :vartype purchase_order_number: str + :ivar document_urls: List of document urls available to download including + invoice and tax documents. + :vartype document_urls: + list[~azure.mgmt.billing.models.DownloadProperties] + :ivar payments: List of payments. + :vartype payments: list[~azure.mgmt.billing.models.PaymentProperties] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'due_date': {'readonly': True}, + 'invoice_date': {'readonly': True}, + 'status': {'readonly': True}, + 'amount_due': {'readonly': True}, + 'billed_amount': {'readonly': True}, + 'invoice_period_start_date': {'readonly': True}, + 'invoice_period_end_date': {'readonly': True}, + 'billing_profile': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'purchase_order_number': {'readonly': True}, + 'document_urls': {'readonly': True}, + 'payments': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'due_date': {'key': 'properties.dueDate', 'type': 'iso-8601'}, + 'invoice_date': {'key': 'properties.invoiceDate', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'amount_due': {'key': 'properties.amountDue', 'type': 'Amount'}, + 'billed_amount': {'key': 'properties.billedAmount', 'type': 'Amount'}, + 'invoice_period_start_date': {'key': 'properties.invoicePeriodStartDate', 'type': 'iso-8601'}, + 'invoice_period_end_date': {'key': 'properties.invoicePeriodEndDate', 'type': 'iso-8601'}, + 'billing_profile': {'key': 'properties.billingProfile', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'purchase_order_number': {'key': 'properties.purchaseOrderNumber', 'type': 'str'}, + 'document_urls': {'key': 'properties.documentUrls', 'type': '[DownloadProperties]'}, + 'payments': {'key': 'properties.payments', 'type': '[PaymentProperties]'}, + } + + def __init__(self, **kwargs): + super(InvoiceSummary, self).__init__(**kwargs) + self.due_date = None + self.invoice_date = None + self.status = None + self.amount_due = None + self.billed_amount = None + self.invoice_period_start_date = None + self.invoice_period_end_date = None + self.billing_profile = None + self.billing_profile_name = None + self.purchase_order_number = None + self.document_urls = None + self.payments = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py new file mode 100644 index 000000000000..0d2a6b98f978 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py @@ -0,0 +1,105 @@ +# 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 .resource_py3 import Resource + + +class InvoiceSummary(Resource): + """An invoice resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar due_date: The due date for invoice. + :vartype due_date: datetime + :ivar invoice_date: The date when invoice was created. + :vartype invoice_date: datetime + :ivar status: Invoice status. Possible values include: 'PastDue', 'Due', + 'Paid', 'Void' + :vartype status: str or ~azure.mgmt.billing.models.enum + :ivar amount_due: Amount due. + :vartype amount_due: ~azure.mgmt.billing.models.Amount + :ivar billed_amount: Amount billed. + :vartype billed_amount: ~azure.mgmt.billing.models.Amount + :ivar invoice_period_start_date: The start date of the billing period. + :vartype invoice_period_start_date: datetime + :ivar invoice_period_end_date: The end date of the billing period. + :vartype invoice_period_end_date: datetime + :ivar billing_profile: The profile id which invoice belongs to. + :vartype billing_profile: str + :ivar billing_profile_name: The profile name which invoice belongs to. + :vartype billing_profile_name: str + :ivar purchase_order_number: The purchase identifier for the invoice. + :vartype purchase_order_number: str + :ivar document_urls: List of document urls available to download including + invoice and tax documents. + :vartype document_urls: + list[~azure.mgmt.billing.models.DownloadProperties] + :ivar payments: List of payments. + :vartype payments: list[~azure.mgmt.billing.models.PaymentProperties] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'due_date': {'readonly': True}, + 'invoice_date': {'readonly': True}, + 'status': {'readonly': True}, + 'amount_due': {'readonly': True}, + 'billed_amount': {'readonly': True}, + 'invoice_period_start_date': {'readonly': True}, + 'invoice_period_end_date': {'readonly': True}, + 'billing_profile': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'purchase_order_number': {'readonly': True}, + 'document_urls': {'readonly': True}, + 'payments': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'due_date': {'key': 'properties.dueDate', 'type': 'iso-8601'}, + 'invoice_date': {'key': 'properties.invoiceDate', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'amount_due': {'key': 'properties.amountDue', 'type': 'Amount'}, + 'billed_amount': {'key': 'properties.billedAmount', 'type': 'Amount'}, + 'invoice_period_start_date': {'key': 'properties.invoicePeriodStartDate', 'type': 'iso-8601'}, + 'invoice_period_end_date': {'key': 'properties.invoicePeriodEndDate', 'type': 'iso-8601'}, + 'billing_profile': {'key': 'properties.billingProfile', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'purchase_order_number': {'key': 'properties.purchaseOrderNumber', 'type': 'str'}, + 'document_urls': {'key': 'properties.documentUrls', 'type': '[DownloadProperties]'}, + 'payments': {'key': 'properties.payments', 'type': '[PaymentProperties]'}, + } + + def __init__(self, **kwargs) -> None: + super(InvoiceSummary, self).__init__(**kwargs) + self.due_date = None + self.invoice_date = None + self.status = None + self.amount_due = None + self.billed_amount = None + self.invoice_period_start_date = None + self.invoice_period_end_date = None + self.billing_profile = None + self.billing_profile_name = None + self.purchase_order_number = None + self.document_urls = None + self.payments = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/operation_status.py b/azure-mgmt-billing/azure/mgmt/billing/models/operation_status.py new file mode 100644 index 000000000000..b4bd9e976219 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/operation_status.py @@ -0,0 +1,43 @@ +# 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 OperationStatus(Model): + """status of the Billing POST/PUT operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The operation Id. + :vartype id: str + :param status: Status of the pending operation + :type status: str + :param status_detail: Status Detail of the pending operation + :type status_detail: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_detail': {'key': 'statusDetail', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationStatus, self).__init__(**kwargs) + self.id = None + self.status = kwargs.get('status', None) + self.status_detail = kwargs.get('status_detail', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py new file mode 100644 index 000000000000..325cee1d2b7e --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py @@ -0,0 +1,43 @@ +# 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 OperationStatus(Model): + """status of the Billing POST/PUT operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The operation Id. + :vartype id: str + :param status: Status of the pending operation + :type status: str + :param status_detail: Status Detail of the pending operation + :type status_detail: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_detail': {'key': 'statusDetail', 'type': 'str'}, + } + + def __init__(self, *, status: str=None, status_detail: str=None, **kwargs) -> None: + super(OperationStatus, self).__init__(**kwargs) + self.id = None + self.status = status + self.status_detail = status_detail diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py b/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py new file mode 100644 index 000000000000..a9cd09cf9799 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py @@ -0,0 +1,62 @@ +# 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 .resource import Resource + + +class PaymentMethod(Resource): + """A payment method resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param method_type: Payment method type. Possible values include: + 'Credits', 'ChequeWire' + :type method_type: str or ~azure.mgmt.billing.models.PaymentMethodType + :ivar details: Details about the payment method. + :vartype details: str + :ivar expiration: Expiration date. + :vartype expiration: datetime + :ivar currency: The currency associated with the payment method. + :vartype currency: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'details': {'readonly': True}, + 'expiration': {'readonly': True}, + 'currency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'method_type': {'key': 'properties.methodType', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + 'expiration': {'key': 'properties.expiration', 'type': 'iso-8601'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PaymentMethod, self).__init__(**kwargs) + self.method_type = kwargs.get('method_type', None) + self.details = None + self.expiration = None + self.currency = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_paged.py b/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_paged.py similarity index 69% rename from azure-mgmt-billing/azure/mgmt/billing/models/invoice_paged.py rename to azure-mgmt-billing/azure/mgmt/billing/models/payment_method_paged.py index 500bcafab923..ff52f6b8b2b7 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_paged.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class InvoicePaged(Paged): +class PaymentMethodPaged(Paged): """ - A paging container for iterating over a list of :class:`Invoice ` object + A paging container for iterating over a list of :class:`PaymentMethod ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Invoice]'} + 'current_page': {'key': 'value', 'type': '[PaymentMethod]'} } def __init__(self, *args, **kwargs): - super(InvoicePaged, self).__init__(*args, **kwargs) + super(PaymentMethodPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py new file mode 100644 index 000000000000..6a2e1b485c99 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py @@ -0,0 +1,62 @@ +# 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 .resource_py3 import Resource + + +class PaymentMethod(Resource): + """A payment method resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param method_type: Payment method type. Possible values include: + 'Credits', 'ChequeWire' + :type method_type: str or ~azure.mgmt.billing.models.PaymentMethodType + :ivar details: Details about the payment method. + :vartype details: str + :ivar expiration: Expiration date. + :vartype expiration: datetime + :ivar currency: The currency associated with the payment method. + :vartype currency: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'details': {'readonly': True}, + 'expiration': {'readonly': True}, + 'currency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'method_type': {'key': 'properties.methodType', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + 'expiration': {'key': 'properties.expiration', 'type': 'iso-8601'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + } + + def __init__(self, *, method_type=None, **kwargs) -> None: + super(PaymentMethod, self).__init__(**kwargs) + self.method_type = method_type + self.details = None + self.expiration = None + self.currency = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties.py b/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties.py new file mode 100644 index 000000000000..8b5251d71703 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties.py @@ -0,0 +1,45 @@ +# 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 PaymentProperties(Model): + """The properties of the payment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar payment_type: The type of payment. + :vartype payment_type: str + :ivar amount: The paid amount. + :vartype amount: ~azure.mgmt.billing.models.Amount + :ivar date_property: The date of the payment. + :vartype date_property: datetime + """ + + _validation = { + 'payment_type': {'readonly': True}, + 'amount': {'readonly': True}, + 'date_property': {'readonly': True}, + } + + _attribute_map = { + 'payment_type': {'key': 'paymentType', 'type': 'str'}, + 'amount': {'key': 'amount', 'type': 'Amount'}, + 'date_property': {'key': 'date', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(PaymentProperties, self).__init__(**kwargs) + self.payment_type = None + self.amount = None + self.date_property = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties_py3.py new file mode 100644 index 000000000000..76ebc09376af --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties_py3.py @@ -0,0 +1,45 @@ +# 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 PaymentProperties(Model): + """The properties of the payment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar payment_type: The type of payment. + :vartype payment_type: str + :ivar amount: The paid amount. + :vartype amount: ~azure.mgmt.billing.models.Amount + :ivar date_property: The date of the payment. + :vartype date_property: datetime + """ + + _validation = { + 'payment_type': {'readonly': True}, + 'amount': {'readonly': True}, + 'date_property': {'readonly': True}, + } + + _attribute_map = { + 'payment_type': {'key': 'paymentType', 'type': 'str'}, + 'amount': {'key': 'amount', 'type': 'Amount'}, + 'date_property': {'key': 'date', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(PaymentProperties, self).__init__(**kwargs) + self.payment_type = None + self.amount = None + self.date_property = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/policy.py b/azure-mgmt-billing/azure/mgmt/billing/models/policy.py new file mode 100644 index 000000000000..3f4d47ed064d --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/policy.py @@ -0,0 +1,52 @@ +# 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 .resource import Resource + + +class Policy(Resource): + """The Policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param reservation_purchases_allowed: The reservationPurchasesAllowed + flag. + :type reservation_purchases_allowed: bool + :param marketplace_purchases_allowed: The marketplacePurchasesAllowed + flag. + :type marketplace_purchases_allowed: bool + """ + + _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_purchases_allowed': {'key': 'properties.reservationPurchasesAllowed', 'type': 'bool'}, + 'marketplace_purchases_allowed': {'key': 'properties.marketplacePurchasesAllowed', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(Policy, self).__init__(**kwargs) + self.reservation_purchases_allowed = kwargs.get('reservation_purchases_allowed', None) + self.marketplace_purchases_allowed = kwargs.get('marketplace_purchases_allowed', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py new file mode 100644 index 000000000000..aef3034f2654 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py @@ -0,0 +1,52 @@ +# 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 .resource_py3 import Resource + + +class Policy(Resource): + """The Policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param reservation_purchases_allowed: The reservationPurchasesAllowed + flag. + :type reservation_purchases_allowed: bool + :param marketplace_purchases_allowed: The marketplacePurchasesAllowed + flag. + :type marketplace_purchases_allowed: bool + """ + + _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_purchases_allowed': {'key': 'properties.reservationPurchasesAllowed', 'type': 'bool'}, + 'marketplace_purchases_allowed': {'key': 'properties.marketplacePurchasesAllowed', 'type': 'bool'}, + } + + def __init__(self, *, reservation_purchases_allowed: bool=None, marketplace_purchases_allowed: bool=None, **kwargs) -> None: + super(Policy, self).__init__(**kwargs) + self.reservation_purchases_allowed = reservation_purchases_allowed + self.marketplace_purchases_allowed = marketplace_purchases_allowed diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/product_details.py b/azure-mgmt-billing/azure/mgmt/billing/models/product_details.py new file mode 100644 index 000000000000..b0e92125fc0c --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/product_details.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ProductDetails(Model): + """Details of the product to be transferred. + + :param product_type: Type of the prouct to be transferred. Possible values + include: 'AzureSubscription', 'AzureReservation' + :type product_type: str or ~azure.mgmt.billing.models.ProductType + :param product_id: Id of product to be transferred. + :type product_id: str + """ + + _attribute_map = { + 'product_type': {'key': 'productType', 'type': 'str'}, + 'product_id': {'key': 'productId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProductDetails, self).__init__(**kwargs) + self.product_type = kwargs.get('product_type', None) + self.product_id = kwargs.get('product_id', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/product_details_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/product_details_py3.py new file mode 100644 index 000000000000..1baa2e9789cc --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/product_details_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ProductDetails(Model): + """Details of the product to be transferred. + + :param product_type: Type of the prouct to be transferred. Possible values + include: 'AzureSubscription', 'AzureReservation' + :type product_type: str or ~azure.mgmt.billing.models.ProductType + :param product_id: Id of product to be transferred. + :type product_id: str + """ + + _attribute_map = { + 'product_type': {'key': 'productType', 'type': 'str'}, + 'product_id': {'key': 'productId', 'type': 'str'}, + } + + def __init__(self, *, product_type=None, product_id: str=None, **kwargs) -> None: + super(ProductDetails, self).__init__(**kwargs) + self.product_type = product_type + self.product_id = product_id diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/product_summary.py b/azure-mgmt-billing/azure/mgmt/billing/models/product_summary.py new file mode 100644 index 000000000000..8ff4b299b84c --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/product_summary.py @@ -0,0 +1,138 @@ +# 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 .resource import Resource + + +class ProductSummary(Resource): + """A product summary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: The display name of the product. + :vartype display_name: str + :ivar purchase_date: The date of purchase. + :vartype purchase_date: datetime + :ivar product_type_id: The product type id. + :vartype product_type_id: str + :ivar product_type: The type of product. + :vartype product_type: str + :param status: Product status. Possible values include: 'Active', + 'Inactive', 'PastDue', 'Expiring', 'Expired', 'Disabled', 'Cancelled', + 'AutoRenew' + :type status: str or ~azure.mgmt.billing.models.ProductStatusType + :ivar end_date: end date. + :vartype end_date: datetime + :param billing_frequency: Billing frequency. Possible values include: + 'OneTime', 'Monthly', 'UsageBased' + :type billing_frequency: str or + ~azure.mgmt.billing.models.BillingFrequency + :ivar last_charge: Last month charges. + :vartype last_charge: ~azure.mgmt.billing.models.Amount + :ivar last_charge_date: The date of the last charge. + :vartype last_charge_date: datetime + :ivar quantity: The purchased product quantity. + :vartype quantity: float + :ivar sku_id: Sku Id. + :vartype sku_id: str + :ivar sku_description: Sku description. + :vartype sku_description: str + :ivar availability_id: Availability Id. + :vartype availability_id: str + :ivar parent_product_id: Parent Product Id. + :vartype parent_product_id: str + :ivar invoice_section_id: Invoice section id to which this product + belongs. + :vartype invoice_section_id: str + :ivar invoice_section_name: Invoice section name to which this product + belongs. + :vartype invoice_section_name: str + :ivar billing_profile_id: Billing Profile id to which this product + belongs. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing Profile name to which this product + belongs. + :vartype billing_profile_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'purchase_date': {'readonly': True}, + 'product_type_id': {'readonly': True}, + 'product_type': {'readonly': True}, + 'end_date': {'readonly': True}, + 'last_charge': {'readonly': True}, + 'last_charge_date': {'readonly': True}, + 'quantity': {'readonly': True}, + 'sku_id': {'readonly': True}, + 'sku_description': {'readonly': True}, + 'availability_id': {'readonly': True}, + 'parent_product_id': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'purchase_date': {'key': 'properties.purchaseDate', 'type': 'iso-8601'}, + 'product_type_id': {'key': 'properties.productTypeId', 'type': 'str'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, + 'billing_frequency': {'key': 'properties.billingFrequency', 'type': 'str'}, + 'last_charge': {'key': 'properties.lastCharge', 'type': 'Amount'}, + 'last_charge_date': {'key': 'properties.lastChargeDate', 'type': 'iso-8601'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, + 'availability_id': {'key': 'properties.availabilityId', 'type': 'str'}, + 'parent_product_id': {'key': 'properties.parentProductId', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProductSummary, self).__init__(**kwargs) + self.display_name = None + self.purchase_date = None + self.product_type_id = None + self.product_type = None + self.status = kwargs.get('status', None) + self.end_date = None + self.billing_frequency = kwargs.get('billing_frequency', None) + self.last_charge = None + self.last_charge_date = None + self.quantity = None + self.sku_id = None + self.sku_description = None + self.availability_id = None + self.parent_product_id = None + self.invoice_section_id = None + self.invoice_section_name = None + self.billing_profile_id = None + self.billing_profile_name = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_paged.py b/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_paged.py similarity index 67% rename from azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_paged.py rename to azure-mgmt-billing/azure/mgmt/billing/models/product_summary_paged.py index bf852a37e1b1..d34d96d175af 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_paged.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class EnrollmentAccountPaged(Paged): +class ProductSummaryPaged(Paged): """ - A paging container for iterating over a list of :class:`EnrollmentAccount ` object + A paging container for iterating over a list of :class:`ProductSummary ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[EnrollmentAccount]'} + 'current_page': {'key': 'value', 'type': '[ProductSummary]'} } def __init__(self, *args, **kwargs): - super(EnrollmentAccountPaged, self).__init__(*args, **kwargs) + super(ProductSummaryPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_py3.py new file mode 100644 index 000000000000..182b96e9526f --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_py3.py @@ -0,0 +1,138 @@ +# 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 .resource_py3 import Resource + + +class ProductSummary(Resource): + """A product summary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: The display name of the product. + :vartype display_name: str + :ivar purchase_date: The date of purchase. + :vartype purchase_date: datetime + :ivar product_type_id: The product type id. + :vartype product_type_id: str + :ivar product_type: The type of product. + :vartype product_type: str + :param status: Product status. Possible values include: 'Active', + 'Inactive', 'PastDue', 'Expiring', 'Expired', 'Disabled', 'Cancelled', + 'AutoRenew' + :type status: str or ~azure.mgmt.billing.models.ProductStatusType + :ivar end_date: end date. + :vartype end_date: datetime + :param billing_frequency: Billing frequency. Possible values include: + 'OneTime', 'Monthly', 'UsageBased' + :type billing_frequency: str or + ~azure.mgmt.billing.models.BillingFrequency + :ivar last_charge: Last month charges. + :vartype last_charge: ~azure.mgmt.billing.models.Amount + :ivar last_charge_date: The date of the last charge. + :vartype last_charge_date: datetime + :ivar quantity: The purchased product quantity. + :vartype quantity: float + :ivar sku_id: Sku Id. + :vartype sku_id: str + :ivar sku_description: Sku description. + :vartype sku_description: str + :ivar availability_id: Availability Id. + :vartype availability_id: str + :ivar parent_product_id: Parent Product Id. + :vartype parent_product_id: str + :ivar invoice_section_id: Invoice section id to which this product + belongs. + :vartype invoice_section_id: str + :ivar invoice_section_name: Invoice section name to which this product + belongs. + :vartype invoice_section_name: str + :ivar billing_profile_id: Billing Profile id to which this product + belongs. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing Profile name to which this product + belongs. + :vartype billing_profile_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'purchase_date': {'readonly': True}, + 'product_type_id': {'readonly': True}, + 'product_type': {'readonly': True}, + 'end_date': {'readonly': True}, + 'last_charge': {'readonly': True}, + 'last_charge_date': {'readonly': True}, + 'quantity': {'readonly': True}, + 'sku_id': {'readonly': True}, + 'sku_description': {'readonly': True}, + 'availability_id': {'readonly': True}, + 'parent_product_id': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'purchase_date': {'key': 'properties.purchaseDate', 'type': 'iso-8601'}, + 'product_type_id': {'key': 'properties.productTypeId', 'type': 'str'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, + 'billing_frequency': {'key': 'properties.billingFrequency', 'type': 'str'}, + 'last_charge': {'key': 'properties.lastCharge', 'type': 'Amount'}, + 'last_charge_date': {'key': 'properties.lastChargeDate', 'type': 'iso-8601'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, + 'availability_id': {'key': 'properties.availabilityId', 'type': 'str'}, + 'parent_product_id': {'key': 'properties.parentProductId', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + } + + def __init__(self, *, status=None, billing_frequency=None, **kwargs) -> None: + super(ProductSummary, self).__init__(**kwargs) + self.display_name = None + self.purchase_date = None + self.product_type_id = None + self.product_type = None + self.status = status + self.end_date = None + self.billing_frequency = billing_frequency + self.last_charge = None + self.last_charge_date = None + self.quantity = None + self.sku_id = None + self.sku_description = None + self.availability_id = None + self.parent_product_id = None + self.invoice_section_id = None + self.invoice_section_name = None + self.billing_profile_id = None + self.billing_profile_name = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result.py new file mode 100644 index 000000000000..3bafba7449aa --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result.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 + + +class ProductsListResult(Model): + """Result of listing products summary. It contains a list of available + products summaries in reverse chronological order by purchase date. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of products summary. + :vartype value: list[~azure.mgmt.billing.models.ProductSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProductSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProductsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result_py3.py new file mode 100644 index 000000000000..d8afea8a7d89 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result_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 + + +class ProductsListResult(Model): + """Result of listing products summary. It contains a list of available + products summaries in reverse chronological order by purchase date. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of products summary. + :vartype value: list[~azure.mgmt.billing.models.ProductSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProductSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProductsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py b/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py new file mode 100644 index 000000000000..d354dbc6a36a --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py @@ -0,0 +1,79 @@ +# 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 RecipientTransferDetails(Model): + """Details of the transfer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar creation_time: Transfer creation time. + :vartype creation_time: datetime + :ivar expiration_time: Transfer expiration time. + :vartype expiration_time: datetime + :ivar allowed_product_type: Type of subscriptions that can be transferred. + :vartype allowed_product_type: list[str or + ~azure.mgmt.billing.models.EligibleProductType] + :ivar transfer_status: Overall transfer status. Possible values include: + 'Pending', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', + 'Canceled', 'Declined' + :vartype transfer_status: str or ~azure.mgmt.billing.models.TransferStatus + :ivar recipient_email_id: Email Id of recipient of transfer. + :vartype recipient_email_id: str + :ivar initiator_email_id: Email Id of initiator of transfer. + :vartype initiator_email_id: str + :ivar canceled_by: Email Id who user canceled the transfer. + :vartype canceled_by: str + :ivar last_modified_time: Transfer last modification time. + :vartype last_modified_time: datetime + :ivar detailed_transfer_status: Detailed transfer status. + :vartype detailed_transfer_status: + list[~azure.mgmt.billing.models.DetailedTransferStatus] + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'allowed_product_type': {'readonly': True}, + 'transfer_status': {'readonly': True}, + 'recipient_email_id': {'readonly': True}, + 'initiator_email_id': {'readonly': True}, + 'canceled_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'detailed_transfer_status': {'readonly': True}, + } + + _attribute_map = { + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'allowed_product_type': {'key': 'properties.allowedProductType', 'type': '[str]'}, + 'transfer_status': {'key': 'properties.transferStatus', 'type': 'str'}, + 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, + 'initiator_email_id': {'key': 'properties.initiatorEmailId', 'type': 'str'}, + 'canceled_by': {'key': 'properties.canceledBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'detailed_transfer_status': {'key': 'properties.detailedTransferStatus', 'type': '[DetailedTransferStatus]'}, + } + + def __init__(self, **kwargs): + super(RecipientTransferDetails, self).__init__(**kwargs) + self.creation_time = None + self.expiration_time = None + self.allowed_product_type = None + self.transfer_status = None + self.recipient_email_id = None + self.initiator_email_id = None + self.canceled_by = None + self.last_modified_time = None + self.detailed_transfer_status = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_paged.py b/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_paged.py new file mode 100644 index 000000000000..28cd6d360efd --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class RecipientTransferDetailsPaged(Paged): + """ + A paging container for iterating over a list of :class:`RecipientTransferDetails ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RecipientTransferDetails]'} + } + + def __init__(self, *args, **kwargs): + + super(RecipientTransferDetailsPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py new file mode 100644 index 000000000000..90fcfe2ab2fc --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py @@ -0,0 +1,79 @@ +# 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 RecipientTransferDetails(Model): + """Details of the transfer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar creation_time: Transfer creation time. + :vartype creation_time: datetime + :ivar expiration_time: Transfer expiration time. + :vartype expiration_time: datetime + :ivar allowed_product_type: Type of subscriptions that can be transferred. + :vartype allowed_product_type: list[str or + ~azure.mgmt.billing.models.EligibleProductType] + :ivar transfer_status: Overall transfer status. Possible values include: + 'Pending', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', + 'Canceled', 'Declined' + :vartype transfer_status: str or ~azure.mgmt.billing.models.TransferStatus + :ivar recipient_email_id: Email Id of recipient of transfer. + :vartype recipient_email_id: str + :ivar initiator_email_id: Email Id of initiator of transfer. + :vartype initiator_email_id: str + :ivar canceled_by: Email Id who user canceled the transfer. + :vartype canceled_by: str + :ivar last_modified_time: Transfer last modification time. + :vartype last_modified_time: datetime + :ivar detailed_transfer_status: Detailed transfer status. + :vartype detailed_transfer_status: + list[~azure.mgmt.billing.models.DetailedTransferStatus] + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'allowed_product_type': {'readonly': True}, + 'transfer_status': {'readonly': True}, + 'recipient_email_id': {'readonly': True}, + 'initiator_email_id': {'readonly': True}, + 'canceled_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'detailed_transfer_status': {'readonly': True}, + } + + _attribute_map = { + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'allowed_product_type': {'key': 'properties.allowedProductType', 'type': '[str]'}, + 'transfer_status': {'key': 'properties.transferStatus', 'type': 'str'}, + 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, + 'initiator_email_id': {'key': 'properties.initiatorEmailId', 'type': 'str'}, + 'canceled_by': {'key': 'properties.canceledBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'detailed_transfer_status': {'key': 'properties.detailedTransferStatus', 'type': '[DetailedTransferStatus]'}, + } + + def __init__(self, **kwargs) -> None: + super(RecipientTransferDetails, self).__init__(**kwargs) + self.creation_time = None + self.expiration_time = None + self.allowed_product_type = None + self.transfer_status = None + self.recipient_email_id = None + self.initiator_email_id = None + self.canceled_by = None + self.last_modified_time = None + self.detailed_transfer_status = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result.py new file mode 100644 index 000000000000..156d834158bf --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result.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 TransactionsListResult(Model): + """Result of listing reservation transactions summary. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of reservation transactions summary. + :vartype value: list[~azure.mgmt.billing.models.TransactionsSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TransactionsSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TransactionsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result_py3.py new file mode 100644 index 000000000000..621cb39dc478 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result_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 TransactionsListResult(Model): + """Result of listing reservation transactions summary. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of reservation transactions summary. + :vartype value: list[~azure.mgmt.billing.models.TransactionsSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TransactionsSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TransactionsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py new file mode 100644 index 000000000000..9dd286bb63bb --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py @@ -0,0 +1,131 @@ +# 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 .resource import Resource + + +class TransactionsSummary(Resource): + """A reservation transaction summary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param kind: The kind of transaction. Choices are all and reservation. + Possible values include: 'all', 'reservation' + :type kind: str or ~azure.mgmt.billing.models.TransactionTypeKind + :ivar date_property: The date of reservation transaction. + :vartype date_property: datetime + :ivar invoice: Invoice number or 'pending' if not invoiced. + :vartype invoice: str + :ivar order_id: The reservation order id. + :vartype order_id: str + :ivar order_name: The reservation order name. + :vartype order_name: str + :ivar product_type_id: The product type id. + :vartype product_type_id: str + :ivar product_type: The type of product. + :vartype product_type: str + :ivar product_description: Product description. + :vartype product_description: str + :param transaction_type: Transaction types. Possible values include: + 'Purchase', 'Usage Charge' + :type transaction_type: str or ~azure.mgmt.billing.models.ReservationType + :ivar transaction_amount: Last charge associated with the purchase. + :vartype transaction_amount: ~azure.mgmt.billing.models.Amount + :ivar quantity: Purchase quantity. + :vartype quantity: int + :ivar invoice_section_id: Invoice section id to which this product + belongs. + :vartype invoice_section_id: str + :ivar invoice_section_name: Invoice section name to which this product + belongs. + :vartype invoice_section_name: str + :ivar billing_profile_id: Billing Profile id to which this product + belongs. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing Profile name to which this product + belongs. + :vartype billing_profile_name: str + :ivar subscription_id: The subscription id. + :vartype subscription_id: str + :ivar subscription_name: The subscription name. + :vartype subscription_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'date_property': {'readonly': True}, + 'invoice': {'readonly': True}, + 'order_id': {'readonly': True}, + 'order_name': {'readonly': True}, + 'product_type_id': {'readonly': True}, + 'product_type': {'readonly': True}, + 'product_description': {'readonly': True}, + 'transaction_amount': {'readonly': True}, + 'quantity': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'subscription_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'properties.kind', 'type': 'str'}, + 'date_property': {'key': 'properties.date', 'type': 'iso-8601'}, + 'invoice': {'key': 'properties.invoice', 'type': 'str'}, + 'order_id': {'key': 'properties.orderId', 'type': 'str'}, + 'order_name': {'key': 'properties.orderName', 'type': 'str'}, + 'product_type_id': {'key': 'properties.productTypeId', 'type': 'str'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'product_description': {'key': 'properties.productDescription', 'type': 'str'}, + 'transaction_type': {'key': 'properties.transactionType', 'type': 'str'}, + 'transaction_amount': {'key': 'properties.transactionAmount', 'type': 'Amount'}, + 'quantity': {'key': 'properties.quantity', 'type': 'int'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TransactionsSummary, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.date_property = None + self.invoice = None + self.order_id = None + self.order_name = None + self.product_type_id = None + self.product_type = None + self.product_description = None + self.transaction_type = kwargs.get('transaction_type', None) + self.transaction_amount = None + self.quantity = None + self.invoice_section_id = None + self.invoice_section_name = None + self.billing_profile_id = None + self.billing_profile_name = None + self.subscription_id = None + self.subscription_name = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_paged.py b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_paged.py new file mode 100644 index 000000000000..f1626e6b12ab --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class TransactionsSummaryPaged(Paged): + """ + A paging container for iterating over a list of :class:`TransactionsSummary ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TransactionsSummary]'} + } + + def __init__(self, *args, **kwargs): + + super(TransactionsSummaryPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py new file mode 100644 index 000000000000..7d51ec8bec74 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py @@ -0,0 +1,131 @@ +# 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 .resource_py3 import Resource + + +class TransactionsSummary(Resource): + """A reservation transaction summary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param kind: The kind of transaction. Choices are all and reservation. + Possible values include: 'all', 'reservation' + :type kind: str or ~azure.mgmt.billing.models.TransactionTypeKind + :ivar date_property: The date of reservation transaction. + :vartype date_property: datetime + :ivar invoice: Invoice number or 'pending' if not invoiced. + :vartype invoice: str + :ivar order_id: The reservation order id. + :vartype order_id: str + :ivar order_name: The reservation order name. + :vartype order_name: str + :ivar product_type_id: The product type id. + :vartype product_type_id: str + :ivar product_type: The type of product. + :vartype product_type: str + :ivar product_description: Product description. + :vartype product_description: str + :param transaction_type: Transaction types. Possible values include: + 'Purchase', 'Usage Charge' + :type transaction_type: str or ~azure.mgmt.billing.models.ReservationType + :ivar transaction_amount: Last charge associated with the purchase. + :vartype transaction_amount: ~azure.mgmt.billing.models.Amount + :ivar quantity: Purchase quantity. + :vartype quantity: int + :ivar invoice_section_id: Invoice section id to which this product + belongs. + :vartype invoice_section_id: str + :ivar invoice_section_name: Invoice section name to which this product + belongs. + :vartype invoice_section_name: str + :ivar billing_profile_id: Billing Profile id to which this product + belongs. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing Profile name to which this product + belongs. + :vartype billing_profile_name: str + :ivar subscription_id: The subscription id. + :vartype subscription_id: str + :ivar subscription_name: The subscription name. + :vartype subscription_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'date_property': {'readonly': True}, + 'invoice': {'readonly': True}, + 'order_id': {'readonly': True}, + 'order_name': {'readonly': True}, + 'product_type_id': {'readonly': True}, + 'product_type': {'readonly': True}, + 'product_description': {'readonly': True}, + 'transaction_amount': {'readonly': True}, + 'quantity': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'subscription_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'properties.kind', 'type': 'str'}, + 'date_property': {'key': 'properties.date', 'type': 'iso-8601'}, + 'invoice': {'key': 'properties.invoice', 'type': 'str'}, + 'order_id': {'key': 'properties.orderId', 'type': 'str'}, + 'order_name': {'key': 'properties.orderName', 'type': 'str'}, + 'product_type_id': {'key': 'properties.productTypeId', 'type': 'str'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'product_description': {'key': 'properties.productDescription', 'type': 'str'}, + 'transaction_type': {'key': 'properties.transactionType', 'type': 'str'}, + 'transaction_amount': {'key': 'properties.transactionAmount', 'type': 'Amount'}, + 'quantity': {'key': 'properties.quantity', 'type': 'int'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, + } + + def __init__(self, *, kind=None, transaction_type=None, **kwargs) -> None: + super(TransactionsSummary, self).__init__(**kwargs) + self.kind = kind + self.date_property = None + self.invoice = None + self.order_id = None + self.order_name = None + self.product_type_id = None + self.product_type = None + self.product_description = None + self.transaction_type = transaction_type + self.transaction_amount = None + self.quantity = None + self.invoice_section_id = None + self.invoice_section_name = None + self.billing_profile_id = None + self.billing_profile_name = None + self.subscription_id = None + self.subscription_name = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py new file mode 100644 index 000000000000..6af50002d8cc --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.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 TransferBillingSubscriptionRequest(Model): + """Request parameters to transfer billing subscription. + + :param destination_invoice_section_name: The destination + invoiceSectionName. + :type destination_invoice_section_name: str + """ + + _attribute_map = { + 'destination_invoice_section_name': {'key': 'properties.destinationInvoiceSectionName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TransferBillingSubscriptionRequest, self).__init__(**kwargs) + self.destination_invoice_section_name = kwargs.get('destination_invoice_section_name', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py new file mode 100644 index 000000000000..32e96f842cdf --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.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 TransferBillingSubscriptionRequestProperties(Model): + """Request parameters to transfer billing subscription. + + :param destination_invoice_section_name: The destination + invoiceSectionName. + :type destination_invoice_section_name: str + """ + + _attribute_map = { + 'destination_invoice_section_name': {'key': 'destinationInvoiceSectionName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TransferBillingSubscriptionRequestProperties, self).__init__(**kwargs) + self.destination_invoice_section_name = kwargs.get('destination_invoice_section_name', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py new file mode 100644 index 000000000000..95d748e6b66d --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_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 TransferBillingSubscriptionRequestProperties(Model): + """Request parameters to transfer billing subscription. + + :param destination_invoice_section_name: The destination + invoiceSectionName. + :type destination_invoice_section_name: str + """ + + _attribute_map = { + 'destination_invoice_section_name': {'key': 'destinationInvoiceSectionName', 'type': 'str'}, + } + + def __init__(self, *, destination_invoice_section_name: str=None, **kwargs) -> None: + super(TransferBillingSubscriptionRequestProperties, self).__init__(**kwargs) + self.destination_invoice_section_name = destination_invoice_section_name diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py new file mode 100644 index 000000000000..6d12cbdb86c7 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_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 TransferBillingSubscriptionRequest(Model): + """Request parameters to transfer billing subscription. + + :param destination_invoice_section_name: The destination + invoiceSectionName. + :type destination_invoice_section_name: str + """ + + _attribute_map = { + 'destination_invoice_section_name': {'key': 'properties.destinationInvoiceSectionName', 'type': 'str'}, + } + + def __init__(self, *, destination_invoice_section_name: str=None, **kwargs) -> None: + super(TransferBillingSubscriptionRequest, self).__init__(**kwargs) + self.destination_invoice_section_name = destination_invoice_section_name diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result.py new file mode 100644 index 000000000000..a606c5260389 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result.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 TransferBillingSubscriptionResult(Model): + """Request parameters to transfer billing subscription. + + :param billing_subscription_name: The destination billing subscription id. + :type billing_subscription_name: str + """ + + _attribute_map = { + 'billing_subscription_name': {'key': 'properties.billingSubscriptionName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TransferBillingSubscriptionResult, self).__init__(**kwargs) + self.billing_subscription_name = kwargs.get('billing_subscription_name', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result_py3.py new file mode 100644 index 000000000000..116dbe42cef3 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result_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 TransferBillingSubscriptionResult(Model): + """Request parameters to transfer billing subscription. + + :param billing_subscription_name: The destination billing subscription id. + :type billing_subscription_name: str + """ + + _attribute_map = { + 'billing_subscription_name': {'key': 'properties.billingSubscriptionName', 'type': 'str'}, + } + + def __init__(self, *, billing_subscription_name: str=None, **kwargs) -> None: + super(TransferBillingSubscriptionResult, self).__init__(**kwargs) + self.billing_subscription_name = billing_subscription_name diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py new file mode 100644 index 000000000000..602499a0a3de --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py @@ -0,0 +1,83 @@ +# 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 TransferDetails(Model): + """Details of the transfer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar creation_time: Transfer creation time. + :vartype creation_time: datetime + :ivar expiration_time: Transfer expiration time. + :vartype expiration_time: datetime + :ivar invoice_section_id: Target invoice setion Id. + :vartype invoice_section_id: str + :ivar billing_account_id: Target billing account Id. + :vartype billing_account_id: str + :ivar transfer_status: Overall transfer status. Possible values include: + 'Pending', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', + 'Canceled', 'Declined' + :vartype transfer_status: str or ~azure.mgmt.billing.models.TransferStatus + :ivar recipient_email_id: Email Id of recipient of transfer. + :vartype recipient_email_id: str + :ivar initiator_email_id: Email Id of initiator of transfer. + :vartype initiator_email_id: str + :ivar canceled_by: Email Id who user canceled the transfer. + :vartype canceled_by: str + :ivar last_modified_time: Transfer last modification time. + :vartype last_modified_time: datetime + :ivar detailed_transfer_status: Detailed transfer status. + :vartype detailed_transfer_status: + list[~azure.mgmt.billing.models.DetailedTransferStatus] + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'billing_account_id': {'readonly': True}, + 'transfer_status': {'readonly': True}, + 'recipient_email_id': {'readonly': True}, + 'initiator_email_id': {'readonly': True}, + 'canceled_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'detailed_transfer_status': {'readonly': True}, + } + + _attribute_map = { + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, + 'transfer_status': {'key': 'properties.transferStatus', 'type': 'str'}, + 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, + 'initiator_email_id': {'key': 'properties.initiatorEmailId', 'type': 'str'}, + 'canceled_by': {'key': 'properties.canceledBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'detailed_transfer_status': {'key': 'properties.detailedTransferStatus', 'type': '[DetailedTransferStatus]'}, + } + + def __init__(self, **kwargs): + super(TransferDetails, self).__init__(**kwargs) + self.creation_time = None + self.expiration_time = None + self.invoice_section_id = None + self.billing_account_id = None + self.transfer_status = None + self.recipient_email_id = None + self.initiator_email_id = None + self.canceled_by = None + self.last_modified_time = None + self.detailed_transfer_status = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_paged.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_paged.py new file mode 100644 index 000000000000..868739480a54 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class TransferDetailsPaged(Paged): + """ + A paging container for iterating over a list of :class:`TransferDetails ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TransferDetails]'} + } + + def __init__(self, *args, **kwargs): + + super(TransferDetailsPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py new file mode 100644 index 000000000000..9b91427721cc --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py @@ -0,0 +1,83 @@ +# 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 TransferDetails(Model): + """Details of the transfer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar creation_time: Transfer creation time. + :vartype creation_time: datetime + :ivar expiration_time: Transfer expiration time. + :vartype expiration_time: datetime + :ivar invoice_section_id: Target invoice setion Id. + :vartype invoice_section_id: str + :ivar billing_account_id: Target billing account Id. + :vartype billing_account_id: str + :ivar transfer_status: Overall transfer status. Possible values include: + 'Pending', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', + 'Canceled', 'Declined' + :vartype transfer_status: str or ~azure.mgmt.billing.models.TransferStatus + :ivar recipient_email_id: Email Id of recipient of transfer. + :vartype recipient_email_id: str + :ivar initiator_email_id: Email Id of initiator of transfer. + :vartype initiator_email_id: str + :ivar canceled_by: Email Id who user canceled the transfer. + :vartype canceled_by: str + :ivar last_modified_time: Transfer last modification time. + :vartype last_modified_time: datetime + :ivar detailed_transfer_status: Detailed transfer status. + :vartype detailed_transfer_status: + list[~azure.mgmt.billing.models.DetailedTransferStatus] + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'billing_account_id': {'readonly': True}, + 'transfer_status': {'readonly': True}, + 'recipient_email_id': {'readonly': True}, + 'initiator_email_id': {'readonly': True}, + 'canceled_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'detailed_transfer_status': {'readonly': True}, + } + + _attribute_map = { + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, + 'transfer_status': {'key': 'properties.transferStatus', 'type': 'str'}, + 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, + 'initiator_email_id': {'key': 'properties.initiatorEmailId', 'type': 'str'}, + 'canceled_by': {'key': 'properties.canceledBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'detailed_transfer_status': {'key': 'properties.detailedTransferStatus', 'type': '[DetailedTransferStatus]'}, + } + + def __init__(self, **kwargs) -> None: + super(TransferDetails, self).__init__(**kwargs) + self.creation_time = None + self.expiration_time = None + self.invoice_section_id = None + self.billing_account_id = None + self.transfer_status = None + self.recipient_email_id = None + self.initiator_email_id = None + self.canceled_by = None + self.last_modified_time = None + self.detailed_transfer_status = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py new file mode 100644 index 000000000000..47ca8b229e97 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.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 TransferProductRequestProperties(Model): + """The properties of the product to initiate a transfer. + + :param destination_invoice_section_name: Destination invoice section id. + :type destination_invoice_section_name: str + """ + + _attribute_map = { + 'destination_invoice_section_name': {'key': 'destinationInvoiceSectionName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TransferProductRequestProperties, self).__init__(**kwargs) + self.destination_invoice_section_name = kwargs.get('destination_invoice_section_name', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py new file mode 100644 index 000000000000..715e24e5b95b --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_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 TransferProductRequestProperties(Model): + """The properties of the product to initiate a transfer. + + :param destination_invoice_section_name: Destination invoice section id. + :type destination_invoice_section_name: str + """ + + _attribute_map = { + 'destination_invoice_section_name': {'key': 'destinationInvoiceSectionName', 'type': 'str'}, + } + + def __init__(self, *, destination_invoice_section_name: str=None, **kwargs) -> None: + super(TransferProductRequestProperties, self).__init__(**kwargs) + self.destination_invoice_section_name = destination_invoice_section_name diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary.py b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary.py new file mode 100644 index 000000000000..58c13360fb33 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary.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 UpdateAutoRenewOperationSummary(Model): + """Summary of cancel product operation. + + :param end_date: The end date of this asset + :type end_date: datetime + """ + + _attribute_map = { + 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(UpdateAutoRenewOperationSummary, self).__init__(**kwargs) + self.end_date = kwargs.get('end_date', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary_py3.py new file mode 100644 index 000000000000..df7e37b21cd6 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary_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 UpdateAutoRenewOperationSummary(Model): + """Summary of cancel product operation. + + :param end_date: The end date of this asset + :type end_date: datetime + """ + + _attribute_map = { + 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, + } + + def __init__(self, *, end_date=None, **kwargs) -> None: + super(UpdateAutoRenewOperationSummary, self).__init__(**kwargs) + self.end_date = end_date diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request.py b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request.py new file mode 100644 index 000000000000..80db81d894c6 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request.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 UpdateAutoRenewRequest(Model): + """Request parameters to update auto renew for support product. + + :param auto_renew: Request parameters to update auto renew policy a + product. Possible values include: 'true', 'false' + :type auto_renew: str or ~azure.mgmt.billing.models.UpdateAutoRenew + """ + + _attribute_map = { + 'auto_renew': {'key': 'autoRenew', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateAutoRenewRequest, self).__init__(**kwargs) + self.auto_renew = kwargs.get('auto_renew', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request_py3.py new file mode 100644 index 000000000000..5f99c7657109 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_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 UpdateAutoRenewRequest(Model): + """Request parameters to update auto renew for support product. + + :param auto_renew: Request parameters to update auto renew policy a + product. Possible values include: 'true', 'false' + :type auto_renew: str or ~azure.mgmt.billing.models.UpdateAutoRenew + """ + + _attribute_map = { + 'auto_renew': {'key': 'autoRenew', 'type': 'str'}, + } + + def __init__(self, *, auto_renew=None, **kwargs) -> None: + super(UpdateAutoRenewRequest, self).__init__(**kwargs) + self.auto_renew = auto_renew diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index c3d1d198514e..8c73c7b45153 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -9,14 +9,84 @@ # regenerated. # -------------------------------------------------------------------------- +from .billing_accounts_operations import BillingAccountsOperations +from .billing_accounts_with_create_invoice_section_permission_operations import BillingAccountsWithCreateInvoiceSectionPermissionOperations +from .available_balance_by_billing_profile_operations import AvailableBalanceByBillingProfileOperations +from .payment_methods_by_billing_profile_operations import PaymentMethodsByBillingProfileOperations +from .billing_profiles_by_billing_account_name_operations import BillingProfilesByBillingAccountNameOperations +from .billing_profiles_operations import BillingProfilesOperations +from .invoice_sections_by_billing_account_name_operations import InvoiceSectionsByBillingAccountNameOperations +from .invoice_sections_operations import InvoiceSectionsOperations +from .invoice_sections_with_create_subscription_permission_operations import InvoiceSectionsWithCreateSubscriptionPermissionOperations +from .departments_by_billing_account_name_operations import DepartmentsByBillingAccountNameOperations +from .departments_operations import DepartmentsOperations +from .enrollment_accounts_by_billing_account_name_operations import EnrollmentAccountsByBillingAccountNameOperations from .enrollment_accounts_operations import EnrollmentAccountsOperations -from .billing_periods_operations import BillingPeriodsOperations -from .invoices_operations import InvoicesOperations +from .invoices_by_billing_account_operations import InvoicesByBillingAccountOperations +from .invoice_pricesheet_operations import InvoicePricesheetOperations +from .invoices_by_billing_profile_operations import InvoicesByBillingProfileOperations +from .invoice_operations import InvoiceOperations +from .products_by_billing_subscriptions_operations import ProductsByBillingSubscriptionsOperations +from .billing_subscriptions_by_billing_profile_operations import BillingSubscriptionsByBillingProfileOperations +from .billing_subscriptions_by_invoice_section_operations import BillingSubscriptionsByInvoiceSectionOperations +from .billing_subscription_operations import BillingSubscriptionOperations +from .products_by_billing_account_operations import ProductsByBillingAccountOperations +from .products_by_invoice_section_operations import ProductsByInvoiceSectionOperations +from .products_operations import ProductsOperations +from .transactions_by_billing_account_operations import TransactionsByBillingAccountOperations +from .policy_operations import PolicyOperations +from .billing_property_operations import BillingPropertyOperations +from .transfers_operations import TransfersOperations +from .recipient_transfers_operations import RecipientTransfersOperations from .operations import Operations +from .billing_account_billing_permissions_operations import BillingAccountBillingPermissionsOperations +from .invoice_sections_billing_permissions_operations import InvoiceSectionsBillingPermissionsOperations +from .billing_profile_billing_permissions_operations import BillingProfileBillingPermissionsOperations +from .billing_account_billing_role_definition_operations import BillingAccountBillingRoleDefinitionOperations +from .invoice_section_billing_role_definition_operations import InvoiceSectionBillingRoleDefinitionOperations +from .billing_profile_billing_role_definition_operations import BillingProfileBillingRoleDefinitionOperations +from .billing_account_billing_role_assignment_operations import BillingAccountBillingRoleAssignmentOperations +from .invoice_section_billing_role_assignment_operations import InvoiceSectionBillingRoleAssignmentOperations +from .billing_profile_billing_role_assignment_operations import BillingProfileBillingRoleAssignmentOperations __all__ = [ + 'BillingAccountsOperations', + 'BillingAccountsWithCreateInvoiceSectionPermissionOperations', + 'AvailableBalanceByBillingProfileOperations', + 'PaymentMethodsByBillingProfileOperations', + 'BillingProfilesByBillingAccountNameOperations', + 'BillingProfilesOperations', + 'InvoiceSectionsByBillingAccountNameOperations', + 'InvoiceSectionsOperations', + 'InvoiceSectionsWithCreateSubscriptionPermissionOperations', + 'DepartmentsByBillingAccountNameOperations', + 'DepartmentsOperations', + 'EnrollmentAccountsByBillingAccountNameOperations', 'EnrollmentAccountsOperations', - 'BillingPeriodsOperations', - 'InvoicesOperations', + 'InvoicesByBillingAccountOperations', + 'InvoicePricesheetOperations', + 'InvoicesByBillingProfileOperations', + 'InvoiceOperations', + 'ProductsByBillingSubscriptionsOperations', + 'BillingSubscriptionsByBillingProfileOperations', + 'BillingSubscriptionsByInvoiceSectionOperations', + 'BillingSubscriptionOperations', + 'ProductsByBillingAccountOperations', + 'ProductsByInvoiceSectionOperations', + 'ProductsOperations', + 'TransactionsByBillingAccountOperations', + 'PolicyOperations', + 'BillingPropertyOperations', + 'TransfersOperations', + 'RecipientTransfersOperations', 'Operations', + 'BillingAccountBillingPermissionsOperations', + 'InvoiceSectionsBillingPermissionsOperations', + 'BillingProfileBillingPermissionsOperations', + 'BillingAccountBillingRoleDefinitionOperations', + 'InvoiceSectionBillingRoleDefinitionOperations', + 'BillingProfileBillingRoleDefinitionOperations', + 'BillingAccountBillingRoleAssignmentOperations', + 'InvoiceSectionBillingRoleAssignmentOperations', + 'BillingProfileBillingRoleAssignmentOperations', ] diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/available_balance_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/available_balance_by_billing_profile_operations.py new file mode 100644 index 000000000000..f4d743d0317a --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/available_balance_by_billing_profile_operations.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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class AvailableBalanceByBillingProfileOperations(object): + """AvailableBalanceByBillingProfileOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """The latest available credit balance for a given billingAccountName and + billingProfileName. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: 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: AvailableBalance or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.AvailableBalance or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AvailableBalance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/availableBalance/default'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_permissions_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_permissions_operations.py new file mode 100644 index 000000000000..5424cc0e51cc --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_permissions_operations.py @@ -0,0 +1,94 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BillingAccountBillingPermissionsOperations(object): + """BillingAccountBillingPermissionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """Lists all billingPermissions for the caller has for a billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: 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: BillingPermissionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingPermissionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingPermissionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingPermissions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_assignment_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_assignment_operations.py new file mode 100644 index 000000000000..f8ff12e9940c --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_assignment_operations.py @@ -0,0 +1,279 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BillingAccountBillingRoleAssignmentOperations(object): + """BillingAccountBillingRoleAssignmentOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignment for the caller. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_role_assignment_name: role assignment id. + :type billing_role_assignment_name: 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: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def delete( + self, billing_account_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Delete the role assignment on this billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_role_assignment_name: role assignment id. + :type billing_role_assignment_name: 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: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def list( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignments on the Billing Account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: 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: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments'} + + def add( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """The operation to add a role assignment to a billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: 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: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = None + + # Construct URL + url = self.add.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'BillingRoleAssignmentPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/createBillingRoleAssignment'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_definition_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_definition_operations.py new file mode 100644 index 000000000000..ec6ddf02ab4f --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_definition_operations.py @@ -0,0 +1,155 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BillingAccountBillingRoleDefinitionOperations(object): + """BillingAccountBillingRoleDefinitionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_name, billing_role_definition_name, custom_headers=None, raw=False, **operation_config): + """Gets the role definition for a role. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_role_definition_name: role definition id. + :type billing_role_definition_name: 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: BillingRoleDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingRoleDefinitionName': self._serialize.url("billing_role_definition_name", billing_role_definition_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}'} + + def list( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """Lists the role definition for a billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: 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: BillingRoleDefinitionListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinitionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleDefinitionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleDefinitions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py new file mode 100644 index 000000000000..e2df4e98e87d --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py @@ -0,0 +1,155 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BillingAccountsOperations(object): + """BillingAccountsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all billing accounts for a user which he has access to. + + :param expand: May be used to expand the invoiceSections and + billingProfiles. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingAccountListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingAccountListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingAccountListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts'} + + def get( + self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the billing account by id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param expand: May be used to expand the invoiceSections and + billingProfiles. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingAccount or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_with_create_invoice_section_permission_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_with_create_invoice_section_permission_operations.py new file mode 100644 index 000000000000..fe37879251b8 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_with_create_invoice_section_permission_operations.py @@ -0,0 +1,94 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BillingAccountsWithCreateInvoiceSectionPermissionOperations(object): + """BillingAccountsWithCreateInvoiceSectionPermissionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all billing accounts with create invoiceSection permission for a + user. + + :param expand: May be used to expand the invoiceSections and + billingProfiles. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingAccountListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingAccountListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingAccountListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/listBillingAccountsWithCreateInvoiceSectionPermission'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_periods_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_periods_operations.py deleted file mode 100644 index 337a3d705411..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_periods_operations.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class BillingPeriodsOperations(object): - """BillingPeriodsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-03-01-preview. Constant value: "2018-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-03-01-preview" - - self.config = config - - def list( - self, filter=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the available billing periods for a subscription in reverse - chronological order. This is only supported for Azure Web-Direct - subscriptions. Other subscription types which were not purchased - directly through the Azure web portal are not supported through this - preview API. - - :param filter: May be used to filter billing periods by - billingPeriodEndDate. The filter supports 'eq', 'lt', 'gt', 'le', - 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - :type filter: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N billing periods. - :type top: int - :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: An iterator like instance of BillingPeriod - :rtype: - ~azure.mgmt.billing.models.BillingPeriodPaged[~azure.mgmt.billing.models.BillingPeriod] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=100, minimum=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.BillingPeriodPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.BillingPeriodPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods'} - - def get( - self, billing_period_name, custom_headers=None, raw=False, **operation_config): - """Gets a named billing period. This is only supported for Azure - Web-Direct subscriptions. Other subscription types which were not - purchased directly through the Azure web portal are not supported - through this preview API. - - :param billing_period_name: The name of a BillingPeriod resource. - :type billing_period_name: 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: BillingPeriod or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingPeriod or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'billingPeriodName': self._serialize.url("billing_period_name", billing_period_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('BillingPeriod', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_permissions_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_permissions_operations.py new file mode 100644 index 000000000000..c9178f7574db --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_permissions_operations.py @@ -0,0 +1,97 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BillingProfileBillingPermissionsOperations(object): + """BillingProfileBillingPermissionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """Lists all billingPermissions for the caller has for a billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: 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: BillingPermissionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingPermissionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingPermissionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingPermissions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_assignment_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_assignment_operations.py new file mode 100644 index 000000000000..eec018f7a41c --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_assignment_operations.py @@ -0,0 +1,291 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BillingProfileBillingRoleAssignmentOperations(object): + """BillingProfileBillingRoleAssignmentOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_name, billing_profile_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignment for the caller on the Billing Profile. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param billing_role_assignment_name: role assignment id. + :type billing_role_assignment_name: 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: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def delete( + self, billing_account_name, billing_profile_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Delete the role assignment on this Billing Profile. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param billing_role_assignment_name: role assignment id. + :type billing_role_assignment_name: 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: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def list( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignments on the Billing Profile. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: 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: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleAssignments'} + + def add( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """The operation to add a role assignment to a billing profile. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: 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: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = None + + # Construct URL + url = self.add.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'BillingRoleAssignmentPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/createBillingRoleAssignment'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_definition_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_definition_operations.py new file mode 100644 index 000000000000..9489c03d4247 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_definition_operations.py @@ -0,0 +1,161 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BillingProfileBillingRoleDefinitionOperations(object): + """BillingProfileBillingRoleDefinitionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_name, billing_profile_name, billing_role_definition_name, custom_headers=None, raw=False, **operation_config): + """Gets the role definition for a role. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param billing_role_definition_name: role definition id. + :type billing_role_definition_name: 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: BillingRoleDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'billingRoleDefinitionName': self._serialize.url("billing_role_definition_name", billing_role_definition_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}'} + + def list( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """Lists the role definition for a Billing Profile. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: 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: BillingRoleDefinitionListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinitionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleDefinitionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleDefinitions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_by_billing_account_name_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_by_billing_account_name_operations.py new file mode 100644 index 000000000000..c5b107bebdf5 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_by_billing_account_name_operations.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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BillingProfilesByBillingAccountNameOperations(object): + """BillingProfilesByBillingAccountNameOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all billing profiles for a user which that user has access to. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param expand: May be used to expand the invoiceSections. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingProfileListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingProfileListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingProfileListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py new file mode 100644 index 000000000000..023bd234b1ed --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py @@ -0,0 +1,213 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class BillingProfilesOperations(object): + """BillingProfilesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_name, billing_profile_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the billing profile by id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param expand: May be used to expand the invoiceSections. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingProfile or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingProfile or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingProfile', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}'} + + + def _update_initial( + self, billing_account_name, billing_profile_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'BillingProfile') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('BillingProfile', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def update( + self, billing_account_name, billing_profile_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to update a billing profile. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param parameters: Parameters supplied to the update billing profile + operation. + :type parameters: ~azure.mgmt.billing.models.BillingProfile + :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 BillingProfile or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.BillingProfile] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.BillingProfile]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._update_initial( + billing_account_name=billing_account_name, + billing_profile_name=billing_profile_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + deserialized = self._deserialize('BillingProfile', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_property_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_property_operations.py new file mode 100644 index 000000000000..38d4ca1f0ce3 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_property_operations.py @@ -0,0 +1,92 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BillingPropertyOperations(object): + """BillingPropertyOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, custom_headers=None, raw=False, **operation_config): + """Get billing property by subscription Id. + + :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: BillingProperty or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingProperty or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingProperty', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingProperty'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py new file mode 100644 index 000000000000..2da5d990012d --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py @@ -0,0 +1,221 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class BillingSubscriptionOperations(object): + """BillingSubscriptionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_name, invoice_section_name, billing_subscription_name, custom_headers=None, raw=False, **operation_config): + """Get a single billing subscription by name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_subscription_name: Billing Subscription Id. + :type billing_subscription_name: 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: BillingSubscriptionSummary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingSubscriptionSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingSubscriptionName': self._serialize.url("billing_subscription_name", billing_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingSubscriptionSummary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}'} + + + def _transfer_initial( + self, billing_account_name, invoice_section_name, billing_subscription_name, destination_invoice_section_name=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TransferBillingSubscriptionRequestProperties(destination_invoice_section_name=destination_invoice_section_name) + + # Construct URL + url = self.transfer.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingSubscriptionName': self._serialize.url("billing_subscription_name", billing_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TransferBillingSubscriptionRequestProperties') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('TransferBillingSubscriptionResult', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + 'Azure-AsyncOperation': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def transfer( + self, billing_account_name, invoice_section_name, billing_subscription_name, destination_invoice_section_name=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Transfers the GTM subscription from one invoice section to another + within a billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_subscription_name: Billing Subscription Id. + :type billing_subscription_name: str + :param destination_invoice_section_name: The destination + invoiceSectionName. + :type destination_invoice_section_name: 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 + TransferBillingSubscriptionResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.TransferBillingSubscriptionResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.TransferBillingSubscriptionResult]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._transfer_initial( + billing_account_name=billing_account_name, + invoice_section_name=invoice_section_name, + billing_subscription_name=billing_subscription_name, + destination_invoice_section_name=destination_invoice_section_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + 'Azure-AsyncOperation': 'str', + } + deserialized = self._deserialize('TransferBillingSubscriptionResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/transfer'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py new file mode 100644 index 000000000000..788ce0e94f88 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BillingSubscriptionsByBillingProfileOperations(object): + """BillingSubscriptionsByBillingProfileOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """Lists billing subscriptions by billingProfileName. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: 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: BillingSubscriptionsListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingSubscriptionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingSubscriptionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfile/{billingProfileName}/billingSubscriptions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_invoice_section_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_invoice_section_operations.py new file mode 100644 index 000000000000..55d6e5916929 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_invoice_section_operations.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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BillingSubscriptionsByInvoiceSectionOperations(object): + """BillingSubscriptionsByInvoiceSectionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Lists billing subscription by invoiceSectionName. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: 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: BillingSubscriptionsListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingSubscriptionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingSubscriptionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/departments_by_billing_account_name_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/departments_by_billing_account_name_operations.py new file mode 100644 index 000000000000..172983a0c965 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/departments_by_billing_account_name_operations.py @@ -0,0 +1,105 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class DepartmentsByBillingAccountNameOperations(object): + """DepartmentsByBillingAccountNameOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists all departments for a user which he has access to. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param expand: May be used to expand the enrollmentAccounts. + :type expand: str + :param filter: The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and + 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter + is a key value pair string where key and value is separated by a colon + (:). + :type filter: 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: DepartmentListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.DepartmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DepartmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py new file mode 100644 index 000000000000..d455356b1845 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py @@ -0,0 +1,108 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class DepartmentsOperations(object): + """DepartmentsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_name, department_name, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Get the department by id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param department_name: Department Id. + :type department_name: str + :param expand: May be used to expand the enrollmentAccounts. + :type expand: str + :param filter: The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and + 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter + is a key value pair string where key and value is separated by a colon + (:). + :type filter: 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: Department or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.Department or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'departmentName': self._serialize.url("department_name", department_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Department', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_by_billing_account_name_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_by_billing_account_name_operations.py new file mode 100644 index 000000000000..768b8cf0bfdb --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_by_billing_account_name_operations.py @@ -0,0 +1,105 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class EnrollmentAccountsByBillingAccountNameOperations(object): + """EnrollmentAccountsByBillingAccountNameOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists all Enrollment Accounts for a user which he has access to. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param expand: May be used to expand the department. + :type expand: str + :param filter: The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and + 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter + is a key value pair string where key and value is separated by a colon + (:). + :type filter: 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: EnrollmentAccountListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.EnrollmentAccountListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('EnrollmentAccountListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py index 58199cd31644..3686d725dbb4 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py @@ -22,7 +22,7 @@ class EnrollmentAccountsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-03-01-preview. Constant value: "2018-03-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". """ models = models @@ -32,75 +32,25 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-03-01-preview" + self.api_version = "2018-11-01-preview" self.config = config - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists the enrollment accounts the caller has access to. - - :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: An iterator like instance of EnrollmentAccount - :rtype: - ~azure.mgmt.billing.models.EnrollmentAccountPaged[~azure.mgmt.billing.models.EnrollmentAccount] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.EnrollmentAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.EnrollmentAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/enrollmentAccounts'} - - def get( - self, name, custom_headers=None, raw=False, **operation_config): - """Gets a enrollment account by name. - - :param name: Enrollment Account name. - :type name: str + def get_by_enrollment_account_account_id( + self, billing_account_name, enrollment_account_name, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Get the enrollment account by id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param enrollment_account_name: Enrollment Account Id. + :type enrollment_account_name: str + :param expand: May be used to expand the Department. + :type expand: str + :param filter: The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and + 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter + is a key value pair string where key and value is separated by a colon + (:). + :type filter: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -113,15 +63,20 @@ def get( :class:`ErrorResponseException` """ # Construct URL - url = self.get.metadata['url'] + url = self.get_by_enrollment_account_account_id.metadata['url'] path_format_arguments = { - 'name': self._serialize.url("name", name, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'enrollmentAccountName': self._serialize.url("enrollment_account_name", enrollment_account_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') # Construct headers header_parameters = {} @@ -150,4 +105,4 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/enrollmentAccounts/{name}'} + get_by_enrollment_account_account_id.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py new file mode 100644 index 000000000000..8b8e32685d1c --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py @@ -0,0 +1,100 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class InvoiceOperations(object): + """InvoiceOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_name, billing_profile_name, invoice_name, custom_headers=None, raw=False, **operation_config): + """Get the invoice by id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_name: Invoice Id. + :type invoice_name: 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: InvoiceSummary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceName': self._serialize.url("invoice_name", invoice_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceSummary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_pricesheet_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_pricesheet_operations.py new file mode 100644 index 000000000000..82914f0724ca --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_pricesheet_operations.py @@ -0,0 +1,145 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class InvoicePricesheetOperations(object): + """InvoicePricesheetOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + + def _download_initial( + self, billing_account_name, invoice_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.download.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceName': self._serialize.url("invoice_name", invoice_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('DownloadUrl', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + 'Azure-AsyncOperation': 'str', + 'OData-EntityId': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def download( + self, billing_account_name, invoice_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Get pricesheet data for invoice id (invoiceName). + + :param billing_account_name: Azure Billing Account ID. + :type billing_account_name: str + :param invoice_name: The name of an invoice resource. + :type invoice_name: 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 DownloadUrl or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.DownloadUrl] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.DownloadUrl]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._download_initial( + billing_account_name=billing_account_name, + invoice_name=invoice_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + 'Azure-AsyncOperation': 'str', + 'OData-EntityId': 'str', + } + deserialized = self._deserialize('DownloadUrl', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + download.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/pricesheet/default/download'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_assignment_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_assignment_operations.py new file mode 100644 index 000000000000..2a836c469ae8 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_assignment_operations.py @@ -0,0 +1,291 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class InvoiceSectionBillingRoleAssignmentOperations(object): + """InvoiceSectionBillingRoleAssignmentOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_name, invoice_section_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignment for the caller on the invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_role_assignment_name: role assignment id. + :type billing_role_assignment_name: 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: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def delete( + self, billing_account_name, invoice_section_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Delete the role assignment on this invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_role_assignment_name: role assignment id. + :type billing_role_assignment_name: 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: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def list( + self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignments on the invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: 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: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments'} + + def add( + self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """The operation to add a role assignment to a invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: 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: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = None + + # Construct URL + url = self.add.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'BillingRoleAssignmentPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/createBillingRoleAssignment'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_definition_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_definition_operations.py new file mode 100644 index 000000000000..e45824959e4b --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_definition_operations.py @@ -0,0 +1,161 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class InvoiceSectionBillingRoleDefinitionOperations(object): + """InvoiceSectionBillingRoleDefinitionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_name, invoice_section_name, billing_role_definition_name, custom_headers=None, raw=False, **operation_config): + """Gets the role definition for a role. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_role_definition_name: role definition id. + :type billing_role_definition_name: 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: BillingRoleDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingRoleDefinitionName': self._serialize.url("billing_role_definition_name", billing_role_definition_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}'} + + def list( + self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Lists the role definition for a invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: 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: BillingRoleDefinitionListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinitionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleDefinitionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleDefinitions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_billing_permissions_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_billing_permissions_operations.py new file mode 100644 index 000000000000..36a228cc651a --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_billing_permissions_operations.py @@ -0,0 +1,97 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class InvoiceSectionsBillingPermissionsOperations(object): + """InvoiceSectionsBillingPermissionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Lists all billingPermissions for the caller has for a Invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: 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: BillingPermissionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingPermissionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingPermissionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingPermissions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_name_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_name_operations.py new file mode 100644 index 000000000000..cf321426d2a5 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_name_operations.py @@ -0,0 +1,104 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class InvoiceSectionsByBillingAccountNameOperations(object): + """InvoiceSectionsByBillingAccountNameOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all invoice sections for a user which he has access to. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param expand: May be used to expand the billingProfiles. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: InvoiceSectionListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceSectionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceSectionListResult', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py new file mode 100644 index 000000000000..10b082a6bb5a --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py @@ -0,0 +1,333 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class InvoiceSectionsOperations(object): + """InvoiceSectionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + + def _create_initial( + self, billing_account_name, display_name=None, billing_profiles=None, custom_headers=None, raw=False, **operation_config): + parameters = models.InvoiceSectionProperties(display_name=display_name, billing_profiles=billing_profiles) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'InvoiceSectionProperties') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceSection', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + 'Azure-AsyncOperation': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def create( + self, billing_account_name, display_name=None, billing_profiles=None, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to create a InvoiceSection. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param display_name: The name of the InvoiceSection. + :type display_name: str + :param billing_profiles: The billing profiles associated to the + billing account. + :type billing_profiles: + list[~azure.mgmt.billing.models.BillingProfile] + :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 InvoiceSection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.InvoiceSection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.InvoiceSection]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_initial( + billing_account_name=billing_account_name, + display_name=display_name, + billing_profiles=billing_profiles, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + 'Azure-AsyncOperation': 'str', + } + deserialized = self._deserialize('InvoiceSection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections'} + + def get( + self, billing_account_name, invoice_section_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the InvoiceSection by id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param expand: May be used to expand the billingProfiles. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: InvoiceSection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceSection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceSection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}'} + + + def _update_initial( + self, billing_account_name, invoice_section_name, display_name=None, billing_profiles=None, custom_headers=None, raw=False, **operation_config): + parameters = models.InvoiceSection(display_name=display_name, billing_profiles=billing_profiles) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'InvoiceSection') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceSection', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def update( + self, billing_account_name, invoice_section_name, display_name=None, billing_profiles=None, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to update a InvoiceSection. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param display_name: The name of the InvoiceSection. + :type display_name: str + :param billing_profiles: The billing profiles associated to the + billing account. + :type billing_profiles: + list[~azure.mgmt.billing.models.BillingProfile] + :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 InvoiceSection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.InvoiceSection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.InvoiceSection]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._update_initial( + billing_account_name=billing_account_name, + invoice_section_name=invoice_section_name, + display_name=display_name, + billing_profiles=billing_profiles, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + deserialized = self._deserialize('InvoiceSection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py new file mode 100644 index 000000000000..9e7f4efa1681 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py @@ -0,0 +1,105 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class InvoiceSectionsWithCreateSubscriptionPermissionOperations(object): + """InvoiceSectionsWithCreateSubscriptionPermissionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all invoiceSections with create subscription permission for a + user. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param expand: May be used to expand the billingProfiles. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: InvoiceSectionListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceSectionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceSectionListResult', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/listInvoiceSectionsWithCreateSubscriptionPermission'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_account_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_account_operations.py new file mode 100644 index 000000000000..ebe0c5541426 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_account_operations.py @@ -0,0 +1,100 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class InvoicesByBillingAccountOperations(object): + """InvoicesByBillingAccountOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, period_start_date, period_end_date, custom_headers=None, raw=False, **operation_config): + """List of invoices for a billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param period_start_date: Invoice period start date. + :type period_start_date: str + :param period_end_date: Invoice period end date. + :type period_end_date: 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: InvoiceListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['periodStartDate'] = self._serialize.query("period_start_date", period_start_date, 'str') + query_parameters['periodEndDate'] = self._serialize.query("period_end_date", period_end_date, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_profile_operations.py new file mode 100644 index 000000000000..6ab2dea8e87b --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_profile_operations.py @@ -0,0 +1,103 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class InvoicesByBillingProfileOperations(object): + """InvoicesByBillingProfileOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, billing_profile_name, period_start_date, period_end_date, custom_headers=None, raw=False, **operation_config): + """List of invoices for a billing profile. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param period_start_date: Invoice period start date. + :type period_start_date: str + :param period_end_date: Invoice period end date. + :type period_end_date: 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: InvoiceListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['periodStartDate'] = self._serialize.query("period_start_date", period_start_date, 'str') + query_parameters['periodEndDate'] = self._serialize.query("period_end_date", period_end_date, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py index 07621b06039f..09088dd24e9a 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-03-01-preview. Constant value: "2018-03-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-03-01-preview" + self.api_version = "2018-11-01-preview" self.config = config diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_by_billing_profile_operations.py new file mode 100644 index 000000000000..efdccfb7b5d7 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_by_billing_profile_operations.py @@ -0,0 +1,105 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class PaymentMethodsByBillingProfileOperations(object): + """PaymentMethodsByBillingProfileOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """Lists the Payment Methods by billing profile Id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: 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: An iterator like instance of PaymentMethod + :rtype: + ~azure.mgmt.billing.models.PaymentMethodPaged[~azure.mgmt.billing.models.PaymentMethod] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.PaymentMethodPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PaymentMethodPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/paymentMethods'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py new file mode 100644 index 000000000000..674f8c4ca445 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py @@ -0,0 +1,169 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class PolicyOperations(object): + """PolicyOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get_by_billing_profile( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """The policy for a given billingAccountName and billingProfileName. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: 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: Policy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.Policy or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Policy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default'} + + def update( + self, billing_account_name, billing_profile_name, reservation_purchases_allowed=None, marketplace_purchases_allowed=None, custom_headers=None, raw=False, **operation_config): + """The operation to update a policy. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param reservation_purchases_allowed: The reservationPurchasesAllowed + flag. + :type reservation_purchases_allowed: bool + :param marketplace_purchases_allowed: The marketplacePurchasesAllowed + flag. + :type marketplace_purchases_allowed: bool + :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: Policy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.Policy or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.Policy(reservation_purchases_allowed=reservation_purchases_allowed, marketplace_purchases_allowed=marketplace_purchases_allowed) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Policy') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Policy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_account_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_account_operations.py new file mode 100644 index 000000000000..e8501d24a68c --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_account_operations.py @@ -0,0 +1,109 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ProductsByBillingAccountOperations(object): + """ProductsByBillingAccountOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists products by billingAccountName. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param filter: May be used to filter by product type. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: 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: An iterator like instance of ProductSummary + :rtype: + ~azure.mgmt.billing.models.ProductSummaryPaged[~azure.mgmt.billing.models.ProductSummary] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ProductSummaryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ProductSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_subscriptions_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_subscriptions_operations.py new file mode 100644 index 000000000000..44caf3354c61 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_subscriptions_operations.py @@ -0,0 +1,102 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ProductsByBillingSubscriptionsOperations(object): + """ProductsByBillingSubscriptionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """Lists billing subscriptions by billingAccountName. + + :param billing_account_name: billing Account Id. + :type billing_account_name: 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: An iterator like instance of BillingSubscriptionSummary + :rtype: + ~azure.mgmt.billing.models.BillingSubscriptionSummaryPaged[~azure.mgmt.billing.models.BillingSubscriptionSummary] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.BillingSubscriptionSummaryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BillingSubscriptionSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_invoice_section_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_invoice_section_operations.py new file mode 100644 index 000000000000..8f9605d27e35 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_invoice_section_operations.py @@ -0,0 +1,104 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ProductsByInvoiceSectionOperations(object): + """ProductsByInvoiceSectionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, invoice_section_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists products by invoiceSectionName. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param filter: May be used to filter by product type. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: 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: ProductsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.ProductsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ProductsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py new file mode 100644 index 000000000000..5b1e91b354fd --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py @@ -0,0 +1,179 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ProductsOperations(object): + """ProductsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_name, invoice_section_name, product_name, custom_headers=None, raw=False, **operation_config): + """Get a single product by name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param product_name: Invoice Id. + :type product_name: 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: ProductSummary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.ProductSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'productName': self._serialize.url("product_name", product_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ProductSummary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}'} + + def transfer( + self, billing_account_name, invoice_section_name, product_name, destination_invoice_section_name=None, custom_headers=None, raw=False, **operation_config): + """The operation to transfer a Product to another InvoiceSection. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param product_name: Invoice Id. + :type product_name: str + :param destination_invoice_section_name: Destination invoice section + id. + :type destination_invoice_section_name: 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: ProductSummary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.ProductSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.TransferProductRequestProperties(destination_invoice_section_name=destination_invoice_section_name) + + # Construct URL + url = self.transfer.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'productName': self._serialize.url("product_name", product_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TransferProductRequestProperties') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ProductSummary', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + 'Azure-AsyncOperation': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}/transfer'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py similarity index 53% rename from azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py index e16ef92f5af0..04d1f8d4dd43 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py @@ -15,14 +15,13 @@ from .. import models -class InvoicesOperations(object): - """InvoicesOperations operations. +class RecipientTransfersOperations(object): + """RecipientTransfersOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-03-01-preview. Constant value: "2018-03-01-preview". """ models = models @@ -32,136 +31,99 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-03-01-preview" self.config = config - def list( - self, expand=None, filter=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the available invoices for a subscription in reverse - chronological order beginning with the most recent invoice. In preview, - invoices are available via this API only for invoice periods which end - December 1, 2016 or later. This is only supported for Azure Web-Direct - subscriptions. Other subscription types which were not purchased - directly through the Azure web portal are not supported through this - preview API. - - :param expand: May be used to expand the downloadUrl property within a - list of invoices. This enables download links to be generated for - multiple invoices at once. By default, downloadURLs are not included - when listing invoices. - :type expand: str - :param filter: May be used to filter invoices by invoicePeriodEndDate. - The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does - not currently support 'ne', 'or', or 'not'. - :type filter: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N invoices. - :type top: int + def accept( + self, transfer_name, product_details=None, custom_headers=None, raw=False, **operation_config): + """Accepts the transfer with given transfer Id. + + :param transfer_name: Transfer Name. + :type transfer_name: str + :param product_details: Request parameters to accept transfer. + :type product_details: list[~azure.mgmt.billing.models.ProductDetails] :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: An iterator like instance of Invoice - :rtype: - ~azure.mgmt.billing.models.InvoicePaged[~azure.mgmt.billing.models.Invoice] + :return: RecipientTransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.RecipientTransferDetails or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ - def internal_paging(next_link=None, raw=False): + body = models.AcceptTransferRequest(product_details=product_details) - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) + # Construct URL + url = self.accept.metadata['url'] + path_format_arguments = { + 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=100, minimum=1) + # Construct parameters + query_parameters = {} - else: - url = next_link - query_parameters = {} + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + # Construct body + body_content = self._serialize.body(body, 'AcceptTransferRequest') - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) - return response + deserialized = None - # Deserialize response - deserialized = models.InvoicePaged(internal_paging, self._deserialize.dependencies) + if response.status_code == 200: + deserialized = self._deserialize('RecipientTransferDetails', response) if raw: - header_dict = {} - client_raw_response = models.InvoicePaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/invoices'} + accept.metadata = {'url': '/providers/Microsoft.Billing/transfers/{transferName}/acceptTransfer'} - def get( - self, invoice_name, custom_headers=None, raw=False, **operation_config): - """Gets a named invoice resource. When getting a single invoice, the - downloadUrl property is expanded automatically. This is only supported - for Azure Web-Direct subscriptions. Other subscription types which were - not purchased directly through the Azure web portal are not supported - through this preview API. - - :param invoice_name: The name of an invoice resource. - :type invoice_name: str + def decline( + self, transfer_name, custom_headers=None, raw=False, **operation_config): + """Declines the transfer with given transfer Id. + + :param transfer_name: Transfer Name. + :type transfer_name: 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: Invoice or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.Invoice or + :return: RecipientTransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.RecipientTransferDetails or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.get.metadata['url'] + url = self.decline.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'invoiceName': self._serialize.url("invoice_name", invoice_name, 'str') + 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -174,7 +136,7 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -183,44 +145,41 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Invoice', response) + deserialized = self._deserialize('RecipientTransferDetails', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/invoices/{invoiceName}'} + decline.metadata = {'url': '/providers/Microsoft.Billing/transfers/{transferName}/declineTransfer'} - def get_latest( - self, custom_headers=None, raw=False, **operation_config): - """Gets the most recent invoice. When getting a single invoice, the - downloadUrl property is expanded automatically. This is only supported - for Azure Web-Direct subscriptions. Other subscription types which were - not purchased directly through the Azure web portal are not supported - through this preview API. + def get( + self, transfer_name, custom_headers=None, raw=False, **operation_config): + """Gets the transfer with given transfer Id. + :param transfer_name: Transfer Name. + :type transfer_name: 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: Invoice or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.Invoice or + :return: RecipientTransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.RecipientTransferDetails or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.get_latest.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -242,11 +201,69 @@ def get_latest( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Invoice', response) + deserialized = self._deserialize('RecipientTransferDetails', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_latest.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/invoices/latest'} + get.metadata = {'url': '/providers/Microsoft.Billing/transfers/{transferName}/'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the transfers received by caller. + + :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: An iterator like instance of RecipientTransferDetails + :rtype: + ~azure.mgmt.billing.models.RecipientTransferDetailsPaged[~azure.mgmt.billing.models.RecipientTransferDetails] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.RecipientTransferDetailsPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RecipientTransferDetailsPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/transfers'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_account_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_account_operations.py new file mode 100644 index 000000000000..815440c4613b --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_account_operations.py @@ -0,0 +1,116 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TransactionsByBillingAccountOperations(object): + """TransactionsByBillingAccountOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the transactions by billingAccountName for given start and end + date. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param start_date: Start date + :type start_date: str + :param end_date: End date + :type end_date: str + :param filter: May be used to filter by transaction kind. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: 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: An iterator like instance of TransactionsSummary + :rtype: + ~azure.mgmt.billing.models.TransactionsSummaryPaged[~azure.mgmt.billing.models.TransactionsSummary] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.TransactionsSummaryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TransactionsSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/transactions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py new file mode 100644 index 000000000000..7ab9cae9d90d --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py @@ -0,0 +1,297 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TransfersOperations(object): + """TransfersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def initiate( + self, billing_account_name, invoice_section_name, billing_profile_id=None, recipient_email_id=None, custom_headers=None, raw=False, **operation_config): + """Initiates the request to transfer the GTM or legacy subscriptions or + RIs to GTM. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_profile_id: Target Usage context for devTest + subscriptions. + :type billing_profile_id: str + :param recipient_email_id: Email Id of recipient for transfer. + :type recipient_email_id: 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: TransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + body = models.InitiateTransferRequest(billing_profile_id=billing_profile_id, recipient_email_id=recipient_email_id) + + # Construct URL + url = self.initiate.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'InitiateTransferRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransferDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + initiate.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/initiateTransfer'} + + def get( + self, billing_account_name, invoice_section_name, transfer_name, custom_headers=None, raw=False, **operation_config): + """Gets the transfer details for given transfer Id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param transfer_name: Transfer Name. + :type transfer_name: 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: TransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransferDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}'} + + def cancel( + self, billing_account_name, invoice_section_name, transfer_name, custom_headers=None, raw=False, **operation_config): + """Cancels the transfer for given transfer Id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param transfer_name: Transfer Name. + :type transfer_name: 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: TransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.cancel.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransferDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + cancel.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}'} + + def list( + self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Lists all transfer's details initiated from given invoice section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: 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: An iterator like instance of TransferDetails + :rtype: + ~azure.mgmt.billing.models.TransferDetailsPaged[~azure.mgmt.billing.models.TransferDetails] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.TransferDetailsPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TransferDetailsPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transfers'} From 9590e6c0facc83686a4dbe47520ea2ae7584556f Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 28 Mar 2019 10:27:00 -0700 Subject: [PATCH 04/15] Generated from e1da9df661804bbb0736e72bb5a8237afbd4e5e7 (#4687) fix: billing/resource-manager/Microsoft.Billing - prouct -> product - setion -> section --- .../azure/mgmt/billing/models/product_details.py | 4 ++-- .../azure/mgmt/billing/models/product_details_py3.py | 4 ++-- .../azure/mgmt/billing/models/transfer_details.py | 2 +- .../azure/mgmt/billing/models/transfer_details_py3.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/product_details.py b/azure-mgmt-billing/azure/mgmt/billing/models/product_details.py index b0e92125fc0c..5a2e7d3c3453 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/product_details.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/product_details.py @@ -15,8 +15,8 @@ class ProductDetails(Model): """Details of the product to be transferred. - :param product_type: Type of the prouct to be transferred. Possible values - include: 'AzureSubscription', 'AzureReservation' + :param product_type: Type of the product to be transferred. Possible + values include: 'AzureSubscription', 'AzureReservation' :type product_type: str or ~azure.mgmt.billing.models.ProductType :param product_id: Id of product to be transferred. :type product_id: str diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/product_details_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/product_details_py3.py index 1baa2e9789cc..c5810331f74a 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/product_details_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/product_details_py3.py @@ -15,8 +15,8 @@ class ProductDetails(Model): """Details of the product to be transferred. - :param product_type: Type of the prouct to be transferred. Possible values - include: 'AzureSubscription', 'AzureReservation' + :param product_type: Type of the product to be transferred. Possible + values include: 'AzureSubscription', 'AzureReservation' :type product_type: str or ~azure.mgmt.billing.models.ProductType :param product_id: Id of product to be transferred. :type product_id: str diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py index 602499a0a3de..9355b9f49ce2 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py @@ -22,7 +22,7 @@ class TransferDetails(Model): :vartype creation_time: datetime :ivar expiration_time: Transfer expiration time. :vartype expiration_time: datetime - :ivar invoice_section_id: Target invoice setion Id. + :ivar invoice_section_id: Target invoice section Id. :vartype invoice_section_id: str :ivar billing_account_id: Target billing account Id. :vartype billing_account_id: str diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py index 9b91427721cc..53670056ccf4 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py @@ -22,7 +22,7 @@ class TransferDetails(Model): :vartype creation_time: datetime :ivar expiration_time: Transfer expiration time. :vartype expiration_time: datetime - :ivar invoice_section_id: Target invoice setion Id. + :ivar invoice_section_id: Target invoice section Id. :vartype invoice_section_id: str :ivar billing_account_id: Target billing account Id. :vartype billing_account_id: str From cca5c5330830aba4dc4994fb32d764c9e9bf005f Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 28 Mar 2019 16:17:57 -0700 Subject: [PATCH 05/15] [AutoPR billing/resource-manager] [Hub Generated] Review request for Microsoft.Billing to add version 2018-11-01-preview (#4692) * Generated from 183a23ee5a1a57f35f6e43f1a69534565519ed09 Specify empty body for 204 response in example. * Generated from 1fd63f1771132318e6e7d5b4c518c6a2b4dea76d Build fix for Java SDK. * Generated from a2665e70760997b1ee3edcf60bdd3258f2ad16ec Remove $expand from billingProfiles/invoiceSections. * Generated from 59680b2eb7e58c2fd041043cd3d9f82523407c41 Example fix. * Generated from 90e03b4d5e0828cd03d06a49e2c854d026c26f0e Java build break. * Generated from 96952ae9cebdd2ac18a2b27d0a77f7145b9b945d Remove erroneous 202s. * Generated from 99c717c12fc07152a2ac37a9d4c27f1bc506abae Update operation ids. Opened bug MSAzure#4268142 to clean up operation ids across this swagger. * Generated from 500edc5f2eb47bc507a3b25a61d575530ba33675 InvoiceSection_ElevateToBillingProfile -> InvoiceSections_ElevateToBillingProfile. --- ...ions_by_billing_account_name_operations.py | 8 +- .../operations/invoice_sections_operations.py | 111 ++++++++++++++++++ ...eate_subscription_permission_operations.py | 8 +- 3 files changed, 113 insertions(+), 14 deletions(-) diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_name_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_name_operations.py index cf321426d2a5..3bf455e406f5 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_name_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_name_operations.py @@ -82,22 +82,16 @@ def list( request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 202]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) deserialized = None - header_dict = {} if response.status_code == 200: deserialized = self._deserialize('InvoiceSectionListResult', response) - header_dict = { - 'Location': 'str', - 'Retry-After': 'str', - } if raw: client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) return client_raw_response return deserialized diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py index 10b082a6bb5a..7d26df363c3b 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py @@ -152,6 +152,67 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections'} + def list_by_billing_profile_name( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """Lists all invoice sections under a billing profile for a user which he + has access to. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: 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: InvoiceSectionListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceSectionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_billing_profile_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceSectionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections'} + def get( self, billing_account_name, invoice_section_name, expand=None, custom_headers=None, raw=False, **operation_config): """Get the InvoiceSection by id. @@ -331,3 +392,53 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}'} + + def elevate_to_billing_profile( + self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Elevates the caller's access to match their billing profile access. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: 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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.elevate_to_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + elevate_to_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/elevate'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py index 9e7f4efa1681..8cc6ce0f8bb7 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py @@ -83,22 +83,16 @@ def list( request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 202]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) deserialized = None - header_dict = {} if response.status_code == 200: deserialized = self._deserialize('InvoiceSectionListResult', response) - header_dict = { - 'Location': 'str', - 'Retry-After': 'str', - } if raw: client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) return client_raw_response return deserialized From 86efd4620df85a01b3577ae772207dc3aaab0838 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 3 Apr 2019 10:49:48 -0700 Subject: [PATCH 06/15] Generated from ed5299b6ec825b140ef6df20a613e2f723df3069 (#4737) updating operationId for tansactions to Noun_verb as per feedback. --- .../mgmt/billing/billing_management_client.py | 84 ++----------- .../azure/mgmt/billing/operations/__init__.py | 4 + ...nsactions_by_billing_profile_operations.py | 111 ++++++++++++++++++ ...nsactions_by_invoice_section_operations.py | 111 ++++++++++++++++++ 4 files changed, 236 insertions(+), 74 deletions(-) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_profile_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_invoice_section_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index 88371287f0cd..f2f582b55603 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -42,6 +42,8 @@ from .operations.products_by_invoice_section_operations import ProductsByInvoiceSectionOperations from .operations.products_operations import ProductsOperations from .operations.transactions_by_billing_account_operations import TransactionsByBillingAccountOperations +from .operations.transactions_by_billing_profile_operations import TransactionsByBillingProfileOperations +from .operations.transactions_by_invoice_section_operations import TransactionsByInvoiceSectionOperations from .operations.policy_operations import PolicyOperations from .operations.billing_property_operations import BillingPropertyOperations from .operations.transfers_operations import TransfersOperations @@ -147,6 +149,10 @@ class BillingManagementClient(SDKClient): :vartype products: azure.mgmt.billing.operations.ProductsOperations :ivar transactions_by_billing_account: TransactionsByBillingAccount operations :vartype transactions_by_billing_account: azure.mgmt.billing.operations.TransactionsByBillingAccountOperations + :ivar transactions_by_billing_profile: TransactionsByBillingProfile operations + :vartype transactions_by_billing_profile: azure.mgmt.billing.operations.TransactionsByBillingProfileOperations + :ivar transactions_by_invoice_section: TransactionsByInvoiceSection operations + :vartype transactions_by_invoice_section: azure.mgmt.billing.operations.TransactionsByInvoiceSectionOperations :ivar policy: Policy operations :vartype policy: azure.mgmt.billing.operations.PolicyOperations :ivar billing_property: BillingProperty operations @@ -245,6 +251,10 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.transactions_by_billing_account = TransactionsByBillingAccountOperations( self._client, self.config, self._serialize, self._deserialize) + self.transactions_by_billing_profile = TransactionsByBillingProfileOperations( + self._client, self.config, self._serialize, self._deserialize) + self.transactions_by_invoice_section = TransactionsByInvoiceSectionOperations( + self._client, self.config, self._serialize, self._deserialize) self.policy = PolicyOperations( self._client, self.config, self._serialize, self._deserialize) self.billing_property = BillingPropertyOperations( @@ -274,80 +284,6 @@ def __init__( self.billing_profile_billing_role_assignment = BillingProfileBillingRoleAssignmentOperations( self._client, self.config, self._serialize, self._deserialize) - def transactions_by_billing_profile( - self, billing_account_name, billing_profile_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): - """Lists the transactions by billingProfileName for given start date and - end date. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param billing_profile_name: Billing Profile Id. - :type billing_profile_name: str - :param start_date: Start date - :type start_date: str - :param end_date: End date - :type end_date: str - :param filter: May be used to filter by transaction kind. The filter - supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - string where key and value is separated by a colon (:). - :type filter: 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: TransactionsListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.TransactionsListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.transactions_by_billing_profile.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') - query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('TransactionsListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - transactions_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/transactions'} - def update_auto_renew_for_billing_account( self, billing_account_name, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): """Cancel product by product id. diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index 8c73c7b45153..7745128644cc 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -34,6 +34,8 @@ from .products_by_invoice_section_operations import ProductsByInvoiceSectionOperations from .products_operations import ProductsOperations from .transactions_by_billing_account_operations import TransactionsByBillingAccountOperations +from .transactions_by_billing_profile_operations import TransactionsByBillingProfileOperations +from .transactions_by_invoice_section_operations import TransactionsByInvoiceSectionOperations from .policy_operations import PolicyOperations from .billing_property_operations import BillingPropertyOperations from .transfers_operations import TransfersOperations @@ -75,6 +77,8 @@ 'ProductsByInvoiceSectionOperations', 'ProductsOperations', 'TransactionsByBillingAccountOperations', + 'TransactionsByBillingProfileOperations', + 'TransactionsByInvoiceSectionOperations', 'PolicyOperations', 'BillingPropertyOperations', 'TransfersOperations', diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_profile_operations.py new file mode 100644 index 000000000000..7361a8c6a7cb --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_profile_operations.py @@ -0,0 +1,111 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TransactionsByBillingProfileOperations(object): + """TransactionsByBillingProfileOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, billing_profile_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the transactions by billingProfileName for given start date and + end date. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param start_date: Start date + :type start_date: str + :param end_date: End date + :type end_date: str + :param filter: May be used to filter by transaction kind. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: 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: TransactionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransactionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransactionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/transactions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_invoice_section_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_invoice_section_operations.py new file mode 100644 index 000000000000..7ecf28a61874 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_invoice_section_operations.py @@ -0,0 +1,111 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TransactionsByInvoiceSectionOperations(object): + """TransactionsByInvoiceSectionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, invoice_section_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the transactions by invoiceSectionName for given start date and + end date. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param start_date: Start date + :type start_date: str + :param end_date: End date + :type end_date: str + :param filter: May be used to filter by transaction kind. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: 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: TransactionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransactionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransactionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transactions'} From 4dd03b1bb4f42e1ff430b13782b455daf8c28a4b Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 3 Apr 2019 23:17:40 -0700 Subject: [PATCH 07/15] Generated from 2a236eb424b381bb392607c40a9ea40f0f7094f4 (#4775) Added specs for Agreements API in version 2018-11-01-preview Added specs for Agreements API in version 2018-11-01-preview --- .../mgmt/billing/billing_management_client.py | 5 + .../azure/mgmt/billing/models/__init__.py | 9 + .../azure/mgmt/billing/models/agreement.py | 66 +++++++ .../billing/models/agreement_list_result.py | 40 +++++ .../models/agreement_list_result_py3.py | 40 +++++ .../mgmt/billing/models/agreement_py3.py | 66 +++++++ .../azure/mgmt/billing/models/participants.py | 45 +++++ .../mgmt/billing/models/participants_py3.py | 45 +++++ .../azure/mgmt/billing/operations/__init__.py | 2 + .../operations/agreements_operations.py | 162 ++++++++++++++++++ 10 files changed, 480 insertions(+) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/agreement.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/agreement_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/participants.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/participants_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/agreements_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index f2f582b55603..bbca6c5568d3 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -58,6 +58,7 @@ from .operations.billing_account_billing_role_assignment_operations import BillingAccountBillingRoleAssignmentOperations from .operations.invoice_section_billing_role_assignment_operations import InvoiceSectionBillingRoleAssignmentOperations from .operations.billing_profile_billing_role_assignment_operations import BillingProfileBillingRoleAssignmentOperations +from .operations.agreements_operations import AgreementsOperations from . import models @@ -181,6 +182,8 @@ class BillingManagementClient(SDKClient): :vartype invoice_section_billing_role_assignment: azure.mgmt.billing.operations.InvoiceSectionBillingRoleAssignmentOperations :ivar billing_profile_billing_role_assignment: BillingProfileBillingRoleAssignment operations :vartype billing_profile_billing_role_assignment: azure.mgmt.billing.operations.BillingProfileBillingRoleAssignmentOperations + :ivar agreements: Agreements operations + :vartype agreements: azure.mgmt.billing.operations.AgreementsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -283,6 +286,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.billing_profile_billing_role_assignment = BillingProfileBillingRoleAssignmentOperations( self._client, self.config, self._serialize, self._deserialize) + self.agreements = AgreementsOperations( + self._client, self.config, self._serialize, self._deserialize) def update_auto_renew_for_billing_account( self, billing_account_name, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py index 1f3d0ce9efe6..df3bc8c9a5c1 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py @@ -68,6 +68,9 @@ from .billing_permissions_list_result_py3 import BillingPermissionsListResult from .billing_role_definition_py3 import BillingRoleDefinition from .billing_role_definition_list_result_py3 import BillingRoleDefinitionListResult + from .participants_py3 import Participants + from .agreement_py3 import Agreement + from .agreement_list_result_py3 import AgreementListResult except (SyntaxError, ImportError): from .initiate_transfer_request import InitiateTransferRequest from .product_details import ProductDetails @@ -127,6 +130,9 @@ from .billing_permissions_list_result import BillingPermissionsListResult from .billing_role_definition import BillingRoleDefinition from .billing_role_definition_list_result import BillingRoleDefinitionListResult + from .participants import Participants + from .agreement import Agreement + from .agreement_list_result import AgreementListResult from .payment_method_paged import PaymentMethodPaged from .billing_subscription_summary_paged import BillingSubscriptionSummaryPaged from .product_summary_paged import ProductSummaryPaged @@ -207,6 +213,9 @@ 'BillingPermissionsListResult', 'BillingRoleDefinition', 'BillingRoleDefinitionListResult', + 'Participants', + 'Agreement', + 'AgreementListResult', 'PaymentMethodPaged', 'BillingSubscriptionSummaryPaged', 'ProductSummaryPaged', diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/agreement.py b/azure-mgmt-billing/azure/mgmt/billing/models/agreement.py new file mode 100644 index 000000000000..a117306b8f54 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/agreement.py @@ -0,0 +1,66 @@ +# 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 .resource import Resource + + +class Agreement(Resource): + """An agreement resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar agreement_link: The link to the agreement. + :vartype agreement_link: str + :ivar effective_date: Effective date. + :vartype effective_date: datetime + :ivar expiration_date: Expiration date. + :vartype expiration_date: datetime + :param participants: Participants or signer of the agreement. + :type participants: list[~azure.mgmt.billing.models.Participants] + :ivar status: The agreement status + :vartype status: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'agreement_link': {'readonly': True}, + 'effective_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'agreement_link': {'key': 'properties.agreementLink', 'type': 'str'}, + 'effective_date': {'key': 'properties.effectiveDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'participants': {'key': 'properties.participants', 'type': '[Participants]'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Agreement, self).__init__(**kwargs) + self.agreement_link = None + self.effective_date = None + self.expiration_date = None + self.participants = kwargs.get('participants', None) + self.status = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result.py new file mode 100644 index 000000000000..a6f6c98716a6 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result.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 AgreementListResult(Model): + """Result of listing agreements. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of agreements. + :vartype value: list[~azure.mgmt.billing.models.Agreement] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Agreement]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AgreementListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result_py3.py new file mode 100644 index 000000000000..901473f2cb25 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result_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 AgreementListResult(Model): + """Result of listing agreements. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of agreements. + :vartype value: list[~azure.mgmt.billing.models.Agreement] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Agreement]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AgreementListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/agreement_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/agreement_py3.py new file mode 100644 index 000000000000..d8728de106f1 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/agreement_py3.py @@ -0,0 +1,66 @@ +# 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 .resource_py3 import Resource + + +class Agreement(Resource): + """An agreement resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar agreement_link: The link to the agreement. + :vartype agreement_link: str + :ivar effective_date: Effective date. + :vartype effective_date: datetime + :ivar expiration_date: Expiration date. + :vartype expiration_date: datetime + :param participants: Participants or signer of the agreement. + :type participants: list[~azure.mgmt.billing.models.Participants] + :ivar status: The agreement status + :vartype status: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'agreement_link': {'readonly': True}, + 'effective_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'agreement_link': {'key': 'properties.agreementLink', 'type': 'str'}, + 'effective_date': {'key': 'properties.effectiveDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'participants': {'key': 'properties.participants', 'type': '[Participants]'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, *, participants=None, **kwargs) -> None: + super(Agreement, self).__init__(**kwargs) + self.agreement_link = None + self.effective_date = None + self.expiration_date = None + self.participants = participants + self.status = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/participants.py b/azure-mgmt-billing/azure/mgmt/billing/models/participants.py new file mode 100644 index 000000000000..8377492ad1d6 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/participants.py @@ -0,0 +1,45 @@ +# 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 Participants(Model): + """Details about the participant or signer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The signing status + :vartype status: str + :ivar status_date: The date when status got changed. + :vartype status_date: datetime + :ivar email: The email address of the participant or signer. + :vartype email: str + """ + + _validation = { + 'status': {'readonly': True}, + 'status_date': {'readonly': True}, + 'email': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'status_date': {'key': 'statusDate', 'type': 'iso-8601'}, + 'email': {'key': 'email', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Participants, self).__init__(**kwargs) + self.status = None + self.status_date = None + self.email = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/participants_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/participants_py3.py new file mode 100644 index 000000000000..53a2573b44c6 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/participants_py3.py @@ -0,0 +1,45 @@ +# 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 Participants(Model): + """Details about the participant or signer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The signing status + :vartype status: str + :ivar status_date: The date when status got changed. + :vartype status_date: datetime + :ivar email: The email address of the participant or signer. + :vartype email: str + """ + + _validation = { + 'status': {'readonly': True}, + 'status_date': {'readonly': True}, + 'email': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'status_date': {'key': 'statusDate', 'type': 'iso-8601'}, + 'email': {'key': 'email', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Participants, self).__init__(**kwargs) + self.status = None + self.status_date = None + self.email = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index 7745128644cc..8955c7e83662 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -50,6 +50,7 @@ from .billing_account_billing_role_assignment_operations import BillingAccountBillingRoleAssignmentOperations from .invoice_section_billing_role_assignment_operations import InvoiceSectionBillingRoleAssignmentOperations from .billing_profile_billing_role_assignment_operations import BillingProfileBillingRoleAssignmentOperations +from .agreements_operations import AgreementsOperations __all__ = [ 'BillingAccountsOperations', @@ -93,4 +94,5 @@ 'BillingAccountBillingRoleAssignmentOperations', 'InvoiceSectionBillingRoleAssignmentOperations', 'BillingProfileBillingRoleAssignmentOperations', + 'AgreementsOperations', ] diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/agreements_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/agreements_operations.py new file mode 100644 index 000000000000..edab2766fb75 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/agreements_operations.py @@ -0,0 +1,162 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class AgreementsOperations(object): + """AgreementsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list_by_billing_account_name( + self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all agreements for a billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param expand: May be used to expand the participants. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AgreementListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.AgreementListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_billing_account_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AgreementListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements'} + + def get( + self, billing_account_name, agreement_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the agreement by name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param agreement_name: Agreement Id. + :type agreement_name: str + :param expand: May be used to expand the participants. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Agreement or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.Agreement or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'agreementName': self._serialize.url("agreement_name", agreement_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Agreement', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements/{agreementName}'} From 4ab870ef8f64f46f76f65e2cf02ad34e4aac073f Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 18 Apr 2019 11:59:50 -0700 Subject: [PATCH 08/15] [AutoPR billing/resource-manager] Corrected specs and examples for BillingRP (#4889) * Generated from 04c53044d143a2b8cb0a51e1059a7b5ae09d25f3 Corrected specs and examples for BillingRP Corrected specs and examples for BillingRP * Packaging update of azure-mgmt-billing * Generated from bbf0f75654a02f3b434dfde3e89733b8456e96e4 Fixed the errors Fixed the errors * Generated from 91060fe18f14b09cc2ef3b9b1563ef969acdc52d Fixing errors in spec Fixing errors in spec * Generated from a16aba34b67645c35d9ae5e7869d33ecfd275162 Updated examples Updated examples * Generated from bb7a4455944a72797de410f8405e10f6568e534d Incorporated review comments Incorporated review comments * Generated from 281784f0033ee8d853d17ce674e90278067a9812 Incorporated review comments --- .../mgmt/billing/billing_management_client.py | 5 - .../azure/mgmt/billing/models/__init__.py | 6 +- .../mgmt/billing/models/billing_account.py | 24 +++-- .../billing/models/billing_account_py3.py | 24 +++-- .../mgmt/billing/models/billing_profile.py | 8 +- .../billing/models/billing_profile_py3.py | 10 +- .../mgmt/billing/models/billing_property.py | 56 +++++++---- .../billing/models/billing_property_py3.py | 56 +++++++---- .../models/billing_subscription_summary.py | 18 ++-- .../billing_subscription_summary_py3.py | 18 ++-- .../billing/models/enabled_azure_sk_us.py | 9 +- .../billing/models/enabled_azure_sk_us_py3.py | 11 ++- .../mgmt/billing/models/invoice_summary.py | 12 +-- .../billing/models/invoice_summary_py3.py | 12 +-- .../mgmt/billing/models/payment_method.py | 9 +- .../mgmt/billing/models/payment_method_py3.py | 11 ++- .../azure/mgmt/billing/models/policy.py | 15 ++- .../azure/mgmt/billing/models/policy_py3.py | 17 ++-- .../billing/models/transactions_summary.py | 5 + .../models/transactions_summary_py3.py | 5 + .../transfer_billing_subscription_request.py | 9 +- ...billing_subscription_request_properties.py | 9 +- ...ing_subscription_request_properties_py3.py | 11 +-- ...ansfer_billing_subscription_request_py3.py | 11 +-- .../transfer_product_request_properties.py | 8 +- ...transfer_product_request_properties_py3.py | 10 +- .../azure/mgmt/billing/operations/__init__.py | 2 - ...e_invoice_section_permission_operations.py | 94 ------------------- .../billing_subscription_operations.py | 14 +-- ...criptions_by_billing_profile_operations.py | 2 +- .../billing/operations/policy_operations.py | 12 +-- .../billing/operations/products_operations.py | 9 +- azure-mgmt-billing/setup.py | 1 + 33 files changed, 254 insertions(+), 269 deletions(-) delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_with_create_invoice_section_permission_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index bbca6c5568d3..aafbc90ef229 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -18,7 +18,6 @@ from msrestazure.polling.arm_polling import ARMPolling import uuid from .operations.billing_accounts_operations import BillingAccountsOperations -from .operations.billing_accounts_with_create_invoice_section_permission_operations import BillingAccountsWithCreateInvoiceSectionPermissionOperations from .operations.available_balance_by_billing_profile_operations import AvailableBalanceByBillingProfileOperations from .operations.payment_methods_by_billing_profile_operations import PaymentMethodsByBillingProfileOperations from .operations.billing_profiles_by_billing_account_name_operations import BillingProfilesByBillingAccountNameOperations @@ -102,8 +101,6 @@ class BillingManagementClient(SDKClient): :ivar billing_accounts: BillingAccounts operations :vartype billing_accounts: azure.mgmt.billing.operations.BillingAccountsOperations - :ivar billing_accounts_with_create_invoice_section_permission: BillingAccountsWithCreateInvoiceSectionPermission operations - :vartype billing_accounts_with_create_invoice_section_permission: azure.mgmt.billing.operations.BillingAccountsWithCreateInvoiceSectionPermissionOperations :ivar available_balance_by_billing_profile: AvailableBalanceByBillingProfile operations :vartype available_balance_by_billing_profile: azure.mgmt.billing.operations.AvailableBalanceByBillingProfileOperations :ivar payment_methods_by_billing_profile: PaymentMethodsByBillingProfile operations @@ -206,8 +203,6 @@ def __init__( self.billing_accounts = BillingAccountsOperations( self._client, self.config, self._serialize, self._deserialize) - self.billing_accounts_with_create_invoice_section_permission = BillingAccountsWithCreateInvoiceSectionPermissionOperations( - self._client, self.config, self._serialize, self._deserialize) self.available_balance_by_billing_profile = AvailableBalanceByBillingProfileOperations( self._client, self.config, self._serialize, self._deserialize) self.payment_methods_by_billing_profile = PaymentMethodsByBillingProfileOperations( diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py index df3bc8c9a5c1..aaa96626717a 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py @@ -50,9 +50,9 @@ from .invoice_list_result_py3 import InvoiceListResult from .product_summary_py3 import ProductSummary from .products_list_result_py3 import ProductsListResult - from .enrollment_account_context_py3 import EnrollmentAccountContext from .billing_subscription_summary_py3 import BillingSubscriptionSummary from .billing_subscriptions_list_result_py3 import BillingSubscriptionsListResult + from .enrollment_account_context_py3 import EnrollmentAccountContext from .transactions_summary_py3 import TransactionsSummary from .transactions_list_result_py3 import TransactionsListResult from .policy_py3 import Policy @@ -112,9 +112,9 @@ from .invoice_list_result import InvoiceListResult from .product_summary import ProductSummary from .products_list_result import ProductsListResult - from .enrollment_account_context import EnrollmentAccountContext from .billing_subscription_summary import BillingSubscriptionSummary from .billing_subscriptions_list_result import BillingSubscriptionsListResult + from .enrollment_account_context import EnrollmentAccountContext from .transactions_summary import TransactionsSummary from .transactions_list_result import TransactionsListResult from .policy import Policy @@ -195,9 +195,9 @@ 'InvoiceListResult', 'ProductSummary', 'ProductsListResult', - 'EnrollmentAccountContext', 'BillingSubscriptionSummary', 'BillingSubscriptionsListResult', + 'EnrollmentAccountContext', 'TransactionsSummary', 'TransactionsListResult', 'Policy', diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py index 4769f51c9457..2f36b5ce3732 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py @@ -26,20 +26,22 @@ class BillingAccount(Resource): :vartype type: str :ivar display_name: The billing account name. :vartype display_name: str - :ivar company: The Company this billing account belongs to. - :vartype company: str :ivar account_type: The billing account Type. Possible values include: 'Organization', 'Enrollment' :vartype account_type: str or ~azure.mgmt.billing.models.enum :param address: The address associated with billing account. :type address: ~azure.mgmt.billing.models.Address - :ivar country: The country associated with billing account.. + :ivar company: Company Name. + :vartype company: str + :ivar country: Country Name. :vartype country: str :param invoice_sections: The invoice sections associated to the billing - account. + account. By default this is not populated, unless it's specified in + $expand. :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] :param billing_profiles: The billing profiles associated to the billing - account. + account. By default this is not populated, unless it's specified in + $expand. :type billing_profiles: list[~azure.mgmt.billing.models.BillingProfile] :ivar enrollment_details: The details about the associated legacy enrollment. By default this is not populated, unless it's specified in @@ -50,6 +52,9 @@ class BillingAccount(Resource): :param enrollment_accounts: The accounts associated to the enrollment. :type enrollment_accounts: list[~azure.mgmt.billing.models.EnrollmentAccount] + :ivar has_read_access: Specifies whether the user has read access on + billing account. + :vartype has_read_access: bool """ _validation = { @@ -57,10 +62,11 @@ class BillingAccount(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'display_name': {'readonly': True}, - 'company': {'readonly': True}, 'account_type': {'readonly': True}, + 'company': {'readonly': True}, 'country': {'readonly': True}, 'enrollment_details': {'readonly': True}, + 'has_read_access': {'readonly': True}, } _attribute_map = { @@ -68,26 +74,28 @@ class BillingAccount(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'company': {'key': 'properties.company', 'type': 'str'}, 'account_type': {'key': 'properties.accountType', 'type': 'str'}, 'address': {'key': 'properties.address', 'type': 'Address'}, + 'company': {'key': 'properties.company', 'type': 'str'}, 'country': {'key': 'properties.country', 'type': 'str'}, 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, 'enrollment_details': {'key': 'properties.enrollmentDetails', 'type': 'Enrollment'}, 'departments': {'key': 'properties.departments', 'type': '[Department]'}, 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, + 'has_read_access': {'key': 'properties.hasReadAccess', 'type': 'bool'}, } def __init__(self, **kwargs): super(BillingAccount, self).__init__(**kwargs) self.display_name = None - self.company = None self.account_type = None self.address = kwargs.get('address', None) + self.company = None self.country = None self.invoice_sections = kwargs.get('invoice_sections', None) self.billing_profiles = kwargs.get('billing_profiles', None) self.enrollment_details = None self.departments = kwargs.get('departments', None) self.enrollment_accounts = kwargs.get('enrollment_accounts', None) + self.has_read_access = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py index 06f2f04535b0..5ecccfed7272 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py @@ -26,20 +26,22 @@ class BillingAccount(Resource): :vartype type: str :ivar display_name: The billing account name. :vartype display_name: str - :ivar company: The Company this billing account belongs to. - :vartype company: str :ivar account_type: The billing account Type. Possible values include: 'Organization', 'Enrollment' :vartype account_type: str or ~azure.mgmt.billing.models.enum :param address: The address associated with billing account. :type address: ~azure.mgmt.billing.models.Address - :ivar country: The country associated with billing account.. + :ivar company: Company Name. + :vartype company: str + :ivar country: Country Name. :vartype country: str :param invoice_sections: The invoice sections associated to the billing - account. + account. By default this is not populated, unless it's specified in + $expand. :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] :param billing_profiles: The billing profiles associated to the billing - account. + account. By default this is not populated, unless it's specified in + $expand. :type billing_profiles: list[~azure.mgmt.billing.models.BillingProfile] :ivar enrollment_details: The details about the associated legacy enrollment. By default this is not populated, unless it's specified in @@ -50,6 +52,9 @@ class BillingAccount(Resource): :param enrollment_accounts: The accounts associated to the enrollment. :type enrollment_accounts: list[~azure.mgmt.billing.models.EnrollmentAccount] + :ivar has_read_access: Specifies whether the user has read access on + billing account. + :vartype has_read_access: bool """ _validation = { @@ -57,10 +62,11 @@ class BillingAccount(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'display_name': {'readonly': True}, - 'company': {'readonly': True}, 'account_type': {'readonly': True}, + 'company': {'readonly': True}, 'country': {'readonly': True}, 'enrollment_details': {'readonly': True}, + 'has_read_access': {'readonly': True}, } _attribute_map = { @@ -68,26 +74,28 @@ class BillingAccount(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'company': {'key': 'properties.company', 'type': 'str'}, 'account_type': {'key': 'properties.accountType', 'type': 'str'}, 'address': {'key': 'properties.address', 'type': 'Address'}, + 'company': {'key': 'properties.company', 'type': 'str'}, 'country': {'key': 'properties.country', 'type': 'str'}, 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, 'enrollment_details': {'key': 'properties.enrollmentDetails', 'type': 'Enrollment'}, 'departments': {'key': 'properties.departments', 'type': '[Department]'}, 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, + 'has_read_access': {'key': 'properties.hasReadAccess', 'type': 'bool'}, } def __init__(self, *, address=None, invoice_sections=None, billing_profiles=None, departments=None, enrollment_accounts=None, **kwargs) -> None: super(BillingAccount, self).__init__(**kwargs) self.display_name = None - self.company = None self.account_type = None self.address = address + self.company = None self.country = None self.invoice_sections = invoice_sections self.billing_profiles = billing_profiles self.enrollment_details = None self.departments = departments self.enrollment_accounts = enrollment_accounts + self.has_read_access = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py index 9fbb2d68a214..daf0f24078cc 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py @@ -28,8 +28,8 @@ class BillingProfile(Resource): :type display_name: str :param po_number: Purchase order number. :type po_number: str - :param billing_address: Billing address. - :type billing_address: ~azure.mgmt.billing.models.Address + :param address: Billing address. + :type address: ~azure.mgmt.billing.models.Address :ivar invoice_email_opt_in: If the billing profile is opted in to receive invoices via email. :vartype invoice_email_opt_in: bool @@ -63,7 +63,7 @@ class BillingProfile(Resource): 'type': {'key': 'type', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'po_number': {'key': 'properties.poNumber', 'type': 'str'}, - 'billing_address': {'key': 'properties.billingAddress', 'type': 'Address'}, + 'address': {'key': 'properties.address', 'type': 'Address'}, 'invoice_email_opt_in': {'key': 'properties.invoiceEmailOptIn', 'type': 'bool'}, 'is_classic': {'key': 'properties.isClassic', 'type': 'bool'}, 'invoice_day': {'key': 'properties.invoiceDay', 'type': 'int'}, @@ -76,7 +76,7 @@ def __init__(self, **kwargs): super(BillingProfile, self).__init__(**kwargs) self.display_name = kwargs.get('display_name', None) self.po_number = kwargs.get('po_number', None) - self.billing_address = kwargs.get('billing_address', None) + self.address = kwargs.get('address', None) self.invoice_email_opt_in = None self.is_classic = None self.invoice_day = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py index d7113faf83f3..4e1feba37af7 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py @@ -28,8 +28,8 @@ class BillingProfile(Resource): :type display_name: str :param po_number: Purchase order number. :type po_number: str - :param billing_address: Billing address. - :type billing_address: ~azure.mgmt.billing.models.Address + :param address: Billing address. + :type address: ~azure.mgmt.billing.models.Address :ivar invoice_email_opt_in: If the billing profile is opted in to receive invoices via email. :vartype invoice_email_opt_in: bool @@ -63,7 +63,7 @@ class BillingProfile(Resource): 'type': {'key': 'type', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'po_number': {'key': 'properties.poNumber', 'type': 'str'}, - 'billing_address': {'key': 'properties.billingAddress', 'type': 'Address'}, + 'address': {'key': 'properties.address', 'type': 'Address'}, 'invoice_email_opt_in': {'key': 'properties.invoiceEmailOptIn', 'type': 'bool'}, 'is_classic': {'key': 'properties.isClassic', 'type': 'bool'}, 'invoice_day': {'key': 'properties.invoiceDay', 'type': 'int'}, @@ -72,11 +72,11 @@ class BillingProfile(Resource): 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, } - def __init__(self, *, display_name: str=None, po_number: str=None, billing_address=None, enabled_azure_sk_us=None, invoice_sections=None, **kwargs) -> None: + def __init__(self, *, display_name: str=None, po_number: str=None, address=None, enabled_azure_sk_us=None, invoice_sections=None, **kwargs) -> None: super(BillingProfile, self).__init__(**kwargs) self.display_name = display_name self.po_number = po_number - self.billing_address = billing_address + self.address = address self.invoice_email_opt_in = None self.is_classic = None self.invoice_day = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py index 03e1f2c5c142..bb89970c45a4 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py @@ -9,17 +9,21 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from .resource import Resource -class BillingProperty(Model): - """The billing property. +class BillingProperty(Resource): + """A billing property resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar product_id: Product Id. - :vartype product_id: str + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str :ivar billing_tenant_id: Billing tenant Id. :vartype billing_tenant_id: str :ivar billing_account_id: Billing account Id. @@ -30,10 +34,16 @@ class BillingProperty(Model): :vartype billing_profile_id: str :ivar billing_profile_name: Billing profile name. :vartype billing_profile_name: str + :ivar cost_center: Cost center name. + :vartype cost_center: str :ivar invoice_section_id: Invoice Section Id. :vartype invoice_section_id: str :ivar invoice_section_name: Invoice Section name. :vartype invoice_section_name: str + :ivar product_id: Product Id. + :vartype product_id: str + :ivar product_name: Product name. + :vartype product_name: str :ivar sku_id: SKU Id. :vartype sku_id: str :ivar sku_description: SKU description. @@ -41,40 +51,52 @@ class BillingProperty(Model): """ _validation = { - 'product_id': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'billing_tenant_id': {'readonly': True}, 'billing_account_id': {'readonly': True}, 'billing_account_name': {'readonly': True}, 'billing_profile_id': {'readonly': True}, 'billing_profile_name': {'readonly': True}, + 'cost_center': {'readonly': True}, 'invoice_section_id': {'readonly': True}, 'invoice_section_name': {'readonly': True}, + 'product_id': {'readonly': True}, + 'product_name': {'readonly': True}, 'sku_id': {'readonly': True}, 'sku_description': {'readonly': True}, } _attribute_map = { - 'product_id': {'key': 'productId', 'type': 'str'}, - 'billing_tenant_id': {'key': 'billingTenantId', 'type': 'str'}, - 'billing_account_id': {'key': 'billingAccountId', 'type': 'str'}, - 'billing_account_name': {'key': 'billingAccountName', 'type': 'str'}, - 'billing_profile_id': {'key': 'billingProfileId', 'type': 'str'}, - 'billing_profile_name': {'key': 'billingProfileName', 'type': 'str'}, - 'invoice_section_id': {'key': 'invoiceSectionId', 'type': 'str'}, - 'invoice_section_name': {'key': 'invoiceSectionName', 'type': 'str'}, - 'sku_id': {'key': 'skuId', 'type': 'str'}, - 'sku_description': {'key': 'skuDescription', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'billing_tenant_id': {'key': 'properties.billingTenantId', 'type': 'str'}, + 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, + 'billing_account_name': {'key': 'properties.billingAccountName', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'product_id': {'key': 'properties.productId', 'type': 'str'}, + 'product_name': {'key': 'properties.productName', 'type': 'str'}, + 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, } def __init__(self, **kwargs): super(BillingProperty, self).__init__(**kwargs) - self.product_id = None self.billing_tenant_id = None self.billing_account_id = None self.billing_account_name = None self.billing_profile_id = None self.billing_profile_name = None + self.cost_center = None self.invoice_section_id = None self.invoice_section_name = None + self.product_id = None + self.product_name = None self.sku_id = None self.sku_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py index 0334fde90ca7..ab5bcfe3a8ca 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py @@ -9,17 +9,21 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from .resource_py3 import Resource -class BillingProperty(Model): - """The billing property. +class BillingProperty(Resource): + """A billing property resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar product_id: Product Id. - :vartype product_id: str + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str :ivar billing_tenant_id: Billing tenant Id. :vartype billing_tenant_id: str :ivar billing_account_id: Billing account Id. @@ -30,10 +34,16 @@ class BillingProperty(Model): :vartype billing_profile_id: str :ivar billing_profile_name: Billing profile name. :vartype billing_profile_name: str + :ivar cost_center: Cost center name. + :vartype cost_center: str :ivar invoice_section_id: Invoice Section Id. :vartype invoice_section_id: str :ivar invoice_section_name: Invoice Section name. :vartype invoice_section_name: str + :ivar product_id: Product Id. + :vartype product_id: str + :ivar product_name: Product name. + :vartype product_name: str :ivar sku_id: SKU Id. :vartype sku_id: str :ivar sku_description: SKU description. @@ -41,40 +51,52 @@ class BillingProperty(Model): """ _validation = { - 'product_id': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'billing_tenant_id': {'readonly': True}, 'billing_account_id': {'readonly': True}, 'billing_account_name': {'readonly': True}, 'billing_profile_id': {'readonly': True}, 'billing_profile_name': {'readonly': True}, + 'cost_center': {'readonly': True}, 'invoice_section_id': {'readonly': True}, 'invoice_section_name': {'readonly': True}, + 'product_id': {'readonly': True}, + 'product_name': {'readonly': True}, 'sku_id': {'readonly': True}, 'sku_description': {'readonly': True}, } _attribute_map = { - 'product_id': {'key': 'productId', 'type': 'str'}, - 'billing_tenant_id': {'key': 'billingTenantId', 'type': 'str'}, - 'billing_account_id': {'key': 'billingAccountId', 'type': 'str'}, - 'billing_account_name': {'key': 'billingAccountName', 'type': 'str'}, - 'billing_profile_id': {'key': 'billingProfileId', 'type': 'str'}, - 'billing_profile_name': {'key': 'billingProfileName', 'type': 'str'}, - 'invoice_section_id': {'key': 'invoiceSectionId', 'type': 'str'}, - 'invoice_section_name': {'key': 'invoiceSectionName', 'type': 'str'}, - 'sku_id': {'key': 'skuId', 'type': 'str'}, - 'sku_description': {'key': 'skuDescription', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'billing_tenant_id': {'key': 'properties.billingTenantId', 'type': 'str'}, + 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, + 'billing_account_name': {'key': 'properties.billingAccountName', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'product_id': {'key': 'properties.productId', 'type': 'str'}, + 'product_name': {'key': 'properties.productName', 'type': 'str'}, + 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, } def __init__(self, **kwargs) -> None: super(BillingProperty, self).__init__(**kwargs) - self.product_id = None self.billing_tenant_id = None self.billing_account_id = None self.billing_account_name = None self.billing_profile_id = None self.billing_profile_name = None + self.cost_center = None self.invoice_section_id = None self.invoice_section_name = None + self.product_id = None + self.product_name = None self.sku_id = None self.sku_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py index 3aaab43349f8..2bc957b75bd3 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py @@ -36,15 +36,18 @@ class BillingSubscriptionSummary(Resource): :vartype last_month_charges: ~azure.mgmt.billing.models.Amount :ivar month_to_date_charges: Month to date charges. :vartype month_to_date_charges: ~azure.mgmt.billing.models.Amount - :ivar enrollment_account_context: The enrollment account context. - :vartype enrollment_account_context: - ~azure.mgmt.billing.models.EnrollmentAccountContext :ivar billing_profile_id: Billing Profile id to which this product belongs. :vartype billing_profile_id: str :ivar billing_profile_name: Billing Profile name to which this product belongs. :vartype billing_profile_name: str + :ivar invoice_section_id: Invoice section id to which this product + belongs. + :vartype invoice_section_id: str + :ivar invoice_section_name: Invoice section name to which this product + belongs. + :vartype invoice_section_name: str :param sku_id: The sku id. :type sku_id: str :ivar sku_description: The sku description. @@ -59,9 +62,10 @@ class BillingSubscriptionSummary(Resource): 'subscription_id': {'readonly': True}, 'last_month_charges': {'readonly': True}, 'month_to_date_charges': {'readonly': True}, - 'enrollment_account_context': {'readonly': True}, 'billing_profile_id': {'readonly': True}, 'billing_profile_name': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, 'sku_description': {'readonly': True}, } @@ -74,9 +78,10 @@ class BillingSubscriptionSummary(Resource): 'subscription_billing_status': {'key': 'properties.subscriptionBillingStatus', 'type': 'str'}, 'last_month_charges': {'key': 'properties.lastMonthCharges', 'type': 'Amount'}, 'month_to_date_charges': {'key': 'properties.monthToDateCharges', 'type': 'Amount'}, - 'enrollment_account_context': {'key': 'properties.enrollmentAccountContext', 'type': 'EnrollmentAccountContext'}, 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, } @@ -88,8 +93,9 @@ def __init__(self, **kwargs): self.subscription_billing_status = kwargs.get('subscription_billing_status', None) self.last_month_charges = None self.month_to_date_charges = None - self.enrollment_account_context = None self.billing_profile_id = None self.billing_profile_name = None + self.invoice_section_id = None + self.invoice_section_name = None self.sku_id = kwargs.get('sku_id', None) self.sku_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py index 38234f197df2..be61f23b614f 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py @@ -36,15 +36,18 @@ class BillingSubscriptionSummary(Resource): :vartype last_month_charges: ~azure.mgmt.billing.models.Amount :ivar month_to_date_charges: Month to date charges. :vartype month_to_date_charges: ~azure.mgmt.billing.models.Amount - :ivar enrollment_account_context: The enrollment account context. - :vartype enrollment_account_context: - ~azure.mgmt.billing.models.EnrollmentAccountContext :ivar billing_profile_id: Billing Profile id to which this product belongs. :vartype billing_profile_id: str :ivar billing_profile_name: Billing Profile name to which this product belongs. :vartype billing_profile_name: str + :ivar invoice_section_id: Invoice section id to which this product + belongs. + :vartype invoice_section_id: str + :ivar invoice_section_name: Invoice section name to which this product + belongs. + :vartype invoice_section_name: str :param sku_id: The sku id. :type sku_id: str :ivar sku_description: The sku description. @@ -59,9 +62,10 @@ class BillingSubscriptionSummary(Resource): 'subscription_id': {'readonly': True}, 'last_month_charges': {'readonly': True}, 'month_to_date_charges': {'readonly': True}, - 'enrollment_account_context': {'readonly': True}, 'billing_profile_id': {'readonly': True}, 'billing_profile_name': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, 'sku_description': {'readonly': True}, } @@ -74,9 +78,10 @@ class BillingSubscriptionSummary(Resource): 'subscription_billing_status': {'key': 'properties.subscriptionBillingStatus', 'type': 'str'}, 'last_month_charges': {'key': 'properties.lastMonthCharges', 'type': 'Amount'}, 'month_to_date_charges': {'key': 'properties.monthToDateCharges', 'type': 'Amount'}, - 'enrollment_account_context': {'key': 'properties.enrollmentAccountContext', 'type': 'EnrollmentAccountContext'}, 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, } @@ -88,8 +93,9 @@ def __init__(self, *, subscription_billing_status=None, sku_id: str=None, **kwar self.subscription_billing_status = subscription_billing_status self.last_month_charges = None self.month_to_date_charges = None - self.enrollment_account_context = None self.billing_profile_id = None self.billing_profile_name = None + self.invoice_section_id = None + self.invoice_section_name = None self.sku_id = sku_id self.sku_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py b/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py index 234bc54178a6..5eea898a7ca5 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py @@ -13,18 +13,19 @@ class EnabledAzureSKUs(Model): - """Details about the product. + """Details about the enabled azure sku. Variables are only populated by the server, and will be ignored when sending a request. - :param sku_id: The sku id. - :type sku_id: str + :ivar sku_id: The sku id. + :vartype sku_id: str :ivar sku_description: The sku description. :vartype sku_description: str """ _validation = { + 'sku_id': {'readonly': True}, 'sku_description': {'readonly': True}, } @@ -35,5 +36,5 @@ class EnabledAzureSKUs(Model): def __init__(self, **kwargs): super(EnabledAzureSKUs, self).__init__(**kwargs) - self.sku_id = kwargs.get('sku_id', None) + self.sku_id = None self.sku_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py index 9fca814fe284..bd031bd7176a 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py @@ -13,18 +13,19 @@ class EnabledAzureSKUs(Model): - """Details about the product. + """Details about the enabled azure sku. Variables are only populated by the server, and will be ignored when sending a request. - :param sku_id: The sku id. - :type sku_id: str + :ivar sku_id: The sku id. + :vartype sku_id: str :ivar sku_description: The sku description. :vartype sku_description: str """ _validation = { + 'sku_id': {'readonly': True}, 'sku_description': {'readonly': True}, } @@ -33,7 +34,7 @@ class EnabledAzureSKUs(Model): 'sku_description': {'key': 'skuDescription', 'type': 'str'}, } - def __init__(self, *, sku_id: str=None, **kwargs) -> None: + def __init__(self, **kwargs) -> None: super(EnabledAzureSKUs, self).__init__(**kwargs) - self.sku_id = sku_id + self.sku_id = None self.sku_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py index 3698b45764ea..ad984d6e6f83 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py @@ -39,9 +39,9 @@ class InvoiceSummary(Resource): :vartype invoice_period_start_date: datetime :ivar invoice_period_end_date: The end date of the billing period. :vartype invoice_period_end_date: datetime - :ivar billing_profile: The profile id which invoice belongs to. - :vartype billing_profile: str - :ivar billing_profile_name: The profile name which invoice belongs to. + :ivar billing_profile_id: The billing profile id this invoice belongs to. + :vartype billing_profile_id: str + :ivar billing_profile_name: The profile name this invoice belongs to. :vartype billing_profile_name: str :ivar purchase_order_number: The purchase identifier for the invoice. :vartype purchase_order_number: str @@ -64,7 +64,7 @@ class InvoiceSummary(Resource): 'billed_amount': {'readonly': True}, 'invoice_period_start_date': {'readonly': True}, 'invoice_period_end_date': {'readonly': True}, - 'billing_profile': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, 'billing_profile_name': {'readonly': True}, 'purchase_order_number': {'readonly': True}, 'document_urls': {'readonly': True}, @@ -82,7 +82,7 @@ class InvoiceSummary(Resource): 'billed_amount': {'key': 'properties.billedAmount', 'type': 'Amount'}, 'invoice_period_start_date': {'key': 'properties.invoicePeriodStartDate', 'type': 'iso-8601'}, 'invoice_period_end_date': {'key': 'properties.invoicePeriodEndDate', 'type': 'iso-8601'}, - 'billing_profile': {'key': 'properties.billingProfile', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, 'purchase_order_number': {'key': 'properties.purchaseOrderNumber', 'type': 'str'}, 'document_urls': {'key': 'properties.documentUrls', 'type': '[DownloadProperties]'}, @@ -98,7 +98,7 @@ def __init__(self, **kwargs): self.billed_amount = None self.invoice_period_start_date = None self.invoice_period_end_date = None - self.billing_profile = None + self.billing_profile_id = None self.billing_profile_name = None self.purchase_order_number = None self.document_urls = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py index 0d2a6b98f978..2c49b9a389fa 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py @@ -39,9 +39,9 @@ class InvoiceSummary(Resource): :vartype invoice_period_start_date: datetime :ivar invoice_period_end_date: The end date of the billing period. :vartype invoice_period_end_date: datetime - :ivar billing_profile: The profile id which invoice belongs to. - :vartype billing_profile: str - :ivar billing_profile_name: The profile name which invoice belongs to. + :ivar billing_profile_id: The billing profile id this invoice belongs to. + :vartype billing_profile_id: str + :ivar billing_profile_name: The profile name this invoice belongs to. :vartype billing_profile_name: str :ivar purchase_order_number: The purchase identifier for the invoice. :vartype purchase_order_number: str @@ -64,7 +64,7 @@ class InvoiceSummary(Resource): 'billed_amount': {'readonly': True}, 'invoice_period_start_date': {'readonly': True}, 'invoice_period_end_date': {'readonly': True}, - 'billing_profile': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, 'billing_profile_name': {'readonly': True}, 'purchase_order_number': {'readonly': True}, 'document_urls': {'readonly': True}, @@ -82,7 +82,7 @@ class InvoiceSummary(Resource): 'billed_amount': {'key': 'properties.billedAmount', 'type': 'Amount'}, 'invoice_period_start_date': {'key': 'properties.invoicePeriodStartDate', 'type': 'iso-8601'}, 'invoice_period_end_date': {'key': 'properties.invoicePeriodEndDate', 'type': 'iso-8601'}, - 'billing_profile': {'key': 'properties.billingProfile', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, 'purchase_order_number': {'key': 'properties.purchaseOrderNumber', 'type': 'str'}, 'document_urls': {'key': 'properties.documentUrls', 'type': '[DownloadProperties]'}, @@ -98,7 +98,7 @@ def __init__(self, **kwargs) -> None: self.billed_amount = None self.invoice_period_start_date = None self.invoice_period_end_date = None - self.billing_profile = None + self.billing_profile_id = None self.billing_profile_name = None self.purchase_order_number = None self.document_urls = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py b/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py index a9cd09cf9799..b2551b8f4fa2 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py @@ -24,9 +24,10 @@ class PaymentMethod(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param method_type: Payment method type. Possible values include: + :param payment_method_type: Payment method type. Possible values include: 'Credits', 'ChequeWire' - :type method_type: str or ~azure.mgmt.billing.models.PaymentMethodType + :type payment_method_type: str or + ~azure.mgmt.billing.models.PaymentMethodType :ivar details: Details about the payment method. :vartype details: str :ivar expiration: Expiration date. @@ -48,7 +49,7 @@ class PaymentMethod(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'method_type': {'key': 'properties.methodType', 'type': 'str'}, + 'payment_method_type': {'key': 'properties.paymentMethodType', 'type': 'str'}, 'details': {'key': 'properties.details', 'type': 'str'}, 'expiration': {'key': 'properties.expiration', 'type': 'iso-8601'}, 'currency': {'key': 'properties.currency', 'type': 'str'}, @@ -56,7 +57,7 @@ class PaymentMethod(Resource): def __init__(self, **kwargs): super(PaymentMethod, self).__init__(**kwargs) - self.method_type = kwargs.get('method_type', None) + self.payment_method_type = kwargs.get('payment_method_type', None) self.details = None self.expiration = None self.currency = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py index 6a2e1b485c99..1c4ad14cd61a 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py @@ -24,9 +24,10 @@ class PaymentMethod(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param method_type: Payment method type. Possible values include: + :param payment_method_type: Payment method type. Possible values include: 'Credits', 'ChequeWire' - :type method_type: str or ~azure.mgmt.billing.models.PaymentMethodType + :type payment_method_type: str or + ~azure.mgmt.billing.models.PaymentMethodType :ivar details: Details about the payment method. :vartype details: str :ivar expiration: Expiration date. @@ -48,15 +49,15 @@ class PaymentMethod(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'method_type': {'key': 'properties.methodType', 'type': 'str'}, + 'payment_method_type': {'key': 'properties.paymentMethodType', 'type': 'str'}, 'details': {'key': 'properties.details', 'type': 'str'}, 'expiration': {'key': 'properties.expiration', 'type': 'iso-8601'}, 'currency': {'key': 'properties.currency', 'type': 'str'}, } - def __init__(self, *, method_type=None, **kwargs) -> None: + def __init__(self, *, payment_method_type=None, **kwargs) -> None: super(PaymentMethod, self).__init__(**kwargs) - self.method_type = method_type + self.payment_method_type = payment_method_type self.details = None self.expiration = None self.currency = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/policy.py b/azure-mgmt-billing/azure/mgmt/billing/models/policy.py index 3f4d47ed064d..a153f1d3aa8c 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/policy.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/policy.py @@ -24,12 +24,15 @@ class Policy(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param reservation_purchases_allowed: The reservationPurchasesAllowed - flag. - :type reservation_purchases_allowed: bool :param marketplace_purchases_allowed: The marketplacePurchasesAllowed flag. :type marketplace_purchases_allowed: bool + :param reservation_purchases_allowed: The reservationPurchasesAllowed + flag. + :type reservation_purchases_allowed: bool + :param subscription_owner_can_view_charges: The + subscriptionOwnerCanViewCharges flag. + :type subscription_owner_can_view_charges: bool """ _validation = { @@ -42,11 +45,13 @@ class Policy(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'reservation_purchases_allowed': {'key': 'properties.reservationPurchasesAllowed', 'type': 'bool'}, 'marketplace_purchases_allowed': {'key': 'properties.marketplacePurchasesAllowed', 'type': 'bool'}, + 'reservation_purchases_allowed': {'key': 'properties.reservationPurchasesAllowed', 'type': 'bool'}, + 'subscription_owner_can_view_charges': {'key': 'properties.subscriptionOwnerCanViewCharges', 'type': 'bool'}, } def __init__(self, **kwargs): super(Policy, self).__init__(**kwargs) - self.reservation_purchases_allowed = kwargs.get('reservation_purchases_allowed', None) self.marketplace_purchases_allowed = kwargs.get('marketplace_purchases_allowed', None) + self.reservation_purchases_allowed = kwargs.get('reservation_purchases_allowed', None) + self.subscription_owner_can_view_charges = kwargs.get('subscription_owner_can_view_charges', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py index aef3034f2654..6fcb7d8b1561 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py @@ -24,12 +24,15 @@ class Policy(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param reservation_purchases_allowed: The reservationPurchasesAllowed - flag. - :type reservation_purchases_allowed: bool :param marketplace_purchases_allowed: The marketplacePurchasesAllowed flag. :type marketplace_purchases_allowed: bool + :param reservation_purchases_allowed: The reservationPurchasesAllowed + flag. + :type reservation_purchases_allowed: bool + :param subscription_owner_can_view_charges: The + subscriptionOwnerCanViewCharges flag. + :type subscription_owner_can_view_charges: bool """ _validation = { @@ -42,11 +45,13 @@ class Policy(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'reservation_purchases_allowed': {'key': 'properties.reservationPurchasesAllowed', 'type': 'bool'}, 'marketplace_purchases_allowed': {'key': 'properties.marketplacePurchasesAllowed', 'type': 'bool'}, + 'reservation_purchases_allowed': {'key': 'properties.reservationPurchasesAllowed', 'type': 'bool'}, + 'subscription_owner_can_view_charges': {'key': 'properties.subscriptionOwnerCanViewCharges', 'type': 'bool'}, } - def __init__(self, *, reservation_purchases_allowed: bool=None, marketplace_purchases_allowed: bool=None, **kwargs) -> None: + def __init__(self, *, marketplace_purchases_allowed: bool=None, reservation_purchases_allowed: bool=None, subscription_owner_can_view_charges: bool=None, **kwargs) -> None: super(Policy, self).__init__(**kwargs) - self.reservation_purchases_allowed = reservation_purchases_allowed self.marketplace_purchases_allowed = marketplace_purchases_allowed + self.reservation_purchases_allowed = reservation_purchases_allowed + self.subscription_owner_can_view_charges = subscription_owner_can_view_charges diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py index 9dd286bb63bb..b614b9deb73d 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py @@ -35,6 +35,8 @@ class TransactionsSummary(Resource): :vartype order_id: str :ivar order_name: The reservation order name. :vartype order_name: str + :ivar product_family: The product family. + :vartype product_family: str :ivar product_type_id: The product type id. :vartype product_type_id: str :ivar product_type: The type of product. @@ -74,6 +76,7 @@ class TransactionsSummary(Resource): 'invoice': {'readonly': True}, 'order_id': {'readonly': True}, 'order_name': {'readonly': True}, + 'product_family': {'readonly': True}, 'product_type_id': {'readonly': True}, 'product_type': {'readonly': True}, 'product_description': {'readonly': True}, @@ -96,6 +99,7 @@ class TransactionsSummary(Resource): 'invoice': {'key': 'properties.invoice', 'type': 'str'}, 'order_id': {'key': 'properties.orderId', 'type': 'str'}, 'order_name': {'key': 'properties.orderName', 'type': 'str'}, + 'product_family': {'key': 'properties.productFamily', 'type': 'str'}, 'product_type_id': {'key': 'properties.productTypeId', 'type': 'str'}, 'product_type': {'key': 'properties.productType', 'type': 'str'}, 'product_description': {'key': 'properties.productDescription', 'type': 'str'}, @@ -117,6 +121,7 @@ def __init__(self, **kwargs): self.invoice = None self.order_id = None self.order_name = None + self.product_family = None self.product_type_id = None self.product_type = None self.product_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py index 7d51ec8bec74..8e438dbdf077 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py @@ -35,6 +35,8 @@ class TransactionsSummary(Resource): :vartype order_id: str :ivar order_name: The reservation order name. :vartype order_name: str + :ivar product_family: The product family. + :vartype product_family: str :ivar product_type_id: The product type id. :vartype product_type_id: str :ivar product_type: The type of product. @@ -74,6 +76,7 @@ class TransactionsSummary(Resource): 'invoice': {'readonly': True}, 'order_id': {'readonly': True}, 'order_name': {'readonly': True}, + 'product_family': {'readonly': True}, 'product_type_id': {'readonly': True}, 'product_type': {'readonly': True}, 'product_description': {'readonly': True}, @@ -96,6 +99,7 @@ class TransactionsSummary(Resource): 'invoice': {'key': 'properties.invoice', 'type': 'str'}, 'order_id': {'key': 'properties.orderId', 'type': 'str'}, 'order_name': {'key': 'properties.orderName', 'type': 'str'}, + 'product_family': {'key': 'properties.productFamily', 'type': 'str'}, 'product_type_id': {'key': 'properties.productTypeId', 'type': 'str'}, 'product_type': {'key': 'properties.productType', 'type': 'str'}, 'product_description': {'key': 'properties.productDescription', 'type': 'str'}, @@ -117,6 +121,7 @@ def __init__(self, *, kind=None, transaction_type=None, **kwargs) -> None: self.invoice = None self.order_id = None self.order_name = None + self.product_family = None self.product_type_id = None self.product_type = None self.product_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py index 6af50002d8cc..db0e4281ef8c 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py @@ -15,15 +15,14 @@ class TransferBillingSubscriptionRequest(Model): """Request parameters to transfer billing subscription. - :param destination_invoice_section_name: The destination - invoiceSectionName. - :type destination_invoice_section_name: str + :param destination_invoice_section_id: The destination invoice section id. + :type destination_invoice_section_id: str """ _attribute_map = { - 'destination_invoice_section_name': {'key': 'properties.destinationInvoiceSectionName', 'type': 'str'}, + 'destination_invoice_section_id': {'key': 'properties.destinationInvoiceSectionId', 'type': 'str'}, } def __init__(self, **kwargs): super(TransferBillingSubscriptionRequest, self).__init__(**kwargs) - self.destination_invoice_section_name = kwargs.get('destination_invoice_section_name', None) + self.destination_invoice_section_id = kwargs.get('destination_invoice_section_id', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py index 32e96f842cdf..0f9174df2be3 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py @@ -15,15 +15,14 @@ class TransferBillingSubscriptionRequestProperties(Model): """Request parameters to transfer billing subscription. - :param destination_invoice_section_name: The destination - invoiceSectionName. - :type destination_invoice_section_name: str + :param destination_invoice_section_id: The destination invoice section id. + :type destination_invoice_section_id: str """ _attribute_map = { - 'destination_invoice_section_name': {'key': 'destinationInvoiceSectionName', 'type': 'str'}, + 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, } def __init__(self, **kwargs): super(TransferBillingSubscriptionRequestProperties, self).__init__(**kwargs) - self.destination_invoice_section_name = kwargs.get('destination_invoice_section_name', None) + self.destination_invoice_section_id = kwargs.get('destination_invoice_section_id', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py index 95d748e6b66d..ceb12cf89262 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py @@ -15,15 +15,14 @@ class TransferBillingSubscriptionRequestProperties(Model): """Request parameters to transfer billing subscription. - :param destination_invoice_section_name: The destination - invoiceSectionName. - :type destination_invoice_section_name: str + :param destination_invoice_section_id: The destination invoice section id. + :type destination_invoice_section_id: str """ _attribute_map = { - 'destination_invoice_section_name': {'key': 'destinationInvoiceSectionName', 'type': 'str'}, + 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, } - def __init__(self, *, destination_invoice_section_name: str=None, **kwargs) -> None: + def __init__(self, *, destination_invoice_section_id: str=None, **kwargs) -> None: super(TransferBillingSubscriptionRequestProperties, self).__init__(**kwargs) - self.destination_invoice_section_name = destination_invoice_section_name + self.destination_invoice_section_id = destination_invoice_section_id diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py index 6d12cbdb86c7..707b9e89ef01 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py @@ -15,15 +15,14 @@ class TransferBillingSubscriptionRequest(Model): """Request parameters to transfer billing subscription. - :param destination_invoice_section_name: The destination - invoiceSectionName. - :type destination_invoice_section_name: str + :param destination_invoice_section_id: The destination invoice section id. + :type destination_invoice_section_id: str """ _attribute_map = { - 'destination_invoice_section_name': {'key': 'properties.destinationInvoiceSectionName', 'type': 'str'}, + 'destination_invoice_section_id': {'key': 'properties.destinationInvoiceSectionId', 'type': 'str'}, } - def __init__(self, *, destination_invoice_section_name: str=None, **kwargs) -> None: + def __init__(self, *, destination_invoice_section_id: str=None, **kwargs) -> None: super(TransferBillingSubscriptionRequest, self).__init__(**kwargs) - self.destination_invoice_section_name = destination_invoice_section_name + self.destination_invoice_section_id = destination_invoice_section_id diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py index 47ca8b229e97..9feaa795f8f8 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py @@ -15,14 +15,14 @@ class TransferProductRequestProperties(Model): """The properties of the product to initiate a transfer. - :param destination_invoice_section_name: Destination invoice section id. - :type destination_invoice_section_name: str + :param destination_invoice_section_id: Destination invoice section id. + :type destination_invoice_section_id: str """ _attribute_map = { - 'destination_invoice_section_name': {'key': 'destinationInvoiceSectionName', 'type': 'str'}, + 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, } def __init__(self, **kwargs): super(TransferProductRequestProperties, self).__init__(**kwargs) - self.destination_invoice_section_name = kwargs.get('destination_invoice_section_name', None) + self.destination_invoice_section_id = kwargs.get('destination_invoice_section_id', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py index 715e24e5b95b..029af2856f0e 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py @@ -15,14 +15,14 @@ class TransferProductRequestProperties(Model): """The properties of the product to initiate a transfer. - :param destination_invoice_section_name: Destination invoice section id. - :type destination_invoice_section_name: str + :param destination_invoice_section_id: Destination invoice section id. + :type destination_invoice_section_id: str """ _attribute_map = { - 'destination_invoice_section_name': {'key': 'destinationInvoiceSectionName', 'type': 'str'}, + 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, } - def __init__(self, *, destination_invoice_section_name: str=None, **kwargs) -> None: + def __init__(self, *, destination_invoice_section_id: str=None, **kwargs) -> None: super(TransferProductRequestProperties, self).__init__(**kwargs) - self.destination_invoice_section_name = destination_invoice_section_name + self.destination_invoice_section_id = destination_invoice_section_id diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index 8955c7e83662..03590866e10e 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -10,7 +10,6 @@ # -------------------------------------------------------------------------- from .billing_accounts_operations import BillingAccountsOperations -from .billing_accounts_with_create_invoice_section_permission_operations import BillingAccountsWithCreateInvoiceSectionPermissionOperations from .available_balance_by_billing_profile_operations import AvailableBalanceByBillingProfileOperations from .payment_methods_by_billing_profile_operations import PaymentMethodsByBillingProfileOperations from .billing_profiles_by_billing_account_name_operations import BillingProfilesByBillingAccountNameOperations @@ -54,7 +53,6 @@ __all__ = [ 'BillingAccountsOperations', - 'BillingAccountsWithCreateInvoiceSectionPermissionOperations', 'AvailableBalanceByBillingProfileOperations', 'PaymentMethodsByBillingProfileOperations', 'BillingProfilesByBillingAccountNameOperations', diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_with_create_invoice_section_permission_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_with_create_invoice_section_permission_operations.py deleted file mode 100644 index fe37879251b8..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_with_create_invoice_section_permission_operations.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class BillingAccountsWithCreateInvoiceSectionPermissionOperations(object): - """BillingAccountsWithCreateInvoiceSectionPermissionOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, expand=None, custom_headers=None, raw=False, **operation_config): - """Lists all billing accounts with create invoiceSection permission for a - user. - - :param expand: May be used to expand the invoiceSections and - billingProfiles. - :type expand: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: BillingAccountListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingAccountListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('BillingAccountListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/listBillingAccountsWithCreateInvoiceSectionPermission'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py index 2da5d990012d..c33dae9080a6 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py @@ -103,8 +103,8 @@ def get( def _transfer_initial( - self, billing_account_name, invoice_section_name, billing_subscription_name, destination_invoice_section_name=None, custom_headers=None, raw=False, **operation_config): - parameters = models.TransferBillingSubscriptionRequestProperties(destination_invoice_section_name=destination_invoice_section_name) + self, billing_account_name, invoice_section_name, billing_subscription_name, destination_invoice_section_id=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TransferBillingSubscriptionRequestProperties(destination_invoice_section_id=destination_invoice_section_id) # Construct URL url = self.transfer.metadata['url'] @@ -158,7 +158,7 @@ def _transfer_initial( return deserialized def transfer( - self, billing_account_name, invoice_section_name, billing_subscription_name, destination_invoice_section_name=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, billing_account_name, invoice_section_name, billing_subscription_name, destination_invoice_section_id=None, custom_headers=None, raw=False, polling=True, **operation_config): """Transfers the GTM subscription from one invoice section to another within a billing account. @@ -168,9 +168,9 @@ def transfer( :type invoice_section_name: str :param billing_subscription_name: Billing Subscription Id. :type billing_subscription_name: str - :param destination_invoice_section_name: The destination - invoiceSectionName. - :type destination_invoice_section_name: str + :param destination_invoice_section_id: The destination invoice section + id. + :type destination_invoice_section_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 @@ -190,7 +190,7 @@ def transfer( billing_account_name=billing_account_name, invoice_section_name=invoice_section_name, billing_subscription_name=billing_subscription_name, - destination_invoice_section_name=destination_invoice_section_name, + destination_invoice_section_id=destination_invoice_section_id, custom_headers=custom_headers, raw=True, **operation_config diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py index 788ce0e94f88..36803e3ca700 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py @@ -95,4 +95,4 @@ def list( return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfile/{billingProfileName}/billingSubscriptions'} + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingSubscriptions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py index 674f8c4ca445..65e34a53f0d1 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py @@ -97,19 +97,15 @@ def get_by_billing_profile( get_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default'} def update( - self, billing_account_name, billing_profile_name, reservation_purchases_allowed=None, marketplace_purchases_allowed=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, parameters, custom_headers=None, raw=False, **operation_config): """The operation to update a policy. :param billing_account_name: billing Account Id. :type billing_account_name: str :param billing_profile_name: Billing Profile Id. :type billing_profile_name: str - :param reservation_purchases_allowed: The reservationPurchasesAllowed - flag. - :type reservation_purchases_allowed: bool - :param marketplace_purchases_allowed: The marketplacePurchasesAllowed - flag. - :type marketplace_purchases_allowed: bool + :param parameters: Parameters supplied to the update policy operation. + :type parameters: ~azure.mgmt.billing.models.Policy :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -121,8 +117,6 @@ def update( :raises: :class:`ErrorResponseException` """ - parameters = models.Policy(reservation_purchases_allowed=reservation_purchases_allowed, marketplace_purchases_allowed=marketplace_purchases_allowed) - # Construct URL url = self.update.metadata['url'] path_format_arguments = { diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py index 5b1e91b354fd..2fa6497a7f1c 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py @@ -100,7 +100,7 @@ def get( get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}'} def transfer( - self, billing_account_name, invoice_section_name, product_name, destination_invoice_section_name=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, invoice_section_name, product_name, destination_invoice_section_id=None, custom_headers=None, raw=False, **operation_config): """The operation to transfer a Product to another InvoiceSection. :param billing_account_name: billing Account Id. @@ -109,9 +109,8 @@ def transfer( :type invoice_section_name: str :param product_name: Invoice Id. :type product_name: str - :param destination_invoice_section_name: Destination invoice section - id. - :type destination_invoice_section_name: str + :param destination_invoice_section_id: Destination invoice section id. + :type destination_invoice_section_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -123,7 +122,7 @@ def transfer( :raises: :class:`ErrorResponseException` """ - parameters = models.TransferProductRequestProperties(destination_invoice_section_name=destination_invoice_section_name) + parameters = models.TransferProductRequestProperties(destination_invoice_section_id=destination_invoice_section_id) # Construct URL url = self.transfer.metadata['url'] diff --git a/azure-mgmt-billing/setup.py b/azure-mgmt-billing/setup.py index b2aa12bf873f..946b7232e50d 100644 --- a/azure-mgmt-billing/setup.py +++ b/azure-mgmt-billing/setup.py @@ -53,6 +53,7 @@ version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', license='MIT License', author='Microsoft Corporation', author_email='azpysdkhelp@microsoft.com', From d1137ff0219e7d6ec01247d927ca27145ca4d944 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 23 Apr 2019 14:53:19 -0700 Subject: [PATCH 09/15] [AutoPR billing/resource-manager] Updated the operation id for Billing spec (#4927) * Generated from f7a7ff95dbfab2af60f50d78a6c516f2c9f529af Merge remote-tracking branch 'upstream/master' * Generated from 86c8bcfa38eb98457c66057f99b62b79b5cf9c96 Fixed the errors Fixed the errors * Generated from 9fb11a5fab1eae53424e0fa9f5c6b0b1da825b90 Incorporated review comments Incorporated review comments --- .../mgmt/billing/billing_management_client.py | 327 +------- .../azure/mgmt/billing/models/__init__.py | 6 +- .../models/billing_permissions_list_result.py | 5 +- .../billing_permissions_list_result_py3.py | 5 +- ...s.py => billing_permissions_properties.py} | 4 +- ... => billing_permissions_properties_py3.py} | 4 +- .../billing/models/billing_role_definition.py | 5 +- .../models/billing_role_definition_py3.py | 5 +- .../azure/mgmt/billing/operations/__init__.py | 80 +- ...ns.py => available_balances_operations.py} | 10 +- ..._account_billing_permissions_operations.py | 94 --- ...ount_billing_role_definition_operations.py | 155 ---- ...s.py => billing_permissions_operations.py} | 103 ++- ..._profile_billing_permissions_operations.py | 97 --- ...file_billing_role_definition_operations.py | 161 ---- ...iles_by_billing_account_name_operations.py | 98 --- .../operations/billing_profiles_operations.py | 61 ++ .../billing_role_assignments_operations.py | 787 ++++++++++++++++++ ...=> billing_role_definitions_operations.py} | 222 +++-- .../billing_subscription_operations.py | 221 ----- ...criptions_by_billing_profile_operations.py | 98 --- ...criptions_by_invoice_section_operations.py | 98 --- ...py => billing_subscriptions_operations.py} | 251 ++++-- ...ents_by_billing_account_name_operations.py | 105 --- .../operations/departments_operations.py | 68 ++ ...unts_by_billing_account_name_operations.py | 105 --- .../enrollment_accounts_operations.py | 74 +- .../billing/operations/invoice_operations.py | 100 --- ...sections_billing_permissions_operations.py | 97 --- ...ions_by_billing_account_name_operations.py | 98 --- .../operations/invoice_sections_operations.py | 123 +++ ...eate_subscription_permission_operations.py | 99 --- .../invoices_by_billing_account_operations.py | 100 --- .../invoices_by_billing_profile_operations.py | 103 --- ...t_operations.py => invoices_operations.py} | 150 ++-- ...tions.py => payment_methods_operations.py} | 10 +- ...y_operations.py => policies_operations.py} | 12 +- ...perations.py => price_sheet_operations.py} | 6 +- .../products_by_billing_account_operations.py | 109 --- ...cts_by_billing_subscriptions_operations.py | 102 --- .../products_by_invoice_section_operations.py | 104 --- .../billing/operations/products_operations.py | 284 ++++++- ...nsactions_by_billing_account_operations.py | 116 --- ...nsactions_by_billing_profile_operations.py | 111 --- ...nsactions_by_invoice_section_operations.py | 111 --- .../operations/transactions_operations.py | 264 ++++++ .../operations/transfers_operations.py | 3 +- 47 files changed, 2235 insertions(+), 3116 deletions(-) rename azure-mgmt-billing/azure/mgmt/billing/models/{billing_permissions.py => billing_permissions_properties.py} (91%) rename azure-mgmt-billing/azure/mgmt/billing/models/{billing_permissions_py3.py => billing_permissions_properties_py3.py} (92%) rename azure-mgmt-billing/azure/mgmt/billing/operations/{available_balance_by_billing_profile_operations.py => available_balances_operations.py} (91%) delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_permissions_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_definition_operations.py rename azure-mgmt-billing/azure/mgmt/billing/operations/{invoice_section_billing_role_definition_operations.py => billing_permissions_operations.py} (56%) delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_permissions_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_definition_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_by_billing_account_name_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py rename azure-mgmt-billing/azure/mgmt/billing/operations/{billing_profile_billing_role_assignment_operations.py => billing_role_definitions_operations.py} (50%) delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_invoice_section_operations.py rename azure-mgmt-billing/azure/mgmt/billing/operations/{invoice_section_billing_role_assignment_operations.py => billing_subscriptions_operations.py} (53%) delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/departments_by_billing_account_name_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_by_billing_account_name_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_billing_permissions_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_name_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_account_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_profile_operations.py rename azure-mgmt-billing/azure/mgmt/billing/operations/{billing_account_billing_role_assignment_operations.py => invoices_operations.py} (57%) rename azure-mgmt-billing/azure/mgmt/billing/operations/{payment_methods_by_billing_profile_operations.py => payment_methods_operations.py} (91%) rename azure-mgmt-billing/azure/mgmt/billing/operations/{policy_operations.py => policies_operations.py} (94%) rename azure-mgmt-billing/azure/mgmt/billing/operations/{invoice_pricesheet_operations.py => price_sheet_operations.py} (97%) delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_account_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_subscriptions_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/products_by_invoice_section_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_account_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_profile_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_invoice_section_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index aafbc90ef229..a49bf0441ae7 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -13,50 +13,26 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION -from msrest.pipeline import ClientRawResponse -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling -import uuid from .operations.billing_accounts_operations import BillingAccountsOperations -from .operations.available_balance_by_billing_profile_operations import AvailableBalanceByBillingProfileOperations -from .operations.payment_methods_by_billing_profile_operations import PaymentMethodsByBillingProfileOperations -from .operations.billing_profiles_by_billing_account_name_operations import BillingProfilesByBillingAccountNameOperations +from .operations.available_balances_operations import AvailableBalancesOperations +from .operations.payment_methods_operations import PaymentMethodsOperations from .operations.billing_profiles_operations import BillingProfilesOperations -from .operations.invoice_sections_by_billing_account_name_operations import InvoiceSectionsByBillingAccountNameOperations from .operations.invoice_sections_operations import InvoiceSectionsOperations -from .operations.invoice_sections_with_create_subscription_permission_operations import InvoiceSectionsWithCreateSubscriptionPermissionOperations -from .operations.departments_by_billing_account_name_operations import DepartmentsByBillingAccountNameOperations from .operations.departments_operations import DepartmentsOperations -from .operations.enrollment_accounts_by_billing_account_name_operations import EnrollmentAccountsByBillingAccountNameOperations from .operations.enrollment_accounts_operations import EnrollmentAccountsOperations -from .operations.invoices_by_billing_account_operations import InvoicesByBillingAccountOperations -from .operations.invoice_pricesheet_operations import InvoicePricesheetOperations -from .operations.invoices_by_billing_profile_operations import InvoicesByBillingProfileOperations -from .operations.invoice_operations import InvoiceOperations -from .operations.products_by_billing_subscriptions_operations import ProductsByBillingSubscriptionsOperations -from .operations.billing_subscriptions_by_billing_profile_operations import BillingSubscriptionsByBillingProfileOperations -from .operations.billing_subscriptions_by_invoice_section_operations import BillingSubscriptionsByInvoiceSectionOperations -from .operations.billing_subscription_operations import BillingSubscriptionOperations -from .operations.products_by_billing_account_operations import ProductsByBillingAccountOperations -from .operations.products_by_invoice_section_operations import ProductsByInvoiceSectionOperations +from .operations.invoices_operations import InvoicesOperations +from .operations.price_sheet_operations import PriceSheetOperations +from .operations.billing_subscriptions_operations import BillingSubscriptionsOperations from .operations.products_operations import ProductsOperations -from .operations.transactions_by_billing_account_operations import TransactionsByBillingAccountOperations -from .operations.transactions_by_billing_profile_operations import TransactionsByBillingProfileOperations -from .operations.transactions_by_invoice_section_operations import TransactionsByInvoiceSectionOperations -from .operations.policy_operations import PolicyOperations +from .operations.transactions_operations import TransactionsOperations +from .operations.policies_operations import PoliciesOperations from .operations.billing_property_operations import BillingPropertyOperations from .operations.transfers_operations import TransfersOperations from .operations.recipient_transfers_operations import RecipientTransfersOperations from .operations.operations import Operations -from .operations.billing_account_billing_permissions_operations import BillingAccountBillingPermissionsOperations -from .operations.invoice_sections_billing_permissions_operations import InvoiceSectionsBillingPermissionsOperations -from .operations.billing_profile_billing_permissions_operations import BillingProfileBillingPermissionsOperations -from .operations.billing_account_billing_role_definition_operations import BillingAccountBillingRoleDefinitionOperations -from .operations.invoice_section_billing_role_definition_operations import InvoiceSectionBillingRoleDefinitionOperations -from .operations.billing_profile_billing_role_definition_operations import BillingProfileBillingRoleDefinitionOperations -from .operations.billing_account_billing_role_assignment_operations import BillingAccountBillingRoleAssignmentOperations -from .operations.invoice_section_billing_role_assignment_operations import InvoiceSectionBillingRoleAssignmentOperations -from .operations.billing_profile_billing_role_assignment_operations import BillingProfileBillingRoleAssignmentOperations +from .operations.billing_permissions_operations import BillingPermissionsOperations +from .operations.billing_role_definitions_operations import BillingRoleDefinitionsOperations +from .operations.billing_role_assignments_operations import BillingRoleAssignmentsOperations from .operations.agreements_operations import AgreementsOperations from . import models @@ -101,58 +77,30 @@ class BillingManagementClient(SDKClient): :ivar billing_accounts: BillingAccounts operations :vartype billing_accounts: azure.mgmt.billing.operations.BillingAccountsOperations - :ivar available_balance_by_billing_profile: AvailableBalanceByBillingProfile operations - :vartype available_balance_by_billing_profile: azure.mgmt.billing.operations.AvailableBalanceByBillingProfileOperations - :ivar payment_methods_by_billing_profile: PaymentMethodsByBillingProfile operations - :vartype payment_methods_by_billing_profile: azure.mgmt.billing.operations.PaymentMethodsByBillingProfileOperations - :ivar billing_profiles_by_billing_account_name: BillingProfilesByBillingAccountName operations - :vartype billing_profiles_by_billing_account_name: azure.mgmt.billing.operations.BillingProfilesByBillingAccountNameOperations + :ivar available_balances: AvailableBalances operations + :vartype available_balances: azure.mgmt.billing.operations.AvailableBalancesOperations + :ivar payment_methods: PaymentMethods operations + :vartype payment_methods: azure.mgmt.billing.operations.PaymentMethodsOperations :ivar billing_profiles: BillingProfiles operations :vartype billing_profiles: azure.mgmt.billing.operations.BillingProfilesOperations - :ivar invoice_sections_by_billing_account_name: InvoiceSectionsByBillingAccountName operations - :vartype invoice_sections_by_billing_account_name: azure.mgmt.billing.operations.InvoiceSectionsByBillingAccountNameOperations :ivar invoice_sections: InvoiceSections operations :vartype invoice_sections: azure.mgmt.billing.operations.InvoiceSectionsOperations - :ivar invoice_sections_with_create_subscription_permission: InvoiceSectionsWithCreateSubscriptionPermission operations - :vartype invoice_sections_with_create_subscription_permission: azure.mgmt.billing.operations.InvoiceSectionsWithCreateSubscriptionPermissionOperations - :ivar departments_by_billing_account_name: DepartmentsByBillingAccountName operations - :vartype departments_by_billing_account_name: azure.mgmt.billing.operations.DepartmentsByBillingAccountNameOperations :ivar departments: Departments operations :vartype departments: azure.mgmt.billing.operations.DepartmentsOperations - :ivar enrollment_accounts_by_billing_account_name: EnrollmentAccountsByBillingAccountName operations - :vartype enrollment_accounts_by_billing_account_name: azure.mgmt.billing.operations.EnrollmentAccountsByBillingAccountNameOperations :ivar enrollment_accounts: EnrollmentAccounts operations :vartype enrollment_accounts: azure.mgmt.billing.operations.EnrollmentAccountsOperations - :ivar invoices_by_billing_account: InvoicesByBillingAccount operations - :vartype invoices_by_billing_account: azure.mgmt.billing.operations.InvoicesByBillingAccountOperations - :ivar invoice_pricesheet: InvoicePricesheet operations - :vartype invoice_pricesheet: azure.mgmt.billing.operations.InvoicePricesheetOperations - :ivar invoices_by_billing_profile: InvoicesByBillingProfile operations - :vartype invoices_by_billing_profile: azure.mgmt.billing.operations.InvoicesByBillingProfileOperations - :ivar invoice: Invoice operations - :vartype invoice: azure.mgmt.billing.operations.InvoiceOperations - :ivar products_by_billing_subscriptions: ProductsByBillingSubscriptions operations - :vartype products_by_billing_subscriptions: azure.mgmt.billing.operations.ProductsByBillingSubscriptionsOperations - :ivar billing_subscriptions_by_billing_profile: BillingSubscriptionsByBillingProfile operations - :vartype billing_subscriptions_by_billing_profile: azure.mgmt.billing.operations.BillingSubscriptionsByBillingProfileOperations - :ivar billing_subscriptions_by_invoice_section: BillingSubscriptionsByInvoiceSection operations - :vartype billing_subscriptions_by_invoice_section: azure.mgmt.billing.operations.BillingSubscriptionsByInvoiceSectionOperations - :ivar billing_subscription: BillingSubscription operations - :vartype billing_subscription: azure.mgmt.billing.operations.BillingSubscriptionOperations - :ivar products_by_billing_account: ProductsByBillingAccount operations - :vartype products_by_billing_account: azure.mgmt.billing.operations.ProductsByBillingAccountOperations - :ivar products_by_invoice_section: ProductsByInvoiceSection operations - :vartype products_by_invoice_section: azure.mgmt.billing.operations.ProductsByInvoiceSectionOperations + :ivar invoices: Invoices operations + :vartype invoices: azure.mgmt.billing.operations.InvoicesOperations + :ivar price_sheet: PriceSheet operations + :vartype price_sheet: azure.mgmt.billing.operations.PriceSheetOperations + :ivar billing_subscriptions: BillingSubscriptions operations + :vartype billing_subscriptions: azure.mgmt.billing.operations.BillingSubscriptionsOperations :ivar products: Products operations :vartype products: azure.mgmt.billing.operations.ProductsOperations - :ivar transactions_by_billing_account: TransactionsByBillingAccount operations - :vartype transactions_by_billing_account: azure.mgmt.billing.operations.TransactionsByBillingAccountOperations - :ivar transactions_by_billing_profile: TransactionsByBillingProfile operations - :vartype transactions_by_billing_profile: azure.mgmt.billing.operations.TransactionsByBillingProfileOperations - :ivar transactions_by_invoice_section: TransactionsByInvoiceSection operations - :vartype transactions_by_invoice_section: azure.mgmt.billing.operations.TransactionsByInvoiceSectionOperations - :ivar policy: Policy operations - :vartype policy: azure.mgmt.billing.operations.PolicyOperations + :ivar transactions: Transactions operations + :vartype transactions: azure.mgmt.billing.operations.TransactionsOperations + :ivar policies: Policies operations + :vartype policies: azure.mgmt.billing.operations.PoliciesOperations :ivar billing_property: BillingProperty operations :vartype billing_property: azure.mgmt.billing.operations.BillingPropertyOperations :ivar transfers: Transfers operations @@ -161,24 +109,12 @@ class BillingManagementClient(SDKClient): :vartype recipient_transfers: azure.mgmt.billing.operations.RecipientTransfersOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.billing.operations.Operations - :ivar billing_account_billing_permissions: BillingAccountBillingPermissions operations - :vartype billing_account_billing_permissions: azure.mgmt.billing.operations.BillingAccountBillingPermissionsOperations - :ivar invoice_sections_billing_permissions: InvoiceSectionsBillingPermissions operations - :vartype invoice_sections_billing_permissions: azure.mgmt.billing.operations.InvoiceSectionsBillingPermissionsOperations - :ivar billing_profile_billing_permissions: BillingProfileBillingPermissions operations - :vartype billing_profile_billing_permissions: azure.mgmt.billing.operations.BillingProfileBillingPermissionsOperations - :ivar billing_account_billing_role_definition: BillingAccountBillingRoleDefinition operations - :vartype billing_account_billing_role_definition: azure.mgmt.billing.operations.BillingAccountBillingRoleDefinitionOperations - :ivar invoice_section_billing_role_definition: InvoiceSectionBillingRoleDefinition operations - :vartype invoice_section_billing_role_definition: azure.mgmt.billing.operations.InvoiceSectionBillingRoleDefinitionOperations - :ivar billing_profile_billing_role_definition: BillingProfileBillingRoleDefinition operations - :vartype billing_profile_billing_role_definition: azure.mgmt.billing.operations.BillingProfileBillingRoleDefinitionOperations - :ivar billing_account_billing_role_assignment: BillingAccountBillingRoleAssignment operations - :vartype billing_account_billing_role_assignment: azure.mgmt.billing.operations.BillingAccountBillingRoleAssignmentOperations - :ivar invoice_section_billing_role_assignment: InvoiceSectionBillingRoleAssignment operations - :vartype invoice_section_billing_role_assignment: azure.mgmt.billing.operations.InvoiceSectionBillingRoleAssignmentOperations - :ivar billing_profile_billing_role_assignment: BillingProfileBillingRoleAssignment operations - :vartype billing_profile_billing_role_assignment: azure.mgmt.billing.operations.BillingProfileBillingRoleAssignmentOperations + :ivar billing_permissions: BillingPermissions operations + :vartype billing_permissions: azure.mgmt.billing.operations.BillingPermissionsOperations + :ivar billing_role_definitions: BillingRoleDefinitions operations + :vartype billing_role_definitions: azure.mgmt.billing.operations.BillingRoleDefinitionsOperations + :ivar billing_role_assignments: BillingRoleAssignments operations + :vartype billing_role_assignments: azure.mgmt.billing.operations.BillingRoleAssignmentsOperations :ivar agreements: Agreements operations :vartype agreements: azure.mgmt.billing.operations.AgreementsOperations @@ -203,57 +139,29 @@ def __init__( self.billing_accounts = BillingAccountsOperations( self._client, self.config, self._serialize, self._deserialize) - self.available_balance_by_billing_profile = AvailableBalanceByBillingProfileOperations( + self.available_balances = AvailableBalancesOperations( self._client, self.config, self._serialize, self._deserialize) - self.payment_methods_by_billing_profile = PaymentMethodsByBillingProfileOperations( - self._client, self.config, self._serialize, self._deserialize) - self.billing_profiles_by_billing_account_name = BillingProfilesByBillingAccountNameOperations( + self.payment_methods = PaymentMethodsOperations( self._client, self.config, self._serialize, self._deserialize) self.billing_profiles = BillingProfilesOperations( self._client, self.config, self._serialize, self._deserialize) - self.invoice_sections_by_billing_account_name = InvoiceSectionsByBillingAccountNameOperations( - self._client, self.config, self._serialize, self._deserialize) self.invoice_sections = InvoiceSectionsOperations( self._client, self.config, self._serialize, self._deserialize) - self.invoice_sections_with_create_subscription_permission = InvoiceSectionsWithCreateSubscriptionPermissionOperations( - self._client, self.config, self._serialize, self._deserialize) - self.departments_by_billing_account_name = DepartmentsByBillingAccountNameOperations( - self._client, self.config, self._serialize, self._deserialize) self.departments = DepartmentsOperations( self._client, self.config, self._serialize, self._deserialize) - self.enrollment_accounts_by_billing_account_name = EnrollmentAccountsByBillingAccountNameOperations( - self._client, self.config, self._serialize, self._deserialize) self.enrollment_accounts = EnrollmentAccountsOperations( self._client, self.config, self._serialize, self._deserialize) - self.invoices_by_billing_account = InvoicesByBillingAccountOperations( - self._client, self.config, self._serialize, self._deserialize) - self.invoice_pricesheet = InvoicePricesheetOperations( - self._client, self.config, self._serialize, self._deserialize) - self.invoices_by_billing_profile = InvoicesByBillingProfileOperations( - self._client, self.config, self._serialize, self._deserialize) - self.invoice = InvoiceOperations( - self._client, self.config, self._serialize, self._deserialize) - self.products_by_billing_subscriptions = ProductsByBillingSubscriptionsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.billing_subscriptions_by_billing_profile = BillingSubscriptionsByBillingProfileOperations( - self._client, self.config, self._serialize, self._deserialize) - self.billing_subscriptions_by_invoice_section = BillingSubscriptionsByInvoiceSectionOperations( + self.invoices = InvoicesOperations( self._client, self.config, self._serialize, self._deserialize) - self.billing_subscription = BillingSubscriptionOperations( + self.price_sheet = PriceSheetOperations( self._client, self.config, self._serialize, self._deserialize) - self.products_by_billing_account = ProductsByBillingAccountOperations( - self._client, self.config, self._serialize, self._deserialize) - self.products_by_invoice_section = ProductsByInvoiceSectionOperations( + self.billing_subscriptions = BillingSubscriptionsOperations( self._client, self.config, self._serialize, self._deserialize) self.products = ProductsOperations( self._client, self.config, self._serialize, self._deserialize) - self.transactions_by_billing_account = TransactionsByBillingAccountOperations( - self._client, self.config, self._serialize, self._deserialize) - self.transactions_by_billing_profile = TransactionsByBillingProfileOperations( - self._client, self.config, self._serialize, self._deserialize) - self.transactions_by_invoice_section = TransactionsByInvoiceSectionOperations( + self.transactions = TransactionsOperations( self._client, self.config, self._serialize, self._deserialize) - self.policy = PolicyOperations( + self.policies = PoliciesOperations( self._client, self.config, self._serialize, self._deserialize) self.billing_property = BillingPropertyOperations( self._client, self.config, self._serialize, self._deserialize) @@ -263,166 +171,11 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) - self.billing_account_billing_permissions = BillingAccountBillingPermissionsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.invoice_sections_billing_permissions = InvoiceSectionsBillingPermissionsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.billing_profile_billing_permissions = BillingProfileBillingPermissionsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.billing_account_billing_role_definition = BillingAccountBillingRoleDefinitionOperations( + self.billing_permissions = BillingPermissionsOperations( self._client, self.config, self._serialize, self._deserialize) - self.invoice_section_billing_role_definition = InvoiceSectionBillingRoleDefinitionOperations( + self.billing_role_definitions = BillingRoleDefinitionsOperations( self._client, self.config, self._serialize, self._deserialize) - self.billing_profile_billing_role_definition = BillingProfileBillingRoleDefinitionOperations( - self._client, self.config, self._serialize, self._deserialize) - self.billing_account_billing_role_assignment = BillingAccountBillingRoleAssignmentOperations( - self._client, self.config, self._serialize, self._deserialize) - self.invoice_section_billing_role_assignment = InvoiceSectionBillingRoleAssignmentOperations( - self._client, self.config, self._serialize, self._deserialize) - self.billing_profile_billing_role_assignment = BillingProfileBillingRoleAssignmentOperations( + self.billing_role_assignments = BillingRoleAssignmentsOperations( self._client, self.config, self._serialize, self._deserialize) self.agreements = AgreementsOperations( self._client, self.config, self._serialize, self._deserialize) - - def update_auto_renew_for_billing_account( - self, billing_account_name, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): - """Cancel product by product id. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param product_name: Invoice Id. - :type product_name: str - :param auto_renew: Request parameters to update auto renew policy a - product. Possible values include: 'true', 'false' - :type auto_renew: str or ~azure.mgmt.billing.models.UpdateAutoRenew - :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: UpdateAutoRenewOperationSummary or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.billing.models.UpdateAutoRenewOperationSummary or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - body = models.UpdateAutoRenewRequest(auto_renew=auto_renew) - - # Construct URL - url = self.update_auto_renew_for_billing_account.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'productName': self._serialize.url("product_name", product_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(body, 'UpdateAutoRenewRequest') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('UpdateAutoRenewOperationSummary', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_auto_renew_for_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/updateAutoRenew'} - - def update_auto_renew_for_invoice_section( - self, billing_account_name, invoice_section_name, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): - """Cancel auto renew for product by product id. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param invoice_section_name: InvoiceSection Id. - :type invoice_section_name: str - :param product_name: Invoice Id. - :type product_name: str - :param auto_renew: Request parameters to update auto renew policy a - product. Possible values include: 'true', 'false' - :type auto_renew: str or ~azure.mgmt.billing.models.UpdateAutoRenew - :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: UpdateAutoRenewOperationSummary or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.billing.models.UpdateAutoRenewOperationSummary or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - body = models.UpdateAutoRenewRequest(auto_renew=auto_renew) - - # Construct URL - url = self.update_auto_renew_for_invoice_section.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), - 'productName': self._serialize.url("product_name", product_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(body, 'UpdateAutoRenewRequest') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('UpdateAutoRenewOperationSummary', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_auto_renew_for_invoice_section.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}/updateAutoRenew'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py index aaa96626717a..140c186dbd06 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py @@ -64,7 +64,7 @@ from .billing_role_assignment_payload_py3 import BillingRoleAssignmentPayload from .billing_role_assignment_py3 import BillingRoleAssignment from .billing_role_assignment_list_result_py3 import BillingRoleAssignmentListResult - from .billing_permissions_py3 import BillingPermissions + from .billing_permissions_properties_py3 import BillingPermissionsProperties from .billing_permissions_list_result_py3 import BillingPermissionsListResult from .billing_role_definition_py3 import BillingRoleDefinition from .billing_role_definition_list_result_py3 import BillingRoleDefinitionListResult @@ -126,7 +126,7 @@ from .billing_role_assignment_payload import BillingRoleAssignmentPayload from .billing_role_assignment import BillingRoleAssignment from .billing_role_assignment_list_result import BillingRoleAssignmentListResult - from .billing_permissions import BillingPermissions + from .billing_permissions_properties import BillingPermissionsProperties from .billing_permissions_list_result import BillingPermissionsListResult from .billing_role_definition import BillingRoleDefinition from .billing_role_definition_list_result import BillingRoleDefinitionListResult @@ -209,7 +209,7 @@ 'BillingRoleAssignmentPayload', 'BillingRoleAssignment', 'BillingRoleAssignmentListResult', - 'BillingPermissions', + 'BillingPermissionsProperties', 'BillingPermissionsListResult', 'BillingRoleDefinition', 'BillingRoleDefinitionListResult', diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.py index a2df95cab160..d260a69513d0 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.py @@ -20,7 +20,8 @@ class BillingPermissionsListResult(Model): :ivar value: The list OF billingPermissions a caller has on a billing account. - :vartype value: list[~azure.mgmt.billing.models.BillingPermissions] + :vartype value: + list[~azure.mgmt.billing.models.BillingPermissionsProperties] """ _validation = { @@ -28,7 +29,7 @@ class BillingPermissionsListResult(Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[BillingPermissions]'}, + 'value': {'key': 'value', 'type': '[BillingPermissionsProperties]'}, } def __init__(self, **kwargs): diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_py3.py index dd88a48cdc83..8a8ccfb428cf 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_py3.py @@ -20,7 +20,8 @@ class BillingPermissionsListResult(Model): :ivar value: The list OF billingPermissions a caller has on a billing account. - :vartype value: list[~azure.mgmt.billing.models.BillingPermissions] + :vartype value: + list[~azure.mgmt.billing.models.BillingPermissionsProperties] """ _validation = { @@ -28,7 +29,7 @@ class BillingPermissionsListResult(Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[BillingPermissions]'}, + 'value': {'key': 'value', 'type': '[BillingPermissionsProperties]'}, } def __init__(self, **kwargs) -> None: diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_properties.py similarity index 91% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions.py rename to azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_properties.py index dfb6d75273a2..037d3b84b190 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_properties.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class BillingPermissions(Model): +class BillingPermissionsProperties(Model): """The set of allowed action and not allowed actions a caller has on a billing account. @@ -36,6 +36,6 @@ class BillingPermissions(Model): } def __init__(self, **kwargs): - super(BillingPermissions, self).__init__(**kwargs) + super(BillingPermissionsProperties, self).__init__(**kwargs) self.actions = None self.not_actions = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_properties_py3.py similarity index 92% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_py3.py rename to azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_properties_py3.py index d0a020868a94..0f0fd8a3848f 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_properties_py3.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class BillingPermissions(Model): +class BillingPermissionsProperties(Model): """The set of allowed action and not allowed actions a caller has on a billing account. @@ -36,6 +36,6 @@ class BillingPermissions(Model): } def __init__(self, **kwargs) -> None: - super(BillingPermissions, self).__init__(**kwargs) + super(BillingPermissionsProperties, self).__init__(**kwargs) self.actions = None self.not_actions = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py index 6c8655f43301..ce3773364f39 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py @@ -28,7 +28,8 @@ class BillingRoleDefinition(Resource): :vartype description: str :ivar value: The list OF billingPermissions a caller has on a billing account. - :vartype value: list[~azure.mgmt.billing.models.BillingPermissions] + :vartype value: + list[~azure.mgmt.billing.models.BillingPermissionsProperties] :ivar role_name: The name of the role :vartype role_name: str """ @@ -47,7 +48,7 @@ class BillingRoleDefinition(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, - 'value': {'key': 'properties.permissions.value', 'type': '[BillingPermissions]'}, + 'value': {'key': 'properties.permissions.value', 'type': '[BillingPermissionsProperties]'}, 'role_name': {'key': 'properties.roleName', 'type': 'str'}, } diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py index 7db2564951ed..c20af66e272f 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py @@ -28,7 +28,8 @@ class BillingRoleDefinition(Resource): :vartype description: str :ivar value: The list OF billingPermissions a caller has on a billing account. - :vartype value: list[~azure.mgmt.billing.models.BillingPermissions] + :vartype value: + list[~azure.mgmt.billing.models.BillingPermissionsProperties] :ivar role_name: The name of the role :vartype role_name: str """ @@ -47,7 +48,7 @@ class BillingRoleDefinition(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, - 'value': {'key': 'properties.permissions.value', 'type': '[BillingPermissions]'}, + 'value': {'key': 'properties.permissions.value', 'type': '[BillingPermissionsProperties]'}, 'role_name': {'key': 'properties.roleName', 'type': 'str'}, } diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index 03590866e10e..43e0ca5a30f8 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -10,87 +10,47 @@ # -------------------------------------------------------------------------- from .billing_accounts_operations import BillingAccountsOperations -from .available_balance_by_billing_profile_operations import AvailableBalanceByBillingProfileOperations -from .payment_methods_by_billing_profile_operations import PaymentMethodsByBillingProfileOperations -from .billing_profiles_by_billing_account_name_operations import BillingProfilesByBillingAccountNameOperations +from .available_balances_operations import AvailableBalancesOperations +from .payment_methods_operations import PaymentMethodsOperations from .billing_profiles_operations import BillingProfilesOperations -from .invoice_sections_by_billing_account_name_operations import InvoiceSectionsByBillingAccountNameOperations from .invoice_sections_operations import InvoiceSectionsOperations -from .invoice_sections_with_create_subscription_permission_operations import InvoiceSectionsWithCreateSubscriptionPermissionOperations -from .departments_by_billing_account_name_operations import DepartmentsByBillingAccountNameOperations from .departments_operations import DepartmentsOperations -from .enrollment_accounts_by_billing_account_name_operations import EnrollmentAccountsByBillingAccountNameOperations from .enrollment_accounts_operations import EnrollmentAccountsOperations -from .invoices_by_billing_account_operations import InvoicesByBillingAccountOperations -from .invoice_pricesheet_operations import InvoicePricesheetOperations -from .invoices_by_billing_profile_operations import InvoicesByBillingProfileOperations -from .invoice_operations import InvoiceOperations -from .products_by_billing_subscriptions_operations import ProductsByBillingSubscriptionsOperations -from .billing_subscriptions_by_billing_profile_operations import BillingSubscriptionsByBillingProfileOperations -from .billing_subscriptions_by_invoice_section_operations import BillingSubscriptionsByInvoiceSectionOperations -from .billing_subscription_operations import BillingSubscriptionOperations -from .products_by_billing_account_operations import ProductsByBillingAccountOperations -from .products_by_invoice_section_operations import ProductsByInvoiceSectionOperations +from .invoices_operations import InvoicesOperations +from .price_sheet_operations import PriceSheetOperations +from .billing_subscriptions_operations import BillingSubscriptionsOperations from .products_operations import ProductsOperations -from .transactions_by_billing_account_operations import TransactionsByBillingAccountOperations -from .transactions_by_billing_profile_operations import TransactionsByBillingProfileOperations -from .transactions_by_invoice_section_operations import TransactionsByInvoiceSectionOperations -from .policy_operations import PolicyOperations +from .transactions_operations import TransactionsOperations +from .policies_operations import PoliciesOperations from .billing_property_operations import BillingPropertyOperations from .transfers_operations import TransfersOperations from .recipient_transfers_operations import RecipientTransfersOperations from .operations import Operations -from .billing_account_billing_permissions_operations import BillingAccountBillingPermissionsOperations -from .invoice_sections_billing_permissions_operations import InvoiceSectionsBillingPermissionsOperations -from .billing_profile_billing_permissions_operations import BillingProfileBillingPermissionsOperations -from .billing_account_billing_role_definition_operations import BillingAccountBillingRoleDefinitionOperations -from .invoice_section_billing_role_definition_operations import InvoiceSectionBillingRoleDefinitionOperations -from .billing_profile_billing_role_definition_operations import BillingProfileBillingRoleDefinitionOperations -from .billing_account_billing_role_assignment_operations import BillingAccountBillingRoleAssignmentOperations -from .invoice_section_billing_role_assignment_operations import InvoiceSectionBillingRoleAssignmentOperations -from .billing_profile_billing_role_assignment_operations import BillingProfileBillingRoleAssignmentOperations +from .billing_permissions_operations import BillingPermissionsOperations +from .billing_role_definitions_operations import BillingRoleDefinitionsOperations +from .billing_role_assignments_operations import BillingRoleAssignmentsOperations from .agreements_operations import AgreementsOperations __all__ = [ 'BillingAccountsOperations', - 'AvailableBalanceByBillingProfileOperations', - 'PaymentMethodsByBillingProfileOperations', - 'BillingProfilesByBillingAccountNameOperations', + 'AvailableBalancesOperations', + 'PaymentMethodsOperations', 'BillingProfilesOperations', - 'InvoiceSectionsByBillingAccountNameOperations', 'InvoiceSectionsOperations', - 'InvoiceSectionsWithCreateSubscriptionPermissionOperations', - 'DepartmentsByBillingAccountNameOperations', 'DepartmentsOperations', - 'EnrollmentAccountsByBillingAccountNameOperations', 'EnrollmentAccountsOperations', - 'InvoicesByBillingAccountOperations', - 'InvoicePricesheetOperations', - 'InvoicesByBillingProfileOperations', - 'InvoiceOperations', - 'ProductsByBillingSubscriptionsOperations', - 'BillingSubscriptionsByBillingProfileOperations', - 'BillingSubscriptionsByInvoiceSectionOperations', - 'BillingSubscriptionOperations', - 'ProductsByBillingAccountOperations', - 'ProductsByInvoiceSectionOperations', + 'InvoicesOperations', + 'PriceSheetOperations', + 'BillingSubscriptionsOperations', 'ProductsOperations', - 'TransactionsByBillingAccountOperations', - 'TransactionsByBillingProfileOperations', - 'TransactionsByInvoiceSectionOperations', - 'PolicyOperations', + 'TransactionsOperations', + 'PoliciesOperations', 'BillingPropertyOperations', 'TransfersOperations', 'RecipientTransfersOperations', 'Operations', - 'BillingAccountBillingPermissionsOperations', - 'InvoiceSectionsBillingPermissionsOperations', - 'BillingProfileBillingPermissionsOperations', - 'BillingAccountBillingRoleDefinitionOperations', - 'InvoiceSectionBillingRoleDefinitionOperations', - 'BillingProfileBillingRoleDefinitionOperations', - 'BillingAccountBillingRoleAssignmentOperations', - 'InvoiceSectionBillingRoleAssignmentOperations', - 'BillingProfileBillingRoleAssignmentOperations', + 'BillingPermissionsOperations', + 'BillingRoleDefinitionsOperations', + 'BillingRoleAssignmentsOperations', 'AgreementsOperations', ] diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/available_balance_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/available_balances_operations.py similarity index 91% rename from azure-mgmt-billing/azure/mgmt/billing/operations/available_balance_by_billing_profile_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/available_balances_operations.py index f4d743d0317a..f425396e08b1 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/available_balance_by_billing_profile_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/available_balances_operations.py @@ -15,8 +15,8 @@ from .. import models -class AvailableBalanceByBillingProfileOperations(object): - """AvailableBalanceByBillingProfileOperations operations. +class AvailableBalancesOperations(object): + """AvailableBalancesOperations operations. :param client: Client for service requests. :param config: Configuration of service client. @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def get( + def get_by_billing_profile( self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): """The latest available credit balance for a given billingAccountName and billingProfileName. @@ -57,7 +57,7 @@ def get( :class:`ErrorResponseException` """ # Construct URL - url = self.get.metadata['url'] + url = self.get_by_billing_profile.metadata['url'] path_format_arguments = { 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') @@ -95,4 +95,4 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/availableBalance/default'} + get_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/availableBalance/default'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_permissions_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_permissions_operations.py deleted file mode 100644 index 5424cc0e51cc..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_permissions_operations.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class BillingAccountBillingPermissionsOperations(object): - """BillingAccountBillingPermissionsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, billing_account_name, custom_headers=None, raw=False, **operation_config): - """Lists all billingPermissions for the caller has for a billing account. - - :param billing_account_name: billing Account Id. - :type billing_account_name: 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: BillingPermissionsListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingPermissionsListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('BillingPermissionsListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingPermissions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_definition_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_definition_operations.py deleted file mode 100644 index ec6ddf02ab4f..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_definition_operations.py +++ /dev/null @@ -1,155 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class BillingAccountBillingRoleDefinitionOperations(object): - """BillingAccountBillingRoleDefinitionOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def get( - self, billing_account_name, billing_role_definition_name, custom_headers=None, raw=False, **operation_config): - """Gets the role definition for a role. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param billing_role_definition_name: role definition id. - :type billing_role_definition_name: 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: BillingRoleDefinition or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingRoleDefinition or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'billingRoleDefinitionName': self._serialize.url("billing_role_definition_name", billing_role_definition_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('BillingRoleDefinition', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}'} - - def list( - self, billing_account_name, custom_headers=None, raw=False, **operation_config): - """Lists the role definition for a billing account. - - :param billing_account_name: billing Account Id. - :type billing_account_name: 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: BillingRoleDefinitionListResult or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.billing.models.BillingRoleDefinitionListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('BillingRoleDefinitionListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleDefinitions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_definition_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py similarity index 56% rename from azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_definition_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py index e45824959e4b..f31a5475cb64 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_definition_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py @@ -15,8 +15,8 @@ from .. import models -class InvoiceSectionBillingRoleDefinitionOperations(object): - """InvoiceSectionBillingRoleDefinitionOperations operations. +class BillingPermissionsOperations(object): + """BillingPermissionsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. @@ -36,33 +36,27 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def get( - self, billing_account_name, invoice_section_name, billing_role_definition_name, custom_headers=None, raw=False, **operation_config): - """Gets the role definition for a role. + def list_by_billing_account( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """Lists all billing permissions for the caller under a billing account. :param billing_account_name: billing Account Id. :type billing_account_name: str - :param invoice_section_name: InvoiceSection Id. - :type invoice_section_name: str - :param billing_role_definition_name: role definition id. - :type billing_role_definition_name: 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: BillingRoleDefinition or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingRoleDefinition or + :return: BillingPermissionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingPermissionsListResult or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.get.metadata['url'] + url = self.list_by_billing_account.metadata['url'] path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), - 'billingRoleDefinitionName': self._serialize.url("billing_role_definition_name", billing_role_definition_name, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -90,18 +84,18 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('BillingRoleDefinition', response) + deserialized = self._deserialize('BillingPermissionsListResult', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}'} + list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingPermissions'} - def list( + def list_by_invoice_sections( self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): - """Lists the role definition for a invoice Section. + """Lists all billing permissions for the caller under invoice section. :param billing_account_name: billing Account Id. :type billing_account_name: str @@ -112,15 +106,14 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: BillingRoleDefinitionListResult or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.billing.models.BillingRoleDefinitionListResult or + :return: BillingPermissionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingPermissionsListResult or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.list.metadata['url'] + url = self.list_by_invoice_sections.metadata['url'] path_format_arguments = { 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') @@ -151,11 +144,71 @@ def list( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('BillingRoleDefinitionListResult', response) + deserialized = self._deserialize('BillingPermissionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_invoice_sections.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingPermissions'} + + def list_by_billing_profile( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """Lists all billingPermissions for the caller has for a billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: 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: BillingPermissionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingPermissionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingPermissionsListResult', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleDefinitions'} + list_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingPermissions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_permissions_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_permissions_operations.py deleted file mode 100644 index c9178f7574db..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_permissions_operations.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class BillingProfileBillingPermissionsOperations(object): - """BillingProfileBillingPermissionsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): - """Lists all billingPermissions for the caller has for a billing account. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param billing_profile_name: Billing Profile Id. - :type billing_profile_name: 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: BillingPermissionsListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingPermissionsListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('BillingPermissionsListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingPermissions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_definition_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_definition_operations.py deleted file mode 100644 index 9489c03d4247..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_definition_operations.py +++ /dev/null @@ -1,161 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class BillingProfileBillingRoleDefinitionOperations(object): - """BillingProfileBillingRoleDefinitionOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def get( - self, billing_account_name, billing_profile_name, billing_role_definition_name, custom_headers=None, raw=False, **operation_config): - """Gets the role definition for a role. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param billing_profile_name: Billing Profile Id. - :type billing_profile_name: str - :param billing_role_definition_name: role definition id. - :type billing_role_definition_name: 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: BillingRoleDefinition or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingRoleDefinition or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), - 'billingRoleDefinitionName': self._serialize.url("billing_role_definition_name", billing_role_definition_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('BillingRoleDefinition', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}'} - - def list( - self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): - """Lists the role definition for a Billing Profile. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param billing_profile_name: Billing Profile Id. - :type billing_profile_name: 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: BillingRoleDefinitionListResult or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.billing.models.BillingRoleDefinitionListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('BillingRoleDefinitionListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleDefinitions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_by_billing_account_name_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_by_billing_account_name_operations.py deleted file mode 100644 index c5b107bebdf5..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_by_billing_account_name_operations.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class BillingProfilesByBillingAccountNameOperations(object): - """BillingProfilesByBillingAccountNameOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): - """Lists all billing profiles for a user which that user has access to. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param expand: May be used to expand the invoiceSections. - :type expand: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: BillingProfileListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingProfileListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('BillingProfileListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py index 023bd234b1ed..d98add3bbe9f 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py @@ -38,6 +38,67 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def list_by_billing_account_name( + self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all billing profiles for a user which that user has access to. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param expand: May be used to expand the invoiceSections. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingProfileListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingProfileListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_billing_account_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingProfileListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles'} + def get( self, billing_account_name, billing_profile_name, expand=None, custom_headers=None, raw=False, **operation_config): """Get the billing profile by id. diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py new file mode 100644 index 000000000000..1bb2361d9cf9 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py @@ -0,0 +1,787 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BillingRoleAssignmentsOperations(object): + """BillingRoleAssignmentsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get_by_billing_account( + self, billing_account_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignment for the caller. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_role_assignment_name: role assignment id. + :type billing_role_assignment_name: 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: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_billing_account.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def delete_by_billing_account_name( + self, billing_account_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Delete the role assignment on this billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_role_assignment_name: role assignment id. + :type billing_role_assignment_name: 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: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_by_billing_account_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def get_by_invoice_section_name( + self, billing_account_name, invoice_section_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignment for the caller on the invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_role_assignment_name: role assignment id. + :type billing_role_assignment_name: 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: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_invoice_section_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def delete_by_invoice_section_name( + self, billing_account_name, invoice_section_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Delete the role assignment on the invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_role_assignment_name: role assignment id. + :type billing_role_assignment_name: 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: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_by_invoice_section_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def get_by_billing_profile_name( + self, billing_account_name, billing_profile_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignment for the caller on the Billing Profile. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param billing_role_assignment_name: role assignment id. + :type billing_role_assignment_name: 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: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_billing_profile_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def delete_by_billing_profile_name( + self, billing_account_name, billing_profile_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Delete the role assignment on this Billing Profile. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param billing_role_assignment_name: role assignment id. + :type billing_role_assignment_name: 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: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_by_billing_profile_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def list_by_billing_account_name( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignments on the Billing Account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: 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: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_billing_account_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments'} + + def add_by_billing_account_name( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """The operation to add a role assignment to a billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: 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: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = None + + # Construct URL + url = self.add_by_billing_account_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'BillingRoleAssignmentPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/createBillingRoleAssignment'} + + def list_by_invoice_section_name( + self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignments on the invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: 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: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_invoice_section_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments'} + + def add_by_invoice_section_name( + self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """The operation to add a role assignment to a invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: 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: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = None + + # Construct URL + url = self.add_by_invoice_section_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'BillingRoleAssignmentPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/createBillingRoleAssignment'} + + def list_by_billing_profile_name( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignments on the Billing Profile. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: 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: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_billing_profile_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleAssignments'} + + def add_by_billing_profile_name( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """The operation to add a role assignment to a billing profile. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: 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: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = None + + # Construct URL + url = self.add_by_billing_profile_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'BillingRoleAssignmentPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/createBillingRoleAssignment'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_assignment_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_definitions_operations.py similarity index 50% rename from azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_assignment_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_definitions_operations.py index eec018f7a41c..9ee44c433066 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_assignment_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_definitions_operations.py @@ -15,8 +15,8 @@ from .. import models -class BillingProfileBillingRoleAssignmentOperations(object): - """BillingProfileBillingRoleAssignmentOperations operations. +class BillingRoleDefinitionsOperations(object): + """BillingRoleDefinitionsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. @@ -36,33 +36,93 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def get( - self, billing_account_name, billing_profile_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): - """Get the role assignment for the caller on the Billing Profile. + def get_by_billing_account_name( + self, billing_account_name, billing_role_definition_name, custom_headers=None, raw=False, **operation_config): + """Gets the role definition for a role. :param billing_account_name: billing Account Id. :type billing_account_name: str - :param billing_profile_name: Billing Profile Id. - :type billing_profile_name: str - :param billing_role_assignment_name: role assignment id. - :type billing_role_assignment_name: str + :param billing_role_definition_name: role definition id. + :type billing_role_definition_name: 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: BillingRoleAssignment or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + :return: BillingRoleDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinition or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.get.metadata['url'] + url = self.get_by_billing_account_name.metadata['url'] path_format_arguments = { 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), - 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + 'billingRoleDefinitionName': self._serialize.url("billing_role_definition_name", billing_role_definition_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}'} + + def get_by_invoice_section_name( + self, billing_account_name, invoice_section_name, billing_role_definition_name, custom_headers=None, raw=False, **operation_config): + """Gets the role definition for a role. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_role_definition_name: role definition id. + :type billing_role_definition_name: 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: BillingRoleDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_invoice_section_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingRoleDefinitionName': self._serialize.url("billing_role_definition_name", billing_role_definition_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -90,42 +150,42 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('BillingRoleAssignment', response) + deserialized = self._deserialize('BillingRoleDefinition', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + get_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}'} - def delete( - self, billing_account_name, billing_profile_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): - """Delete the role assignment on this Billing Profile. + def get_by_billing_profile_name( + self, billing_account_name, billing_profile_name, billing_role_definition_name, custom_headers=None, raw=False, **operation_config): + """Gets the role definition for a role. :param billing_account_name: billing Account Id. :type billing_account_name: str :param billing_profile_name: Billing Profile Id. :type billing_profile_name: str - :param billing_role_assignment_name: role assignment id. - :type billing_role_assignment_name: str + :param billing_role_definition_name: role definition id. + :type billing_role_definition_name: 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: BillingRoleAssignment or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + :return: BillingRoleDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinition or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.delete.metadata['url'] + url = self.get_by_billing_profile_name.metadata['url'] path_format_arguments = { 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), - 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + 'billingRoleDefinitionName': self._serialize.url("billing_role_definition_name", billing_role_definition_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -144,7 +204,7 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -153,40 +213,98 @@ def delete( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('BillingRoleAssignment', response) + deserialized = self._deserialize('BillingRoleDefinition', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - delete.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + get_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}'} - def list( - self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): - """Get the role assignments on the Billing Profile. + def list_by_billing_account_name( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """Lists the role definition for a billing account. :param billing_account_name: billing Account Id. :type billing_account_name: str - :param billing_profile_name: Billing Profile Id. - :type billing_profile_name: 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: BillingRoleAssignmentListResult or ClientRawResponse if + :return: BillingRoleDefinitionListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinitionListResult or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.list.metadata['url'] + url = self.list_by_billing_account_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleDefinitionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleDefinitions'} + + def list_by_invoice_section_name( + self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Lists the role definition for an invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: 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: BillingRoleDefinitionListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinitionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_invoice_section_name.metadata['url'] path_format_arguments = { 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -214,18 +332,18 @@ def list( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + deserialized = self._deserialize('BillingRoleDefinitionListResult', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleAssignments'} + list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleDefinitions'} - def add( + def list_by_billing_profile_name( self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): - """The operation to add a role assignment to a billing profile. + """Lists the role definition for a Billing Profile. :param billing_account_name: billing Account Id. :type billing_account_name: str @@ -236,17 +354,15 @@ def add( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: BillingRoleAssignmentListResult or ClientRawResponse if + :return: BillingRoleDefinitionListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinitionListResult or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ - parameters = None - # Construct URL - url = self.add.metadata['url'] + url = self.list_by_billing_profile_name.metadata['url'] path_format_arguments = { 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') @@ -260,7 +376,6 @@ def add( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -268,24 +383,21 @@ def add( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - # Construct body - body_content = self._serialize.body(parameters, 'BillingRoleAssignmentPayload') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [201]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleDefinitionListResult', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - add.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/createBillingRoleAssignment'} + list_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleDefinitions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py deleted file mode 100644 index c33dae9080a6..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py +++ /dev/null @@ -1,221 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class BillingSubscriptionOperations(object): - """BillingSubscriptionOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def get( - self, billing_account_name, invoice_section_name, billing_subscription_name, custom_headers=None, raw=False, **operation_config): - """Get a single billing subscription by name. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param invoice_section_name: InvoiceSection Id. - :type invoice_section_name: str - :param billing_subscription_name: Billing Subscription Id. - :type billing_subscription_name: 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: BillingSubscriptionSummary or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingSubscriptionSummary or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), - 'billingSubscriptionName': self._serialize.url("billing_subscription_name", billing_subscription_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('BillingSubscriptionSummary', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}'} - - - def _transfer_initial( - self, billing_account_name, invoice_section_name, billing_subscription_name, destination_invoice_section_id=None, custom_headers=None, raw=False, **operation_config): - parameters = models.TransferBillingSubscriptionRequestProperties(destination_invoice_section_id=destination_invoice_section_id) - - # Construct URL - url = self.transfer.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), - 'billingSubscriptionName': self._serialize.url("billing_subscription_name", billing_subscription_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'TransferBillingSubscriptionRequestProperties') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('TransferBillingSubscriptionResult', response) - header_dict = { - 'Location': 'str', - 'Retry-After': 'int', - 'Azure-AsyncOperation': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - - def transfer( - self, billing_account_name, invoice_section_name, billing_subscription_name, destination_invoice_section_id=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Transfers the GTM subscription from one invoice section to another - within a billing account. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param invoice_section_name: InvoiceSection Id. - :type invoice_section_name: str - :param billing_subscription_name: Billing Subscription Id. - :type billing_subscription_name: str - :param destination_invoice_section_id: The destination invoice section - id. - :type destination_invoice_section_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 - TransferBillingSubscriptionResult or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.TransferBillingSubscriptionResult] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.TransferBillingSubscriptionResult]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._transfer_initial( - billing_account_name=billing_account_name, - invoice_section_name=invoice_section_name, - billing_subscription_name=billing_subscription_name, - destination_invoice_section_id=destination_invoice_section_id, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - header_dict = { - 'Location': 'str', - 'Retry-After': 'int', - 'Azure-AsyncOperation': 'str', - } - deserialized = self._deserialize('TransferBillingSubscriptionResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/transfer'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py deleted file mode 100644 index 36803e3ca700..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class BillingSubscriptionsByBillingProfileOperations(object): - """BillingSubscriptionsByBillingProfileOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): - """Lists billing subscriptions by billingProfileName. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param billing_profile_name: Billing Profile Id. - :type billing_profile_name: 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: BillingSubscriptionsListResult or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.billing.models.BillingSubscriptionsListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('BillingSubscriptionsListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingSubscriptions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_invoice_section_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_invoice_section_operations.py deleted file mode 100644 index 55d6e5916929..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_invoice_section_operations.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class BillingSubscriptionsByInvoiceSectionOperations(object): - """BillingSubscriptionsByInvoiceSectionOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): - """Lists billing subscription by invoiceSectionName. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param invoice_section_name: InvoiceSection Id. - :type invoice_section_name: 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: BillingSubscriptionsListResult or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.billing.models.BillingSubscriptionsListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('BillingSubscriptionsListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_assignment_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_operations.py similarity index 53% rename from azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_assignment_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_operations.py index 2a836c469ae8..c713b7e251c4 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_assignment_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_operations.py @@ -11,12 +11,14 @@ import uuid from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models -class InvoiceSectionBillingRoleAssignmentOperations(object): - """InvoiceSectionBillingRoleAssignmentOperations operations. +class BillingSubscriptionsOperations(object): + """BillingSubscriptionsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. @@ -36,33 +38,96 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def get( - self, billing_account_name, invoice_section_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): - """Get the role assignment for the caller on the invoice Section. + def list_by_billing_account_name( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """Lists billing subscriptions by billing account name. :param billing_account_name: billing Account Id. :type billing_account_name: str - :param invoice_section_name: InvoiceSection Id. - :type invoice_section_name: str - :param billing_role_assignment_name: role assignment id. - :type billing_role_assignment_name: 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: BillingRoleAssignment or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + :return: An iterator like instance of BillingSubscriptionSummary + :rtype: + ~azure.mgmt.billing.models.BillingSubscriptionSummaryPaged[~azure.mgmt.billing.models.BillingSubscriptionSummary] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_billing_account_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.BillingSubscriptionSummaryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BillingSubscriptionSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions'} + + def list_by_billing_profile_name( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """Lists billing subscriptions by billing profile name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: 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: BillingSubscriptionsListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingSubscriptionsListResult or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.get.metadata['url'] + url = self.list_by_billing_profile_name.metadata['url'] path_format_arguments = { 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), - 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -90,42 +155,40 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('BillingRoleAssignment', response) + deserialized = self._deserialize('BillingSubscriptionsListResult', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + list_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingSubscriptions'} - def delete( - self, billing_account_name, invoice_section_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): - """Delete the role assignment on this invoice Section. + def list_by_invoice_section_name( + self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Lists billing subscription by invoice section name. :param billing_account_name: billing Account Id. :type billing_account_name: str :param invoice_section_name: InvoiceSection Id. :type invoice_section_name: str - :param billing_role_assignment_name: role assignment id. - :type billing_role_assignment_name: 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: BillingRoleAssignment or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + :return: BillingSubscriptionsListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingSubscriptionsListResult or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.delete.metadata['url'] + url = self.list_by_invoice_section_name.metadata['url'] path_format_arguments = { 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), - 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -144,7 +207,7 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -153,40 +216,42 @@ def delete( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('BillingRoleAssignment', response) + deserialized = self._deserialize('BillingSubscriptionsListResult', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - delete.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions'} - def list( - self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): - """Get the role assignments on the invoice Section. + def get( + self, billing_account_name, invoice_section_name, billing_subscription_name, custom_headers=None, raw=False, **operation_config): + """Get a single billing subscription by name. :param billing_account_name: billing Account Id. :type billing_account_name: str :param invoice_section_name: InvoiceSection Id. :type invoice_section_name: str + :param billing_subscription_name: Billing Subscription Id. + :type billing_subscription_name: 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: BillingRoleAssignmentListResult or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + :return: BillingSubscriptionSummary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingSubscriptionSummary or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.list.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingSubscriptionName': self._serialize.url("billing_subscription_name", billing_subscription_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -214,48 +279,31 @@ def list( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + deserialized = self._deserialize('BillingSubscriptionSummary', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments'} + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}'} - def add( - self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): - """The operation to add a role assignment to a invoice Section. - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param invoice_section_name: InvoiceSection Id. - :type invoice_section_name: 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: BillingRoleAssignmentListResult or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - parameters = None + def _transfer_initial( + self, billing_account_name, invoice_section_name, billing_subscription_name, destination_invoice_section_id=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TransferBillingSubscriptionRequestProperties(destination_invoice_section_id=destination_invoice_section_id) # Construct URL - url = self.add.metadata['url'] + url = self.transfer.metadata['url'] path_format_arguments = { 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingSubscriptionName': self._serialize.url("billing_subscription_name", billing_subscription_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -269,23 +317,92 @@ def add( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'BillingRoleAssignmentPayload') + body_content = self._serialize.body(parameters, 'TransferBillingSubscriptionRequestProperties') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [201]: + if response.status_code not in [200, 202]: raise models.ErrorResponseException(self._deserialize, response) deserialized = None + header_dict = {} - if response.status_code == 201: - deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + if response.status_code == 200: + deserialized = self._deserialize('TransferBillingSubscriptionResult', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + 'Azure-AsyncOperation': 'str', + } if raw: client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response return deserialized - add.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/createBillingRoleAssignment'} + + def transfer( + self, billing_account_name, invoice_section_name, billing_subscription_name, destination_invoice_section_id=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Transfers the subscription from one invoice section to another within a + billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_subscription_name: Billing Subscription Id. + :type billing_subscription_name: str + :param destination_invoice_section_id: The destination invoice section + id. + :type destination_invoice_section_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 + TransferBillingSubscriptionResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.TransferBillingSubscriptionResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.TransferBillingSubscriptionResult]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._transfer_initial( + billing_account_name=billing_account_name, + invoice_section_name=invoice_section_name, + billing_subscription_name=billing_subscription_name, + destination_invoice_section_id=destination_invoice_section_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + 'Azure-AsyncOperation': 'str', + } + deserialized = self._deserialize('TransferBillingSubscriptionResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/transfer'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/departments_by_billing_account_name_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/departments_by_billing_account_name_operations.py deleted file mode 100644 index 172983a0c965..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/departments_by_billing_account_name_operations.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class DepartmentsByBillingAccountNameOperations(object): - """DepartmentsByBillingAccountNameOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, billing_account_name, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): - """Lists all departments for a user which he has access to. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param expand: May be used to expand the enrollmentAccounts. - :type expand: str - :param filter: The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and - 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter - is a key value pair string where key and value is separated by a colon - (:). - :type filter: 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: DepartmentListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.DepartmentListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('DepartmentListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py index d455356b1845..dd5044ad7ef5 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py @@ -36,6 +36,74 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def list_by_billing_account_name( + self, billing_account_name, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists all departments for a user which he has access to. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param expand: May be used to expand the enrollmentAccounts. + :type expand: str + :param filter: The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and + 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter + is a key value pair string where key and value is separated by a colon + (:). + :type filter: 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: DepartmentListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.DepartmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_billing_account_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DepartmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments'} + def get( self, billing_account_name, department_name, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): """Get the department by id. diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_by_billing_account_name_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_by_billing_account_name_operations.py deleted file mode 100644 index 768b8cf0bfdb..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_by_billing_account_name_operations.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class EnrollmentAccountsByBillingAccountNameOperations(object): - """EnrollmentAccountsByBillingAccountNameOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, billing_account_name, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): - """Lists all Enrollment Accounts for a user which he has access to. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param expand: May be used to expand the department. - :type expand: str - :param filter: The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and - 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter - is a key value pair string where key and value is separated by a colon - (:). - :type filter: 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: EnrollmentAccountListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.EnrollmentAccountListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('EnrollmentAccountListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py index 3686d725dbb4..b996cb2b6890 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py @@ -36,7 +36,75 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def get_by_enrollment_account_account_id( + def list_by_billing_account_name( + self, billing_account_name, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists all Enrollment Accounts for a user which he has access to. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param expand: May be used to expand the department. + :type expand: str + :param filter: The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and + 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter + is a key value pair string where key and value is separated by a colon + (:). + :type filter: 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: EnrollmentAccountListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.EnrollmentAccountListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_billing_account_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('EnrollmentAccountListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts'} + + def get_by_enrollment_account_id( self, billing_account_name, enrollment_account_name, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): """Get the enrollment account by id. @@ -63,7 +131,7 @@ def get_by_enrollment_account_account_id( :class:`ErrorResponseException` """ # Construct URL - url = self.get_by_enrollment_account_account_id.metadata['url'] + url = self.get_by_enrollment_account_id.metadata['url'] path_format_arguments = { 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), 'enrollmentAccountName': self._serialize.url("enrollment_account_name", enrollment_account_name, 'str') @@ -105,4 +173,4 @@ def get_by_enrollment_account_account_id( return client_raw_response return deserialized - get_by_enrollment_account_account_id.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}'} + get_by_enrollment_account_id.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py deleted file mode 100644 index 8b8e32685d1c..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class InvoiceOperations(object): - """InvoiceOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def get( - self, billing_account_name, billing_profile_name, invoice_name, custom_headers=None, raw=False, **operation_config): - """Get the invoice by id. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param billing_profile_name: Billing Profile Id. - :type billing_profile_name: str - :param invoice_name: Invoice Id. - :type invoice_name: 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: InvoiceSummary or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.InvoiceSummary or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), - 'invoiceName': self._serialize.url("invoice_name", invoice_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('InvoiceSummary', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_billing_permissions_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_billing_permissions_operations.py deleted file mode 100644 index 36a228cc651a..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_billing_permissions_operations.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class InvoiceSectionsBillingPermissionsOperations(object): - """InvoiceSectionsBillingPermissionsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): - """Lists all billingPermissions for the caller has for a Invoice Section. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param invoice_section_name: InvoiceSection Id. - :type invoice_section_name: 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: BillingPermissionsListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingPermissionsListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('BillingPermissionsListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingPermissions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_name_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_name_operations.py deleted file mode 100644 index 3bf455e406f5..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_name_operations.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class InvoiceSectionsByBillingAccountNameOperations(object): - """InvoiceSectionsByBillingAccountNameOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): - """Lists all invoice sections for a user which he has access to. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param expand: May be used to expand the billingProfiles. - :type expand: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: InvoiceSectionListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.InvoiceSectionListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('InvoiceSectionListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py index 7d26df363c3b..ef9c355efe1c 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py @@ -38,6 +38,67 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def list_by_billing_account_name( + self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all invoice sections for a user which he has access to. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param expand: May be used to expand the billingProfiles. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: InvoiceSectionListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceSectionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_billing_account_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceSectionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections'} + def _create_initial( self, billing_account_name, display_name=None, billing_profiles=None, custom_headers=None, raw=False, **operation_config): @@ -213,6 +274,68 @@ def list_by_billing_profile_name( return deserialized list_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections'} + def list_by_create_subscription_permission( + self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all invoiceSections with create subscription permission for a + user. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param expand: May be used to expand the billingProfiles. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: InvoiceSectionListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceSectionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_create_subscription_permission.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceSectionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_create_subscription_permission.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/listInvoiceSectionsWithCreateSubscriptionPermission'} + def get( self, billing_account_name, invoice_section_name, expand=None, custom_headers=None, raw=False, **operation_config): """Get the InvoiceSection by id. diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py deleted file mode 100644 index 8cc6ce0f8bb7..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class InvoiceSectionsWithCreateSubscriptionPermissionOperations(object): - """InvoiceSectionsWithCreateSubscriptionPermissionOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): - """Lists all invoiceSections with create subscription permission for a - user. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param expand: May be used to expand the billingProfiles. - :type expand: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: InvoiceSectionListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.InvoiceSectionListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('InvoiceSectionListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/listInvoiceSectionsWithCreateSubscriptionPermission'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_account_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_account_operations.py deleted file mode 100644 index ebe0c5541426..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_account_operations.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class InvoicesByBillingAccountOperations(object): - """InvoicesByBillingAccountOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, billing_account_name, period_start_date, period_end_date, custom_headers=None, raw=False, **operation_config): - """List of invoices for a billing account. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param period_start_date: Invoice period start date. - :type period_start_date: str - :param period_end_date: Invoice period end date. - :type period_end_date: 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: InvoiceListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.InvoiceListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - query_parameters['periodStartDate'] = self._serialize.query("period_start_date", period_start_date, 'str') - query_parameters['periodEndDate'] = self._serialize.query("period_end_date", period_end_date, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('InvoiceListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_profile_operations.py deleted file mode 100644 index 6ab2dea8e87b..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_profile_operations.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class InvoicesByBillingProfileOperations(object): - """InvoicesByBillingProfileOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, billing_account_name, billing_profile_name, period_start_date, period_end_date, custom_headers=None, raw=False, **operation_config): - """List of invoices for a billing profile. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param billing_profile_name: Billing Profile Id. - :type billing_profile_name: str - :param period_start_date: Invoice period start date. - :type period_start_date: str - :param period_end_date: Invoice period end date. - :type period_end_date: 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: InvoiceListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.InvoiceListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - query_parameters['periodStartDate'] = self._serialize.query("period_start_date", period_start_date, 'str') - query_parameters['periodEndDate'] = self._serialize.query("period_end_date", period_end_date, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('InvoiceListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_assignment_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py similarity index 57% rename from azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_assignment_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py index f8ff12e9940c..c5ed960009b8 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_assignment_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py @@ -15,8 +15,8 @@ from .. import models -class BillingAccountBillingRoleAssignmentOperations(object): - """BillingAccountBillingRoleAssignmentOperations operations. +class InvoicesOperations(object): + """InvoicesOperations operations. :param client: Client for service requests. :param config: Configuration of service client. @@ -36,36 +36,39 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def get( - self, billing_account_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): - """Get the role assignment for the caller. + def list_by_billing_account_name( + self, billing_account_name, period_start_date, period_end_date, custom_headers=None, raw=False, **operation_config): + """List of invoices for a billing account. :param billing_account_name: billing Account Id. :type billing_account_name: str - :param billing_role_assignment_name: role assignment id. - :type billing_role_assignment_name: str + :param period_start_date: Invoice period start date. + :type period_start_date: str + :param period_end_date: Invoice period end date. + :type period_end_date: 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: BillingRoleAssignment or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + :return: InvoiceListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceListResult or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.get.metadata['url'] + url = self.list_by_billing_account_name.metadata['url'] path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['periodStartDate'] = self._serialize.query("period_start_date", period_start_date, 'str') + query_parameters['periodEndDate'] = self._serialize.query("period_end_date", period_end_date, 'str') # Construct headers header_parameters = {} @@ -87,45 +90,51 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('BillingRoleAssignment', response) + deserialized = self._deserialize('InvoiceListResult', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices'} - def delete( - self, billing_account_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): - """Delete the role assignment on this billing account. + def list_by_billing_profile( + self, billing_account_name, billing_profile_name, period_start_date, period_end_date, custom_headers=None, raw=False, **operation_config): + """List of invoices for a billing profile. :param billing_account_name: billing Account Id. :type billing_account_name: str - :param billing_role_assignment_name: role assignment id. - :type billing_role_assignment_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param period_start_date: Invoice period start date. + :type period_start_date: str + :param period_end_date: Invoice period end date. + :type period_end_date: 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: BillingRoleAssignment or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + :return: InvoiceListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceListResult or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.delete.metadata['url'] + url = self.list_by_billing_profile.metadata['url'] path_format_arguments = { 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['periodStartDate'] = self._serialize.query("period_start_date", period_start_date, 'str') + query_parameters['periodEndDate'] = self._serialize.query("period_end_date", period_end_date, 'str') # Construct headers header_parameters = {} @@ -138,7 +147,7 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -147,37 +156,42 @@ def delete( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('BillingRoleAssignment', response) + deserialized = self._deserialize('InvoiceListResult', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - delete.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + list_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices'} - def list( - self, billing_account_name, custom_headers=None, raw=False, **operation_config): - """Get the role assignments on the Billing Account. + def get( + self, billing_account_name, billing_profile_name, invoice_name, custom_headers=None, raw=False, **operation_config): + """Get the invoice by name. :param billing_account_name: billing Account Id. :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_name: Invoice Id. + :type invoice_name: 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: BillingRoleAssignmentListResult or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + :return: InvoiceSummary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceSummary or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.list.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceName': self._serialize.url("invoice_name", invoice_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -205,75 +219,11 @@ def list( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('BillingRoleAssignmentListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments'} - - def add( - self, billing_account_name, custom_headers=None, raw=False, **operation_config): - """The operation to add a role assignment to a billing account. - - :param billing_account_name: billing Account Id. - :type billing_account_name: 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: BillingRoleAssignmentListResult or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - parameters = None - - # Construct URL - url = self.add.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'BillingRoleAssignmentPayload') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + deserialized = self._deserialize('InvoiceSummary', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - add.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/createBillingRoleAssignment'} + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_operations.py similarity index 91% rename from azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_by_billing_profile_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_operations.py index efdccfb7b5d7..0408e6426d5c 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_by_billing_profile_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_operations.py @@ -15,8 +15,8 @@ from .. import models -class PaymentMethodsByBillingProfileOperations(object): - """PaymentMethodsByBillingProfileOperations operations. +class PaymentMethodsOperations(object): + """PaymentMethodsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def list( + def list_by_billing_profile_name( self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): """Lists the Payment Methods by billing profile Id. @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list_by_billing_profile_name.metadata['url'] path_format_arguments = { 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') @@ -102,4 +102,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/paymentMethods'} + list_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/paymentMethods'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/policies_operations.py similarity index 94% rename from azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/policies_operations.py index 65e34a53f0d1..1dcbc3d125e7 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/policies_operations.py @@ -15,8 +15,8 @@ from .. import models -class PolicyOperations(object): - """PolicyOperations operations. +class PoliciesOperations(object): + """PoliciesOperations operations. :param client: Client for service requests. :param config: Configuration of service client. @@ -36,9 +36,9 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def get_by_billing_profile( + def get_by_billing_profile_name( self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): - """The policy for a given billingAccountName and billingProfileName. + """The policy for a given billing account name and billing profile name. :param billing_account_name: billing Account Id. :type billing_account_name: str @@ -56,7 +56,7 @@ def get_by_billing_profile( :class:`ErrorResponseException` """ # Construct URL - url = self.get_by_billing_profile.metadata['url'] + url = self.get_by_billing_profile_name.metadata['url'] path_format_arguments = { 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') @@ -94,7 +94,7 @@ def get_by_billing_profile( return client_raw_response return deserialized - get_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default'} + get_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default'} def update( self, billing_account_name, billing_profile_name, parameters, custom_headers=None, raw=False, **operation_config): diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_pricesheet_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py similarity index 97% rename from azure-mgmt-billing/azure/mgmt/billing/operations/invoice_pricesheet_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py index 82914f0724ca..b2e7e67f49b5 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_pricesheet_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py @@ -17,8 +17,8 @@ from .. import models -class InvoicePricesheetOperations(object): - """InvoicePricesheetOperations operations. +class PriceSheetOperations(object): + """PriceSheetOperations operations. :param client: Client for service requests. :param config: Configuration of service client. @@ -91,7 +91,7 @@ def _download_initial( def download( self, billing_account_name, invoice_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Get pricesheet data for invoice id (invoiceName). + """Download price sheet for an invoice. :param billing_account_name: Azure Billing Account ID. :type billing_account_name: str diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_account_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_account_operations.py deleted file mode 100644 index e8501d24a68c..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_account_operations.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class ProductsByBillingAccountOperations(object): - """ProductsByBillingAccountOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, billing_account_name, filter=None, custom_headers=None, raw=False, **operation_config): - """Lists products by billingAccountName. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param filter: May be used to filter by product type. The filter - supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - string where key and value is separated by a colon (:). - :type filter: 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: An iterator like instance of ProductSummary - :rtype: - ~azure.mgmt.billing.models.ProductSummaryPaged[~azure.mgmt.billing.models.ProductSummary] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ProductSummaryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ProductSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_subscriptions_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_subscriptions_operations.py deleted file mode 100644 index 44caf3354c61..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_subscriptions_operations.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class ProductsByBillingSubscriptionsOperations(object): - """ProductsByBillingSubscriptionsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, billing_account_name, custom_headers=None, raw=False, **operation_config): - """Lists billing subscriptions by billingAccountName. - - :param billing_account_name: billing Account Id. - :type billing_account_name: 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: An iterator like instance of BillingSubscriptionSummary - :rtype: - ~azure.mgmt.billing.models.BillingSubscriptionSummaryPaged[~azure.mgmt.billing.models.BillingSubscriptionSummary] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.BillingSubscriptionSummaryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.BillingSubscriptionSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_invoice_section_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_invoice_section_operations.py deleted file mode 100644 index 8f9605d27e35..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_invoice_section_operations.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class ProductsByInvoiceSectionOperations(object): - """ProductsByInvoiceSectionOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, billing_account_name, invoice_section_name, filter=None, custom_headers=None, raw=False, **operation_config): - """Lists products by invoiceSectionName. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param invoice_section_name: InvoiceSection Id. - :type invoice_section_name: str - :param filter: May be used to filter by product type. The filter - supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - string where key and value is separated by a colon (:). - :type filter: 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: ProductsListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.ProductsListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ProductsListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py index 2fa6497a7f1c..94d18ee0f768 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py @@ -36,6 +36,145 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def list_by_billing_account_name( + self, billing_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists products by billing account name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param filter: May be used to filter by product type. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: 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: An iterator like instance of ProductSummary + :rtype: + ~azure.mgmt.billing.models.ProductSummaryPaged[~azure.mgmt.billing.models.ProductSummary] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_billing_account_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ProductSummaryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ProductSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products'} + + def list_by_invoice_section_name( + self, billing_account_name, invoice_section_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists products by invoice section name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param filter: May be used to filter by product type. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: 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: ProductsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.ProductsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_invoice_section_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ProductsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products'} + def get( self, billing_account_name, invoice_section_name, product_name, custom_headers=None, raw=False, **operation_config): """Get a single product by name. @@ -101,7 +240,7 @@ def get( def transfer( self, billing_account_name, invoice_section_name, product_name, destination_invoice_section_id=None, custom_headers=None, raw=False, **operation_config): - """The operation to transfer a Product to another InvoiceSection. + """The operation to transfer a Product to another invoice section. :param billing_account_name: billing Account Id. :type billing_account_name: str @@ -176,3 +315,146 @@ def transfer( return deserialized transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}/transfer'} + + def update_auto_renew_by_billing_account_name( + self, billing_account_name, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): + """Cancel auto renew for product by product id and billing account name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param product_name: Invoice Id. + :type product_name: str + :param auto_renew: Request parameters to update auto renew policy a + product. Possible values include: 'true', 'false' + :type auto_renew: str or ~azure.mgmt.billing.models.UpdateAutoRenew + :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: UpdateAutoRenewOperationSummary or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.UpdateAutoRenewOperationSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + body = models.UpdateAutoRenewRequest(auto_renew=auto_renew) + + # Construct URL + url = self.update_auto_renew_by_billing_account_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'productName': self._serialize.url("product_name", product_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'UpdateAutoRenewRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('UpdateAutoRenewOperationSummary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_auto_renew_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/updateAutoRenew'} + + def update_auto_renew_by_invoice_section_name( + self, billing_account_name, invoice_section_name, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): + """Cancel auto renew for product by product id and invoice section name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param product_name: Invoice Id. + :type product_name: str + :param auto_renew: Request parameters to update auto renew policy a + product. Possible values include: 'true', 'false' + :type auto_renew: str or ~azure.mgmt.billing.models.UpdateAutoRenew + :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: UpdateAutoRenewOperationSummary or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.UpdateAutoRenewOperationSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + body = models.UpdateAutoRenewRequest(auto_renew=auto_renew) + + # Construct URL + url = self.update_auto_renew_by_invoice_section_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'productName': self._serialize.url("product_name", product_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'UpdateAutoRenewRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('UpdateAutoRenewOperationSummary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_auto_renew_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}/updateAutoRenew'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_account_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_account_operations.py deleted file mode 100644 index 815440c4613b..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_account_operations.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class TransactionsByBillingAccountOperations(object): - """TransactionsByBillingAccountOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, billing_account_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): - """Lists the transactions by billingAccountName for given start and end - date. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param start_date: Start date - :type start_date: str - :param end_date: End date - :type end_date: str - :param filter: May be used to filter by transaction kind. The filter - supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - string where key and value is separated by a colon (:). - :type filter: 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: An iterator like instance of TransactionsSummary - :rtype: - ~azure.mgmt.billing.models.TransactionsSummaryPaged[~azure.mgmt.billing.models.TransactionsSummary] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') - query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.TransactionsSummaryPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.TransactionsSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/transactions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_profile_operations.py deleted file mode 100644 index 7361a8c6a7cb..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_profile_operations.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class TransactionsByBillingProfileOperations(object): - """TransactionsByBillingProfileOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, billing_account_name, billing_profile_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): - """Lists the transactions by billingProfileName for given start date and - end date. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param billing_profile_name: Billing Profile Id. - :type billing_profile_name: str - :param start_date: Start date - :type start_date: str - :param end_date: End date - :type end_date: str - :param filter: May be used to filter by transaction kind. The filter - supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - string where key and value is separated by a colon (:). - :type filter: 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: TransactionsListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.TransactionsListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') - query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('TransactionsListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/transactions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_invoice_section_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_invoice_section_operations.py deleted file mode 100644 index 7ecf28a61874..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_invoice_section_operations.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) 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 .. import models - - -class TransactionsByInvoiceSectionOperations(object): - """TransactionsByInvoiceSectionOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01-preview" - - self.config = config - - def list( - self, billing_account_name, invoice_section_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): - """Lists the transactions by invoiceSectionName for given start date and - end date. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param invoice_section_name: InvoiceSection Id. - :type invoice_section_name: str - :param start_date: Start date - :type start_date: str - :param end_date: End date - :type end_date: str - :param filter: May be used to filter by transaction kind. The filter - supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - string where key and value is separated by a colon (:). - :type filter: 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: TransactionsListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.TransactionsListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') - query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('TransactionsListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transactions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py new file mode 100644 index 000000000000..3b5566d34793 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py @@ -0,0 +1,264 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TransactionsOperations(object): + """TransactionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list_by_billing_account_name( + self, billing_account_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the transactions by billing account name for given start and end + date. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param start_date: Start date + :type start_date: str + :param end_date: End date + :type end_date: str + :param filter: May be used to filter by transaction kind. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: 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: An iterator like instance of TransactionsSummary + :rtype: + ~azure.mgmt.billing.models.TransactionsSummaryPaged[~azure.mgmt.billing.models.TransactionsSummary] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_billing_account_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.TransactionsSummaryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TransactionsSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/transactions'} + + def list_by_billing_profile_name( + self, billing_account_name, billing_profile_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the transactions by billing profile name for given start date and + end date. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param start_date: Start date + :type start_date: str + :param end_date: End date + :type end_date: str + :param filter: May be used to filter by transaction kind. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: 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: TransactionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransactionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_billing_profile_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransactionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/transactions'} + + def list_by_invoice_section_name( + self, billing_account_name, invoice_section_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the transactions by invoice section name for given start date and + end date. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param start_date: Start date + :type start_date: str + :param end_date: End date + :type end_date: str + :param filter: May be used to filter by transaction kind. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: 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: TransactionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransactionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_invoice_section_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransactionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transactions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py index 7ab9cae9d90d..2daf9f4588e8 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py @@ -36,8 +36,7 @@ def __init__(self, client, config, serializer, deserializer): def initiate( self, billing_account_name, invoice_section_name, billing_profile_id=None, recipient_email_id=None, custom_headers=None, raw=False, **operation_config): - """Initiates the request to transfer the GTM or legacy subscriptions or - RIs to GTM. + """Initiates the request to transfer the legacy subscriptions or RIs. :param billing_account_name: billing Account Id. :type billing_account_name: str From 2e770bb5d221c9d11a2a339d74b0dfb466319e4f Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 21 May 2019 19:43:18 +0000 Subject: [PATCH 10/15] Packaging update of azure-mgmt-billing --- azure-mgmt-billing/MANIFEST.in | 1 + azure-mgmt-billing/README.rst | 2 +- azure-mgmt-billing/setup.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/azure-mgmt-billing/MANIFEST.in b/azure-mgmt-billing/MANIFEST.in index 855ea9c48a82..e4884efef41b 100644 --- a/azure-mgmt-billing/MANIFEST.in +++ b/azure-mgmt-billing/MANIFEST.in @@ -2,3 +2,4 @@ recursive-include tests *.py *.yaml include *.rst include azure/__init__.py include azure/mgmt/__init__.py + diff --git a/azure-mgmt-billing/README.rst b/azure-mgmt-billing/README.rst index 8997ab6311b3..b68710c15df4 100644 --- a/azure-mgmt-billing/README.rst +++ b/azure-mgmt-billing/README.rst @@ -1,7 +1,7 @@ Microsoft Azure SDK for Python ============================== -This is the Microsoft Azure MyService Management Client Library. +This is the Microsoft Azure Billing Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). diff --git a/azure-mgmt-billing/setup.py b/azure-mgmt-billing/setup.py index 946b7232e50d..f1e8b973210f 100644 --- a/azure-mgmt-billing/setup.py +++ b/azure-mgmt-billing/setup.py @@ -13,7 +13,7 @@ # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-mgmt-billing" -PACKAGE_PPRINT_NAME = "MyService Management" +PACKAGE_PPRINT_NAME = "Billing" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') From 944609b7c653873e59a91c6c7518b08394a46e8e Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Tue, 21 May 2019 12:44:05 -0700 Subject: [PATCH 11/15] Billing new folder --- .../billing/azure-mgmt-billing}/HISTORY.rst | 0 .../billing/azure-mgmt-billing}/MANIFEST.in | 0 {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/README.rst | 0 .../billing/azure-mgmt-billing}/azure/__init__.py | 0 .../billing/azure-mgmt-billing}/azure/mgmt/__init__.py | 0 .../billing/azure-mgmt-billing}/azure/mgmt/billing/__init__.py | 0 .../azure/mgmt/billing/billing_management_client.py | 0 .../azure-mgmt-billing}/azure/mgmt/billing/models/__init__.py | 0 .../azure/mgmt/billing/models/accept_transfer_request.py | 0 .../azure/mgmt/billing/models/accept_transfer_request_py3.py | 0 .../azure-mgmt-billing}/azure/mgmt/billing/models/address.py | 0 .../azure-mgmt-billing}/azure/mgmt/billing/models/address_py3.py | 0 .../azure-mgmt-billing}/azure/mgmt/billing/models/agreement.py | 0 .../azure/mgmt/billing/models/agreement_list_result.py | 0 .../azure/mgmt/billing/models/agreement_list_result_py3.py | 0 .../azure/mgmt/billing/models/agreement_py3.py | 0 .../azure-mgmt-billing}/azure/mgmt/billing/models/amount.py | 0 .../azure-mgmt-billing}/azure/mgmt/billing/models/amount_py3.py | 0 .../azure/mgmt/billing/models/available_balance.py | 0 .../azure/mgmt/billing/models/available_balance_py3.py | 0 .../azure/mgmt/billing/models/billing_account.py | 0 .../azure/mgmt/billing/models/billing_account_list_result.py | 0 .../azure/mgmt/billing/models/billing_account_list_result_py3.py | 0 .../azure/mgmt/billing/models/billing_account_py3.py | 0 .../azure/mgmt/billing/models/billing_management_client_enums.py | 0 .../azure/mgmt/billing/models/billing_permissions_list_result.py | 0 .../mgmt/billing/models/billing_permissions_list_result_py3.py | 0 .../azure/mgmt/billing/models/billing_permissions_properties.py | 0 .../mgmt/billing/models/billing_permissions_properties_py3.py | 0 .../azure/mgmt/billing/models/billing_profile.py | 0 .../azure/mgmt/billing/models/billing_profile_list_result.py | 0 .../azure/mgmt/billing/models/billing_profile_list_result_py3.py | 0 .../azure/mgmt/billing/models/billing_profile_py3.py | 0 .../azure/mgmt/billing/models/billing_property.py | 0 .../azure/mgmt/billing/models/billing_property_py3.py | 0 .../azure/mgmt/billing/models/billing_role_assignment.py | 0 .../mgmt/billing/models/billing_role_assignment_list_result.py | 0 .../billing/models/billing_role_assignment_list_result_py3.py | 0 .../azure/mgmt/billing/models/billing_role_assignment_payload.py | 0 .../mgmt/billing/models/billing_role_assignment_payload_py3.py | 0 .../azure/mgmt/billing/models/billing_role_assignment_py3.py | 0 .../azure/mgmt/billing/models/billing_role_definition.py | 0 .../mgmt/billing/models/billing_role_definition_list_result.py | 0 .../billing/models/billing_role_definition_list_result_py3.py | 0 .../azure/mgmt/billing/models/billing_role_definition_py3.py | 0 .../azure/mgmt/billing/models/billing_subscription_summary.py | 0 .../mgmt/billing/models/billing_subscription_summary_paged.py | 0 .../azure/mgmt/billing/models/billing_subscription_summary_py3.py | 0 .../mgmt/billing/models/billing_subscriptions_list_result.py | 0 .../mgmt/billing/models/billing_subscriptions_list_result_py3.py | 0 .../azure-mgmt-billing}/azure/mgmt/billing/models/department.py | 0 .../azure/mgmt/billing/models/department_list_result.py | 0 .../azure/mgmt/billing/models/department_list_result_py3.py | 0 .../azure/mgmt/billing/models/department_py3.py | 0 .../azure/mgmt/billing/models/detailed_transfer_status.py | 0 .../azure/mgmt/billing/models/detailed_transfer_status_py3.py | 0 .../azure/mgmt/billing/models/download_properties.py | 0 .../azure/mgmt/billing/models/download_properties_py3.py | 0 .../azure-mgmt-billing}/azure/mgmt/billing/models/download_url.py | 0 .../azure/mgmt/billing/models/download_url_py3.py | 0 .../azure/mgmt/billing/models/enabled_azure_sk_us.py | 0 .../azure/mgmt/billing/models/enabled_azure_sk_us_py3.py | 0 .../azure-mgmt-billing}/azure/mgmt/billing/models/enrollment.py | 0 .../azure/mgmt/billing/models/enrollment_account.py | 0 .../azure/mgmt/billing/models/enrollment_account_context.py | 0 .../azure/mgmt/billing/models/enrollment_account_context_py3.py | 0 .../azure/mgmt/billing/models/enrollment_account_list_result.py | 0 .../mgmt/billing/models/enrollment_account_list_result_py3.py | 0 .../azure/mgmt/billing/models/enrollment_account_py3.py | 0 .../azure/mgmt/billing/models/enrollment_policies.py | 0 .../azure/mgmt/billing/models/enrollment_policies_py3.py | 0 .../azure/mgmt/billing/models/enrollment_py3.py | 0 .../azure-mgmt-billing}/azure/mgmt/billing/models/error.py | 0 .../azure/mgmt/billing/models/error_details.py | 0 .../azure/mgmt/billing/models/error_details_py3.py | 0 .../azure-mgmt-billing}/azure/mgmt/billing/models/error_py3.py | 0 .../azure/mgmt/billing/models/error_response.py | 0 .../azure/mgmt/billing/models/error_response_py3.py | 0 .../azure/mgmt/billing/models/initiate_transfer_request.py | 0 .../azure/mgmt/billing/models/initiate_transfer_request_py3.py | 0 .../azure/mgmt/billing/models/invoice_list_result.py | 0 .../azure/mgmt/billing/models/invoice_list_result_py3.py | 0 .../azure/mgmt/billing/models/invoice_section.py | 0 .../azure/mgmt/billing/models/invoice_section_list_result.py | 0 .../azure/mgmt/billing/models/invoice_section_list_result_py3.py | 0 .../azure/mgmt/billing/models/invoice_section_properties.py | 0 .../azure/mgmt/billing/models/invoice_section_properties_py3.py | 0 .../azure/mgmt/billing/models/invoice_section_py3.py | 0 .../azure/mgmt/billing/models/invoice_summary.py | 0 .../azure/mgmt/billing/models/invoice_summary_py3.py | 0 .../azure-mgmt-billing}/azure/mgmt/billing/models/operation.py | 0 .../azure/mgmt/billing/models/operation_display.py | 0 .../azure/mgmt/billing/models/operation_display_py3.py | 0 .../azure/mgmt/billing/models/operation_paged.py | 0 .../azure/mgmt/billing/models/operation_py3.py | 0 .../azure/mgmt/billing/models/operation_status.py | 0 .../azure/mgmt/billing/models/operation_status_py3.py | 0 .../azure-mgmt-billing}/azure/mgmt/billing/models/participants.py | 0 .../azure/mgmt/billing/models/participants_py3.py | 0 .../azure/mgmt/billing/models/payment_method.py | 0 .../azure/mgmt/billing/models/payment_method_paged.py | 0 .../azure/mgmt/billing/models/payment_method_py3.py | 0 .../azure/mgmt/billing/models/payment_properties.py | 0 .../azure/mgmt/billing/models/payment_properties_py3.py | 0 .../azure-mgmt-billing}/azure/mgmt/billing/models/policy.py | 0 .../azure-mgmt-billing}/azure/mgmt/billing/models/policy_py3.py | 0 .../azure/mgmt/billing/models/product_details.py | 0 .../azure/mgmt/billing/models/product_details_py3.py | 0 .../azure/mgmt/billing/models/product_summary.py | 0 .../azure/mgmt/billing/models/product_summary_paged.py | 0 .../azure/mgmt/billing/models/product_summary_py3.py | 0 .../azure/mgmt/billing/models/products_list_result.py | 0 .../azure/mgmt/billing/models/products_list_result_py3.py | 0 .../azure/mgmt/billing/models/recipient_transfer_details.py | 0 .../azure/mgmt/billing/models/recipient_transfer_details_paged.py | 0 .../azure/mgmt/billing/models/recipient_transfer_details_py3.py | 0 .../azure-mgmt-billing}/azure/mgmt/billing/models/resource.py | 0 .../azure-mgmt-billing}/azure/mgmt/billing/models/resource_py3.py | 0 .../azure/mgmt/billing/models/transactions_list_result.py | 0 .../azure/mgmt/billing/models/transactions_list_result_py3.py | 0 .../azure/mgmt/billing/models/transactions_summary.py | 0 .../azure/mgmt/billing/models/transactions_summary_paged.py | 0 .../azure/mgmt/billing/models/transactions_summary_py3.py | 0 .../mgmt/billing/models/transfer_billing_subscription_request.py | 0 .../models/transfer_billing_subscription_request_properties.py | 0 .../transfer_billing_subscription_request_properties_py3.py | 0 .../billing/models/transfer_billing_subscription_request_py3.py | 0 .../mgmt/billing/models/transfer_billing_subscription_result.py | 0 .../billing/models/transfer_billing_subscription_result_py3.py | 0 .../azure/mgmt/billing/models/transfer_details.py | 0 .../azure/mgmt/billing/models/transfer_details_paged.py | 0 .../azure/mgmt/billing/models/transfer_details_py3.py | 0 .../mgmt/billing/models/transfer_product_request_properties.py | 0 .../billing/models/transfer_product_request_properties_py3.py | 0 .../mgmt/billing/models/update_auto_renew_operation_summary.py | 0 .../billing/models/update_auto_renew_operation_summary_py3.py | 0 .../azure/mgmt/billing/models/update_auto_renew_request.py | 0 .../azure/mgmt/billing/models/update_auto_renew_request_py3.py | 0 .../azure-mgmt-billing}/azure/mgmt/billing/operations/__init__.py | 0 .../azure/mgmt/billing/operations/agreements_operations.py | 0 .../mgmt/billing/operations/available_balances_operations.py | 0 .../azure/mgmt/billing/operations/billing_accounts_operations.py | 0 .../mgmt/billing/operations/billing_permissions_operations.py | 0 .../azure/mgmt/billing/operations/billing_profiles_operations.py | 0 .../azure/mgmt/billing/operations/billing_property_operations.py | 0 .../billing/operations/billing_role_assignments_operations.py | 0 .../billing/operations/billing_role_definitions_operations.py | 0 .../mgmt/billing/operations/billing_subscriptions_operations.py | 0 .../azure/mgmt/billing/operations/departments_operations.py | 0 .../mgmt/billing/operations/enrollment_accounts_operations.py | 0 .../azure/mgmt/billing/operations/invoice_sections_operations.py | 0 .../azure/mgmt/billing/operations/invoices_operations.py | 0 .../azure/mgmt/billing/operations/operations.py | 0 .../azure/mgmt/billing/operations/payment_methods_operations.py | 0 .../azure/mgmt/billing/operations/policies_operations.py | 0 .../azure/mgmt/billing/operations/price_sheet_operations.py | 0 .../azure/mgmt/billing/operations/products_operations.py | 0 .../mgmt/billing/operations/recipient_transfers_operations.py | 0 .../azure/mgmt/billing/operations/transactions_operations.py | 0 .../azure/mgmt/billing/operations/transfers_operations.py | 0 .../billing/azure-mgmt-billing}/azure/mgmt/billing/version.py | 0 .../billing/azure-mgmt-billing}/dev_requirements.txt | 0 .../billing/azure-mgmt-billing}/sdk_packaging.toml | 0 {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/setup.cfg | 0 {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/setup.py | 0 .../test_mgmt_billing.test_billing_enrollment_accounts_list.yaml | 0 .../recordings/test_mgmt_billing.test_billing_invoice_latest.yaml | 0 .../test_mgmt_billing.test_billing_invoice_list_filter.yaml | 0 .../test_mgmt_billing.test_billing_invoice_list_generate_url.yaml | 0 .../test_mgmt_billing.test_billing_invoice_list_get.yaml | 0 .../test_mgmt_billing.test_billing_invoice_list_top.yaml | 0 .../test_mgmt_billing.test_billing_period_list_filter.yaml | 0 .../test_mgmt_billing.test_billing_period_list_get.yaml | 0 .../test_mgmt_billing.test_billing_period_list_top.yaml | 0 .../billing/azure-mgmt-billing}/tests/test_mgmt_billing.py | 0 175 files changed, 0 insertions(+), 0 deletions(-) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/HISTORY.rst (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/MANIFEST.in (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/README.rst (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/__init__.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/__init__.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/__init__.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/billing_management_client.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/__init__.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/accept_transfer_request.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/accept_transfer_request_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/address.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/address_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/agreement.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/agreement_list_result.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/agreement_list_result_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/agreement_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/amount.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/amount_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/available_balance.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/available_balance_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_account.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_account_list_result.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_account_list_result_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_account_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_management_client_enums.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_permissions_list_result.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_permissions_list_result_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_permissions_properties.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_permissions_properties_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_profile.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_profile_list_result.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_profile_list_result_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_profile_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_property.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_property_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_role_assignment.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_role_assignment_list_result.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_role_assignment_list_result_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_role_assignment_payload.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_role_assignment_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_role_definition.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_role_definition_list_result.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_role_definition_list_result_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_role_definition_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_subscription_summary.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_subscription_summary_paged.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_subscription_summary_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_subscriptions_list_result.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/department.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/department_list_result.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/department_list_result_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/department_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/detailed_transfer_status.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/detailed_transfer_status_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/download_properties.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/download_properties_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/download_url.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/download_url_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/enabled_azure_sk_us.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/enrollment.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/enrollment_account.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/enrollment_account_context.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/enrollment_account_context_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/enrollment_account_list_result.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/enrollment_account_list_result_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/enrollment_account_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/enrollment_policies.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/enrollment_policies_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/enrollment_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/error.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/error_details.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/error_details_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/error_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/error_response.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/error_response_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/initiate_transfer_request.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/initiate_transfer_request_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/invoice_list_result.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/invoice_list_result_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/invoice_section.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/invoice_section_list_result.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/invoice_section_list_result_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/invoice_section_properties.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/invoice_section_properties_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/invoice_section_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/invoice_summary.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/invoice_summary_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/operation.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/operation_display.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/operation_display_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/operation_paged.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/operation_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/operation_status.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/operation_status_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/participants.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/participants_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/payment_method.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/payment_method_paged.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/payment_method_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/payment_properties.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/payment_properties_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/policy.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/policy_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/product_details.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/product_details_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/product_summary.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/product_summary_paged.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/product_summary_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/products_list_result.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/products_list_result_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/recipient_transfer_details.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/recipient_transfer_details_paged.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/recipient_transfer_details_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/resource.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/resource_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/transactions_list_result.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/transactions_list_result_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/transactions_summary.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/transactions_summary_paged.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/transactions_summary_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/transfer_billing_subscription_request.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/transfer_billing_subscription_result.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/transfer_billing_subscription_result_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/transfer_details.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/transfer_details_paged.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/transfer_details_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/transfer_product_request_properties.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/transfer_product_request_properties_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/update_auto_renew_operation_summary.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/update_auto_renew_operation_summary_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/update_auto_renew_request.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/models/update_auto_renew_request_py3.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/__init__.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/agreements_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/available_balances_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/billing_accounts_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/billing_permissions_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/billing_profiles_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/billing_property_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/billing_role_assignments_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/billing_role_definitions_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/billing_subscriptions_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/departments_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/enrollment_accounts_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/invoice_sections_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/invoices_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/payment_methods_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/policies_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/price_sheet_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/products_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/recipient_transfers_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/transactions_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/operations/transfers_operations.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/azure/mgmt/billing/version.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/dev_requirements.txt (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/sdk_packaging.toml (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/setup.cfg (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/setup.py (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/tests/recordings/test_mgmt_billing.test_billing_enrollment_accounts_list.yaml (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/tests/recordings/test_mgmt_billing.test_billing_invoice_latest.yaml (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/tests/recordings/test_mgmt_billing.test_billing_invoice_list_filter.yaml (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/tests/recordings/test_mgmt_billing.test_billing_invoice_list_generate_url.yaml (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/tests/recordings/test_mgmt_billing.test_billing_invoice_list_get.yaml (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/tests/recordings/test_mgmt_billing.test_billing_invoice_list_top.yaml (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/tests/recordings/test_mgmt_billing.test_billing_period_list_filter.yaml (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/tests/recordings/test_mgmt_billing.test_billing_period_list_get.yaml (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/tests/recordings/test_mgmt_billing.test_billing_period_list_top.yaml (100%) rename {azure-mgmt-billing => sdk/billing/azure-mgmt-billing}/tests/test_mgmt_billing.py (100%) diff --git a/azure-mgmt-billing/HISTORY.rst b/sdk/billing/azure-mgmt-billing/HISTORY.rst similarity index 100% rename from azure-mgmt-billing/HISTORY.rst rename to sdk/billing/azure-mgmt-billing/HISTORY.rst diff --git a/azure-mgmt-billing/MANIFEST.in b/sdk/billing/azure-mgmt-billing/MANIFEST.in similarity index 100% rename from azure-mgmt-billing/MANIFEST.in rename to sdk/billing/azure-mgmt-billing/MANIFEST.in diff --git a/azure-mgmt-billing/README.rst b/sdk/billing/azure-mgmt-billing/README.rst similarity index 100% rename from azure-mgmt-billing/README.rst rename to sdk/billing/azure-mgmt-billing/README.rst diff --git a/azure-mgmt-billing/azure/__init__.py b/sdk/billing/azure-mgmt-billing/azure/__init__.py similarity index 100% rename from azure-mgmt-billing/azure/__init__.py rename to sdk/billing/azure-mgmt-billing/azure/__init__.py diff --git a/azure-mgmt-billing/azure/mgmt/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/__init__.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/__init__.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/__init__.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/__init__.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/__init__.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/__init__.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/__init__.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/address.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/address.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/address_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/address_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/agreement.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/agreement.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/agreement_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/agreement_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/amount.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/amount.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/amount.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/amount.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/amount_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/amount_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/amount_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/amount_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/available_balance.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/available_balance.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/available_balance.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/available_balance.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/available_balance_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/available_balance_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/available_balance_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/available_balance_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_properties.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_properties.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_properties.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_properties.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_properties_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_properties_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_properties_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_properties_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_paged.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_paged.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_paged.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/department.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/department.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/department.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/department.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/department_list_result.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/department_list_result_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/department_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/department_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/department_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/department_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/download_properties.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_properties.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/download_properties.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_properties.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/download_properties_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_properties_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/download_properties_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_properties_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/download_url.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_url.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/download_url.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_url.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/download_url_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_url_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/download_url_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_url_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/enrollment.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/enrollment_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/error.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/error.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/error_details.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_details.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/error_details.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_details.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/error_details_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_details_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/error_details_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_details_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/error_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/error_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/error_response.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_response.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/error_response.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_response.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/error_response_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_response_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/error_response_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_response_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/operation.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/operation.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/operation_display.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_display.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/operation_display.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_display.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/operation_display_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_display_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/operation_display_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_display_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/operation_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_paged.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/operation_paged.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_paged.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/operation_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/operation_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/operation_status.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_status.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/operation_status.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_status.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/participants.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/participants.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/participants.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/participants.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/participants_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/participants_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/participants_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/participants_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_paged.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/payment_method_paged.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_paged.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/payment_properties.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/payment_properties_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/policy.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/policy.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/product_details.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_details.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/product_details.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_details.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/product_details_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_details_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/product_details_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_details_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/product_summary.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/product_summary.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_paged.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/product_summary_paged.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_paged.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/product_summary_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/products_list_result.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/products_list_result_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_paged.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_paged.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_paged.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/resource.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/resource.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/resource.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/resource.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/resource_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/resource_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/resource_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/resource_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_paged.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_paged.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_paged.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_paged.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_paged.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_paged.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request_py3.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request_py3.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/agreements_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/agreements_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/agreements_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/agreements_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/available_balances_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/available_balances_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/available_balances_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/available_balances_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_property_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_property_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/billing_property_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_property_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_definitions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_definitions_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_definitions_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_definitions_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/policies_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/policies_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/policies_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/policies_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/version.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/version.py similarity index 100% rename from azure-mgmt-billing/azure/mgmt/billing/version.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/version.py diff --git a/azure-mgmt-billing/dev_requirements.txt b/sdk/billing/azure-mgmt-billing/dev_requirements.txt similarity index 100% rename from azure-mgmt-billing/dev_requirements.txt rename to sdk/billing/azure-mgmt-billing/dev_requirements.txt diff --git a/azure-mgmt-billing/sdk_packaging.toml b/sdk/billing/azure-mgmt-billing/sdk_packaging.toml similarity index 100% rename from azure-mgmt-billing/sdk_packaging.toml rename to sdk/billing/azure-mgmt-billing/sdk_packaging.toml diff --git a/azure-mgmt-billing/setup.cfg b/sdk/billing/azure-mgmt-billing/setup.cfg similarity index 100% rename from azure-mgmt-billing/setup.cfg rename to sdk/billing/azure-mgmt-billing/setup.cfg diff --git a/azure-mgmt-billing/setup.py b/sdk/billing/azure-mgmt-billing/setup.py similarity index 100% rename from azure-mgmt-billing/setup.py rename to sdk/billing/azure-mgmt-billing/setup.py diff --git a/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_enrollment_accounts_list.yaml b/sdk/billing/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_enrollment_accounts_list.yaml similarity index 100% rename from azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_enrollment_accounts_list.yaml rename to sdk/billing/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_enrollment_accounts_list.yaml diff --git a/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_latest.yaml b/sdk/billing/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_latest.yaml similarity index 100% rename from azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_latest.yaml rename to sdk/billing/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_latest.yaml diff --git a/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_list_filter.yaml b/sdk/billing/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_list_filter.yaml similarity index 100% rename from azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_list_filter.yaml rename to sdk/billing/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_list_filter.yaml diff --git a/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_list_generate_url.yaml b/sdk/billing/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_list_generate_url.yaml similarity index 100% rename from azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_list_generate_url.yaml rename to sdk/billing/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_list_generate_url.yaml diff --git a/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_list_get.yaml b/sdk/billing/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_list_get.yaml similarity index 100% rename from azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_list_get.yaml rename to sdk/billing/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_list_get.yaml diff --git a/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_list_top.yaml b/sdk/billing/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_list_top.yaml similarity index 100% rename from azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_list_top.yaml rename to sdk/billing/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_invoice_list_top.yaml diff --git a/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_period_list_filter.yaml b/sdk/billing/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_period_list_filter.yaml similarity index 100% rename from azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_period_list_filter.yaml rename to sdk/billing/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_period_list_filter.yaml diff --git a/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_period_list_get.yaml b/sdk/billing/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_period_list_get.yaml similarity index 100% rename from azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_period_list_get.yaml rename to sdk/billing/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_period_list_get.yaml diff --git a/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_period_list_top.yaml b/sdk/billing/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_period_list_top.yaml similarity index 100% rename from azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_period_list_top.yaml rename to sdk/billing/azure-mgmt-billing/tests/recordings/test_mgmt_billing.test_billing_period_list_top.yaml diff --git a/azure-mgmt-billing/tests/test_mgmt_billing.py b/sdk/billing/azure-mgmt-billing/tests/test_mgmt_billing.py similarity index 100% rename from azure-mgmt-billing/tests/test_mgmt_billing.py rename to sdk/billing/azure-mgmt-billing/tests/test_mgmt_billing.py From 060b297bbaac6541ac299223516be79545998ece Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Tue, 21 May 2019 12:44:26 -0700 Subject: [PATCH 12/15] test req update --- sdk/billing/azure-mgmt-billing/dev_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/billing/azure-mgmt-billing/dev_requirements.txt b/sdk/billing/azure-mgmt-billing/dev_requirements.txt index 331cfed8ea26..1f0e0d86b735 100644 --- a/sdk/billing/azure-mgmt-billing/dev_requirements.txt +++ b/sdk/billing/azure-mgmt-billing/dev_requirements.txt @@ -1 +1 @@ --e ../azure-sdk-tools +-e ../../../azure-sdk-tools From 8bc8fd40bd39d7f912d23bc1d0447a6af7933683 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 21 May 2019 12:52:25 -0700 Subject: [PATCH 13/15] Generated from 55bbc305f998f86739cd04cd9c6209cfd39ebf9e (#5384) Billing new Py path --- .../mgmt/billing/billing_management_client.py | 10 +-- .../azure/mgmt/billing/operations/__init__.py | 4 +- .../operations/payment_methods_operations.py | 65 +++++++++++++++++++ .../azure/mgmt/billing/version.py | 2 +- 4 files changed, 73 insertions(+), 8 deletions(-) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index a49bf0441ae7..486e6ac5d4e0 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -14,8 +14,8 @@ from msrestazure import AzureConfiguration from .version import VERSION from .operations.billing_accounts_operations import BillingAccountsOperations -from .operations.available_balances_operations import AvailableBalancesOperations from .operations.payment_methods_operations import PaymentMethodsOperations +from .operations.available_balances_operations import AvailableBalancesOperations from .operations.billing_profiles_operations import BillingProfilesOperations from .operations.invoice_sections_operations import InvoiceSectionsOperations from .operations.departments_operations import DepartmentsOperations @@ -77,10 +77,10 @@ class BillingManagementClient(SDKClient): :ivar billing_accounts: BillingAccounts operations :vartype billing_accounts: azure.mgmt.billing.operations.BillingAccountsOperations - :ivar available_balances: AvailableBalances operations - :vartype available_balances: azure.mgmt.billing.operations.AvailableBalancesOperations :ivar payment_methods: PaymentMethods operations :vartype payment_methods: azure.mgmt.billing.operations.PaymentMethodsOperations + :ivar available_balances: AvailableBalances operations + :vartype available_balances: azure.mgmt.billing.operations.AvailableBalancesOperations :ivar billing_profiles: BillingProfiles operations :vartype billing_profiles: azure.mgmt.billing.operations.BillingProfilesOperations :ivar invoice_sections: InvoiceSections operations @@ -139,10 +139,10 @@ def __init__( self.billing_accounts = BillingAccountsOperations( self._client, self.config, self._serialize, self._deserialize) - self.available_balances = AvailableBalancesOperations( - self._client, self.config, self._serialize, self._deserialize) self.payment_methods = PaymentMethodsOperations( self._client, self.config, self._serialize, self._deserialize) + self.available_balances = AvailableBalancesOperations( + self._client, self.config, self._serialize, self._deserialize) self.billing_profiles = BillingProfilesOperations( self._client, self.config, self._serialize, self._deserialize) self.invoice_sections = InvoiceSectionsOperations( diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index 43e0ca5a30f8..db4077cbc9c5 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -10,8 +10,8 @@ # -------------------------------------------------------------------------- from .billing_accounts_operations import BillingAccountsOperations -from .available_balances_operations import AvailableBalancesOperations from .payment_methods_operations import PaymentMethodsOperations +from .available_balances_operations import AvailableBalancesOperations from .billing_profiles_operations import BillingProfilesOperations from .invoice_sections_operations import InvoiceSectionsOperations from .departments_operations import DepartmentsOperations @@ -33,8 +33,8 @@ __all__ = [ 'BillingAccountsOperations', - 'AvailableBalancesOperations', 'PaymentMethodsOperations', + 'AvailableBalancesOperations', 'BillingProfilesOperations', 'InvoiceSectionsOperations', 'DepartmentsOperations', diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_operations.py index 0408e6426d5c..462791ae4262 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_operations.py @@ -36,6 +36,71 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def list_by_billing_account_name( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """Lists the Payment Methods by billing account Id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: 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: An iterator like instance of PaymentMethod + :rtype: + ~azure.mgmt.billing.models.PaymentMethodPaged[~azure.mgmt.billing.models.PaymentMethod] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_billing_account_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.PaymentMethodPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PaymentMethodPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/paymentMethods'} + def list_by_billing_profile_name( self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): """Lists the Payment Methods by billing profile Id. diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/version.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/version.py index 9bd1dfac7ecb..3e682bbd5fb1 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/version.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.2.0" +VERSION = "0.3.0" From eff17a4240e1bd5b2eaf05053ed88aca40924329 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Tue, 21 May 2019 13:28:39 -0700 Subject: [PATCH 14/15] Remove useless dev req --- azure-mgmt-subscription/dev_requirements.txt | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 azure-mgmt-subscription/dev_requirements.txt diff --git a/azure-mgmt-subscription/dev_requirements.txt b/azure-mgmt-subscription/dev_requirements.txt deleted file mode 100644 index f4897e568333..000000000000 --- a/azure-mgmt-subscription/dev_requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ --e ../azure-sdk-tools --e ../azure-mgmt-billing From bf7199f0bc07f53c44b5cd70f519f258091be10e Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 21 May 2019 15:44:44 -0700 Subject: [PATCH 15/15] Generated from f30066455311383f4de879eaf46966f976c41ac7 (#5392) resolved merge conflicts --- .../mgmt/billing/billing_management_client.py | 5 + .../azure/mgmt/billing/models/__init__.py | 11 +- .../models/billing_management_client_enums.py | 6 ++ .../models/validate_address_response.py | 37 +++++++ .../models/validate_address_response_py3.py | 37 +++++++ .../azure/mgmt/billing/operations/__init__.py | 2 + ...ng_accounts_validate_address_operations.py | 100 ++++++++++++++++++ 7 files changed, 195 insertions(+), 3 deletions(-) create mode 100644 sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response.py create mode 100644 sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response_py3.py create mode 100644 sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_validate_address_operations.py diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index 486e6ac5d4e0..7fc2d1222e12 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -15,6 +15,7 @@ from .version import VERSION from .operations.billing_accounts_operations import BillingAccountsOperations from .operations.payment_methods_operations import PaymentMethodsOperations +from .operations.billing_accounts_validate_address_operations import BillingAccountsValidateAddressOperations from .operations.available_balances_operations import AvailableBalancesOperations from .operations.billing_profiles_operations import BillingProfilesOperations from .operations.invoice_sections_operations import InvoiceSectionsOperations @@ -79,6 +80,8 @@ class BillingManagementClient(SDKClient): :vartype billing_accounts: azure.mgmt.billing.operations.BillingAccountsOperations :ivar payment_methods: PaymentMethods operations :vartype payment_methods: azure.mgmt.billing.operations.PaymentMethodsOperations + :ivar billing_accounts_validate_address: BillingAccountsValidateAddress operations + :vartype billing_accounts_validate_address: azure.mgmt.billing.operations.BillingAccountsValidateAddressOperations :ivar available_balances: AvailableBalances operations :vartype available_balances: azure.mgmt.billing.operations.AvailableBalancesOperations :ivar billing_profiles: BillingProfiles operations @@ -141,6 +144,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.payment_methods = PaymentMethodsOperations( self._client, self.config, self._serialize, self._deserialize) + self.billing_accounts_validate_address = BillingAccountsValidateAddressOperations( + self._client, self.config, self._serialize, self._deserialize) self.available_balances = AvailableBalancesOperations( self._client, self.config, self._serialize, self._deserialize) self.billing_profiles = BillingProfilesOperations( diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py index 140c186dbd06..09171ab8b99c 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py @@ -11,6 +11,8 @@ try: from .initiate_transfer_request_py3 import InitiateTransferRequest + from .address_py3 import Address + from .validate_address_response_py3 import ValidateAddressResponse from .product_details_py3 import ProductDetails from .accept_transfer_request_py3 import AcceptTransferRequest from .error_py3 import Error @@ -22,7 +24,6 @@ from .transfer_billing_subscription_request_properties_py3 import TransferBillingSubscriptionRequestProperties from .transfer_billing_subscription_request_py3 import TransferBillingSubscriptionRequest from .update_auto_renew_operation_summary_py3 import UpdateAutoRenewOperationSummary - from .address_py3 import Address from .enabled_azure_sk_us_py3 import EnabledAzureSKUs from .billing_profile_py3 import BillingProfile from .invoice_section_properties_py3 import InvoiceSectionProperties @@ -73,6 +74,8 @@ from .agreement_list_result_py3 import AgreementListResult except (SyntaxError, ImportError): from .initiate_transfer_request import InitiateTransferRequest + from .address import Address + from .validate_address_response import ValidateAddressResponse from .product_details import ProductDetails from .accept_transfer_request import AcceptTransferRequest from .error import Error @@ -84,7 +87,6 @@ from .transfer_billing_subscription_request_properties import TransferBillingSubscriptionRequestProperties from .transfer_billing_subscription_request import TransferBillingSubscriptionRequest from .update_auto_renew_operation_summary import UpdateAutoRenewOperationSummary - from .address import Address from .enabled_azure_sk_us import EnabledAzureSKUs from .billing_profile import BillingProfile from .invoice_section_properties import InvoiceSectionProperties @@ -141,6 +143,7 @@ from .recipient_transfer_details_paged import RecipientTransferDetailsPaged from .operation_paged import OperationPaged from .billing_management_client_enums import ( + AddressValidationStatus, ProductType, TransferStatus, ProductTransferStatus, @@ -156,6 +159,8 @@ __all__ = [ 'InitiateTransferRequest', + 'Address', + 'ValidateAddressResponse', 'ProductDetails', 'AcceptTransferRequest', 'Error', @@ -167,7 +172,6 @@ 'TransferBillingSubscriptionRequestProperties', 'TransferBillingSubscriptionRequest', 'UpdateAutoRenewOperationSummary', - 'Address', 'EnabledAzureSKUs', 'BillingProfile', 'InvoiceSectionProperties', @@ -223,6 +227,7 @@ 'TransferDetailsPaged', 'RecipientTransferDetailsPaged', 'OperationPaged', + 'AddressValidationStatus', 'ProductType', 'TransferStatus', 'ProductTransferStatus', diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py index 39ace87835df..ac825bb2de95 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py @@ -12,6 +12,12 @@ from enum import Enum +class AddressValidationStatus(str, Enum): + + valid = "Valid" + invalid = "Invalid" + + class ProductType(str, Enum): azure_subscription = "AzureSubscription" diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response.py new file mode 100644 index 000000000000..387605d5e931 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response.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 ValidateAddressResponse(Model): + """Result of the address validation. + + :param status: status of the address validation. Possible values include: + 'Valid', 'Invalid' + :type status: str or ~azure.mgmt.billing.models.AddressValidationStatus + :param suggested_addresses: list of suggested addresses. + :type suggested_addresses: list[~azure.mgmt.billing.models.Address] + :param validation_message: Validation error message. + :type validation_message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'suggested_addresses': {'key': 'suggestedAddresses', 'type': '[Address]'}, + 'validation_message': {'key': 'validationMessage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ValidateAddressResponse, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.suggested_addresses = kwargs.get('suggested_addresses', None) + self.validation_message = kwargs.get('validation_message', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response_py3.py new file mode 100644 index 000000000000..9e01d7871ec4 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response_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 ValidateAddressResponse(Model): + """Result of the address validation. + + :param status: status of the address validation. Possible values include: + 'Valid', 'Invalid' + :type status: str or ~azure.mgmt.billing.models.AddressValidationStatus + :param suggested_addresses: list of suggested addresses. + :type suggested_addresses: list[~azure.mgmt.billing.models.Address] + :param validation_message: Validation error message. + :type validation_message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'suggested_addresses': {'key': 'suggestedAddresses', 'type': '[Address]'}, + 'validation_message': {'key': 'validationMessage', 'type': 'str'}, + } + + def __init__(self, *, status=None, suggested_addresses=None, validation_message: str=None, **kwargs) -> None: + super(ValidateAddressResponse, self).__init__(**kwargs) + self.status = status + self.suggested_addresses = suggested_addresses + self.validation_message = validation_message diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index db4077cbc9c5..859e3eefb3a7 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -11,6 +11,7 @@ from .billing_accounts_operations import BillingAccountsOperations from .payment_methods_operations import PaymentMethodsOperations +from .billing_accounts_validate_address_operations import BillingAccountsValidateAddressOperations from .available_balances_operations import AvailableBalancesOperations from .billing_profiles_operations import BillingProfilesOperations from .invoice_sections_operations import InvoiceSectionsOperations @@ -34,6 +35,7 @@ __all__ = [ 'BillingAccountsOperations', 'PaymentMethodsOperations', + 'BillingAccountsValidateAddressOperations', 'AvailableBalancesOperations', 'BillingProfilesOperations', 'InvoiceSectionsOperations', diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_validate_address_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_validate_address_operations.py new file mode 100644 index 000000000000..d9d42f694909 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_validate_address_operations.py @@ -0,0 +1,100 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BillingAccountsValidateAddressOperations(object): + """BillingAccountsValidateAddressOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def post( + self, billing_account_name, address, custom_headers=None, raw=False, **operation_config): + """Validates the address. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param address: + :type address: ~azure.mgmt.billing.models.Address + :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: ValidateAddressResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.ValidateAddressResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.post.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(address, 'Address') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ValidateAddressResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + post.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/validateAddress'}