Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[AutoPR] billing/resource-manager #2076

Merged
merged 11 commits into from
Mar 29, 2018
6 changes: 6 additions & 0 deletions azure-mgmt-billing/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
Release History
===============

0.2.0 (2018-03-29)
++++++++++++++++++

- Add new nrollment_accounts operation groups
- Now all operation groups have a "models" attributes

0.1.0 (2017-05-18)
++++++++++++++++++

Expand Down
10 changes: 5 additions & 5 deletions azure-mgmt-billing/README.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Microsoft Azure SDK for Python
==============================

This is the Microsoft Azure Billing 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).

This package has been tested with Python 2.7, 3.3, 3.4, 3.5 and 3.6.
This package has been tested with Python 2.7, 3.4, 3.5 and 3.6.

For the older Azure Service Management (ASM) libraries, see
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.
Expand Down Expand Up @@ -36,9 +36,9 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first:
Usage
=====

For code examples, see `Billing Management
<https://azure-sdk-for-python.readthedocs.org/en/latest/sample_azure-mgmt-billing.html>`__
on readthedocs.org.
For code examples, see `Billing
<https://docs.microsoft.com/python/api/overview/azure/billing/>`__
on docs.microsoft.com.


Provide Feedback
Expand Down
Empty file modified azure-mgmt-billing/azure/mgmt/billing/__init__.py
100755 → 100644
Empty file.
19 changes: 11 additions & 8 deletions azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.enrollment_accounts_operations import EnrollmentAccountsOperations
from .operations.billing_periods_operations import BillingPeriodsOperations
from .operations.invoices_operations import InvoicesOperations
from .operations.operations import Operations
Expand All @@ -39,32 +40,32 @@ def __init__(
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not isinstance(subscription_id, str):
raise TypeError("Parameter 'subscription_id' must be str.")
if not base_url:
base_url = 'https://management.azure.com'

super(BillingManagementClientConfiguration, self).__init__(base_url)

self.add_user_agent('billingmanagementclient/{}'.format(VERSION))
self.add_user_agent('azure-mgmt-billing/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id


class BillingManagementClient(object):
"""Billing client provides access to billing resources 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.
"""Billing client provides access to billing resources for Azure subscriptions.

:ivar config: Configuration for client.
:vartype config: BillingManagementClientConfiguration

:ivar enrollment_accounts: EnrollmentAccounts operations
:vartype enrollment_accounts: azure.mgmt.billing.operations.EnrollmentAccountsOperations
:ivar billing_periods: BillingPeriods operations
:vartype billing_periods: .operations.BillingPeriodsOperations
:vartype billing_periods: azure.mgmt.billing.operations.BillingPeriodsOperations
:ivar invoices: Invoices operations
:vartype invoices: .operations.InvoicesOperations
:vartype invoices: azure.mgmt.billing.operations.InvoicesOperations
:ivar operations: Operations operations
:vartype operations: .operations.Operations
:vartype operations: azure.mgmt.billing.operations.Operations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
Expand All @@ -81,10 +82,12 @@ def __init__(
self._client = ServiceClient(self.config.credentials, self.config)

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

self.enrollment_accounts = EnrollmentAccountsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.billing_periods = BillingPeriodsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.invoices = InvoicesOperations(
Expand Down
4 changes: 4 additions & 0 deletions azure-mgmt-billing/azure/mgmt/billing/models/__init__.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .enrollment_account import EnrollmentAccount
from .billing_period import BillingPeriod
from .download_url import DownloadUrl
from .error_details import ErrorDetails
Expand All @@ -17,11 +18,13 @@
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 .operation_paged import OperationPaged

__all__ = [
'EnrollmentAccount',
'BillingPeriod',
'DownloadUrl',
'ErrorDetails',
Expand All @@ -30,6 +33,7 @@
'OperationDisplay',
'Operation',
'Resource',
'EnrollmentAccountPaged',
'BillingPeriodPaged',
'InvoicePaged',
'OperationPaged',
Expand Down
2 changes: 1 addition & 1 deletion azure-mgmt-billing/azure/mgmt/billing/models/billing_period.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class BillingPeriod(Resource):
billing period.
:vartype billing_period_end_date: date
:ivar invoice_ids: Array of invoice ids that associated with.
:vartype invoice_ids: list of str
:vartype invoice_ids: list[str]
"""

_validation = {
Expand Down
2 changes: 1 addition & 1 deletion azure-mgmt-billing/azure/mgmt/billing/models/billing_period_paged.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class BillingPeriodPaged(Paged):
"""
A paging container for iterating over a list of BillingPeriod object
A paging container for iterating over a list of :class:`BillingPeriod <azure.mgmt.billing.models.BillingPeriod>` object
"""

_attribute_map = {
Expand Down
1 change: 1 addition & 0 deletions azure-mgmt-billing/azure/mgmt/billing/models/download_url.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ class DownloadUrl(Model):
}

def __init__(self):
super(DownloadUrl, self).__init__()
self.expiry_time = None
self.url = None
47 changes: 47 additions & 0 deletions azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py
Original file line number Diff line number Diff line change
@@ -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 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):
super(EnrollmentAccount, self).__init__()
self.principal_name = None
Original file line number Diff line number Diff line change
@@ -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 EnrollmentAccountPaged(Paged):
"""
A paging container for iterating over a list of :class:`EnrollmentAccount <azure.mgmt.billing.models.EnrollmentAccount>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[EnrollmentAccount]'}
}

def __init__(self, *args, **kwargs):

super(EnrollmentAccountPaged, self).__init__(*args, **kwargs)
1 change: 1 addition & 0 deletions azure-mgmt-billing/azure/mgmt/billing/models/error_details.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class ErrorDetails(Model):
}

def __init__(self):
super(ErrorDetails, self).__init__()
self.code = None
self.message = None
self.target = None
4 changes: 2 additions & 2 deletions azure-mgmt-billing/azure/mgmt/billing/models/error_response.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ class ErrorResponse(Model):
incoming request. The reason is provided in the error message.

:param error: The details of the error.
:type error: :class:`ErrorDetails
<azure.mgmt.billing.models.ErrorDetails>`
:type error: ~azure.mgmt.billing.models.ErrorDetails
"""

_attribute_map = {
'error': {'key': 'error', 'type': 'ErrorDetails'},
}

def __init__(self, error=None):
super(ErrorResponse, self).__init__()
self.error = error


Expand Down
5 changes: 2 additions & 3 deletions azure-mgmt-billing/azure/mgmt/billing/models/invoice.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ class Invoice(Resource):
: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: :class:`DownloadUrl
<azure.mgmt.billing.models.DownloadUrl>`
: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
Expand All @@ -36,7 +35,7 @@ class Invoice(Resource):
: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 of str
:vartype billing_period_ids: list[str]
"""

_validation = {
Expand Down
2 changes: 1 addition & 1 deletion azure-mgmt-billing/azure/mgmt/billing/models/invoice_paged.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class InvoicePaged(Paged):
"""
A paging container for iterating over a list of Invoice object
A paging container for iterating over a list of :class:`Invoice <azure.mgmt.billing.models.Invoice>` object
"""

_attribute_map = {
Expand Down
4 changes: 2 additions & 2 deletions azure-mgmt-billing/azure/mgmt/billing/models/operation.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ class Operation(Model):
:ivar name: Operation name: {provider}/{resource}/{operation}.
:vartype name: str
:param display: The object that represents the operation.
:type display: :class:`OperationDisplay
<azure.mgmt.billing.models.OperationDisplay>`
:type display: ~azure.mgmt.billing.models.OperationDisplay
"""

_validation = {
Expand All @@ -35,5 +34,6 @@ class Operation(Model):
}

def __init__(self, display=None):
super(Operation, self).__init__()
self.name = None
self.display = display
1 change: 1 addition & 0 deletions azure-mgmt-billing/azure/mgmt/billing/models/operation_display.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class OperationDisplay(Model):
}

def __init__(self):
super(OperationDisplay, self).__init__()
self.provider = None
self.resource = None
self.operation = None
2 changes: 1 addition & 1 deletion azure-mgmt-billing/azure/mgmt/billing/models/operation_paged.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class OperationPaged(Paged):
"""
A paging container for iterating over a list of Operation object
A paging container for iterating over a list of :class:`Operation <azure.mgmt.billing.models.Operation>` object
"""

_attribute_map = {
Expand Down
1 change: 1 addition & 0 deletions azure-mgmt-billing/azure/mgmt/billing/models/resource.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Resource(Model):
}

def __init__(self):
super(Resource, self).__init__()
self.id = None
self.name = None
self.type = None
2 changes: 2 additions & 0 deletions azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
# regenerated.
# --------------------------------------------------------------------------

from .enrollment_accounts_operations import EnrollmentAccountsOperations
from .billing_periods_operations import BillingPeriodsOperations
from .invoices_operations import InvoicesOperations
from .operations import Operations

__all__ = [
'EnrollmentAccountsOperations',
'BillingPeriodsOperations',
'InvoicesOperations',
'Operations',
Expand Down
Loading