Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.billing_accounts_operations import BillingAccountsOperations
from .operations.available_balances_operations import AvailableBalancesOperations
from .operations.payment_methods_operations import PaymentMethodsOperations
from .operations.available_balances_operations import AvailableBalancesOperations
from .operations.billing_profiles_operations import BillingProfilesOperations
from .operations.invoice_sections_operations import InvoiceSectionsOperations
from .operations.departments_operations import DepartmentsOperations
Expand Down Expand Up @@ -77,10 +77,10 @@ class BillingManagementClient(SDKClient):

:ivar billing_accounts: BillingAccounts operations
:vartype billing_accounts: azure.mgmt.billing.operations.BillingAccountsOperations
:ivar available_balances: AvailableBalances operations
:vartype available_balances: azure.mgmt.billing.operations.AvailableBalancesOperations
:ivar payment_methods: PaymentMethods operations
:vartype payment_methods: azure.mgmt.billing.operations.PaymentMethodsOperations
:ivar available_balances: AvailableBalances operations
:vartype available_balances: azure.mgmt.billing.operations.AvailableBalancesOperations
:ivar billing_profiles: BillingProfiles operations
:vartype billing_profiles: azure.mgmt.billing.operations.BillingProfilesOperations
:ivar invoice_sections: InvoiceSections operations
Expand Down Expand Up @@ -139,10 +139,10 @@ def __init__(

self.billing_accounts = BillingAccountsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.available_balances = AvailableBalancesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.payment_methods = PaymentMethodsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.available_balances = AvailableBalancesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.billing_profiles = BillingProfilesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.invoice_sections = InvoiceSectionsOperations(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
# --------------------------------------------------------------------------

from .billing_accounts_operations import BillingAccountsOperations
from .available_balances_operations import AvailableBalancesOperations
from .payment_methods_operations import PaymentMethodsOperations
from .available_balances_operations import AvailableBalancesOperations
from .billing_profiles_operations import BillingProfilesOperations
from .invoice_sections_operations import InvoiceSectionsOperations
from .departments_operations import DepartmentsOperations
Expand All @@ -33,8 +33,8 @@

__all__ = [
'BillingAccountsOperations',
'AvailableBalancesOperations',
'PaymentMethodsOperations',
'AvailableBalancesOperations',
'BillingProfilesOperations',
'InvoiceSectionsOperations',
'DepartmentsOperations',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,71 @@ def __init__(self, client, config, serializer, deserializer):

self.config = config

def list_by_billing_account_name(
self, billing_account_name, custom_headers=None, raw=False, **operation_config):
"""Lists the Payment Methods by billing account Id.

:param billing_account_name: billing Account Id.
:type billing_account_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: An iterator like instance of PaymentMethod
:rtype:
~azure.mgmt.billing.models.PaymentMethodPaged[~azure.mgmt.billing.models.PaymentMethod]
:raises:
:class:`ErrorResponseException<azure.mgmt.billing.models.ErrorResponseException>`
"""
def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = self.list_by_billing_account_name.metadata['url']
path_format_arguments = {
'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

else:
url = next_link
query_parameters = {}

# Construct headers
header_parameters = {}
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:
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 and send request
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)

return response

# Deserialize response
deserialized = models.PaymentMethodPaged(internal_paging, self._deserialize.dependencies)

if raw:
header_dict = {}
client_raw_response = models.PaymentMethodPaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response

return deserialized
list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/paymentMethods'}

def list_by_billing_profile_name(
self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config):
"""Lists the Payment Methods by billing profile Id.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "0.2.0"
VERSION = "0.3.0"