Skip to content

Commit

Permalink
[AutoPR billing/resource-manager] [Microsoft.Billing]: Updating swagg…
Browse files Browse the repository at this point in the history
…er with rename changes required. (#3813)

* Generated from 00929e5f098aa4815bb216071aa6f22d5bc0e170

[Microsoft.Billing]: Updating swagger with rename changes required.

* Packaging update of azure-mgmt-billing
  • Loading branch information
AutorestCI authored Nov 21, 2018
1 parent bc0bbaa commit 44bf32f
Show file tree
Hide file tree
Showing 32 changed files with 527 additions and 133 deletions.
4 changes: 3 additions & 1 deletion azure-mgmt-billing/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
include *.rst
include azure_bdist_wheel.py
include azure/__init__.py
include azure/mgmt/__init__.py

8 changes: 4 additions & 4 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 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 <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.
Expand Down Expand Up @@ -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
<https://docs.microsoft.com/python/api/overview/azure/billing/>`__
For code examples, see `MyService Management
<https://docs.microsoft.com/python/api/overview/azure/>`__
on docs.microsoft.com.


Expand Down
2 changes: 1 addition & 1 deletion azure-mgmt-billing/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
2 changes: 1 addition & 1 deletion azure-mgmt-billing/azure/mgmt/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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'
Expand Down
29 changes: 20 additions & 9 deletions azure-mgmt-billing/azure/mgmt/billing/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
59 changes: 59 additions & 0 deletions azure-mgmt-billing/azure/mgmt/billing/models/billing_period_py3.py
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions azure-mgmt-billing/azure/mgmt/billing/models/download_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
41 changes: 41 additions & 0 deletions azure-mgmt-billing/azure/mgmt/billing/models/download_url_py3.py
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
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_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
4 changes: 2 additions & 2 deletions azure-mgmt-billing/azure/mgmt/billing/models/error_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
45 changes: 45 additions & 0 deletions azure-mgmt-billing/azure/mgmt/billing/models/error_details_py3.py
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
42 changes: 42 additions & 0 deletions azure-mgmt-billing/azure/mgmt/billing/models/error_response_py3.py
Original file line number Diff line number Diff line change
@@ -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)
Loading

0 comments on commit 44bf32f

Please sign in to comment.