Skip to content

Commit

Permalink
Generated from 5e894499b6beb20b05c6a207796b8cafc747429a (#2294)
Browse files Browse the repository at this point in the history
Update readme.md
  • Loading branch information
AutorestCI authored and lmazuel committed Mar 28, 2018
1 parent c1bf712 commit 0f08c1d
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 68 deletions.
4 changes: 2 additions & 2 deletions azure-mgmt-billing/azure/mgmt/billing/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# --------------------------------------------------------------------------

from .enrollment_account import EnrollmentAccount
from .enrollment_account_list_result import EnrollmentAccountListResult
from .billing_period import BillingPeriod
from .download_url import DownloadUrl
from .error_details import ErrorDetails
Expand All @@ -19,13 +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',
'EnrollmentAccountListResult',
'BillingPeriod',
'DownloadUrl',
'ErrorDetails',
Expand All @@ -34,6 +33,7 @@
'OperationDisplay',
'Operation',
'Resource',
'EnrollmentAccountPaged',
'BillingPeriodPaged',
'InvoicePaged',
'OperationPaged',
Expand Down

This file was deleted.

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)
Original file line number Diff line number Diff line change
Expand Up @@ -45,43 +45,52 @@ def list(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: EnrollmentAccountListResult or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.billing.models.EnrollmentAccountListResult or
~msrest.pipeline.ClientRawResponse
:return: An iterator like instance of EnrollmentAccount
:rtype:
~azure.mgmt.billing.models.EnrollmentAccountPaged[~azure.mgmt.billing.models.EnrollmentAccount]
:raises:
:class:`ErrorResponseException<azure.mgmt.billing.models.ErrorResponseException>`
"""
# Construct URL
url = self.list.metadata['url']
def internal_paging(next_link=None, raw=False):

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
if not next_link:
# Construct URL
url = self.list.metadata['url']

# Construct headers
header_parameters = {}
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 parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)
else:
url = next_link
query_parameters = {}

if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
# Construct headers
header_parameters = {}
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')

deserialized = None
# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, stream=False, **operation_config)

if response.status_code == 200:
deserialized = self._deserialize('EnrollmentAccountListResult', response)
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:
client_raw_response = ClientRawResponse(deserialized, response)
header_dict = {}
client_raw_response = models.EnrollmentAccountPaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response

return deserialized
Expand Down

0 comments on commit 0f08c1d

Please sign in to comment.