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'], + } )