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] Add Billing Account resource to Billing RP. #2015

Merged
merged 1 commit into from
Feb 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.billing_accounts_operations import BillingAccountsOperations
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 billing_accounts: BillingAccounts operations
:vartype billing_accounts: azure.mgmt.billing.operations.BillingAccountsOperations
: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.billing_accounts = BillingAccountsOperations(
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,8 @@
# regenerated.
# --------------------------------------------------------------------------

from .billing_account_result import BillingAccountResult
from .billing_account_list_result import BillingAccountListResult
from .billing_period import BillingPeriod
from .download_url import DownloadUrl
from .error_details import ErrorDetails
Expand All @@ -22,6 +24,8 @@
from .operation_paged import OperationPaged

__all__ = [
'BillingAccountResult',
'BillingAccountListResult',
'BillingPeriod',
'DownloadUrl',
'ErrorDetails',
Expand Down
Original file line number Diff line number Diff line change
@@ -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 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.BillingAccountResult]
"""

_validation = {
'value': {'readonly': True},
}

_attribute_map = {
'value': {'key': 'value', 'type': '[BillingAccountResult]'},
}

def __init__(self):
super(BillingAccountListResult, self).__init__()
self.value = None
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 BillingAccountResult(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 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(BillingAccountResult, self).__init__()
self.principal_name = None
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
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 .billing_accounts_operations import BillingAccountsOperations
from .billing_periods_operations import BillingPeriodsOperations
from .invoices_operations import InvoicesOperations
from .operations import Operations

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