From b48949368b16af1828cfffd62e2fb2ea3b8eac5c Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 30 Mar 2019 00:08:57 +0000 Subject: [PATCH] Generated from ed5299b6ec825b140ef6df20a613e2f723df3069 updating operationId for tansactions to Noun_verb as per feedback. --- .../mgmt/billing/billing_management_client.py | 84 ++----------- .../azure/mgmt/billing/operations/__init__.py | 4 + ...nsactions_by_billing_profile_operations.py | 111 ++++++++++++++++++ ...nsactions_by_invoice_section_operations.py | 111 ++++++++++++++++++ 4 files changed, 236 insertions(+), 74 deletions(-) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_profile_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_invoice_section_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index 88371287f0cd..f2f582b55603 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -42,6 +42,8 @@ from .operations.products_by_invoice_section_operations import ProductsByInvoiceSectionOperations from .operations.products_operations import ProductsOperations from .operations.transactions_by_billing_account_operations import TransactionsByBillingAccountOperations +from .operations.transactions_by_billing_profile_operations import TransactionsByBillingProfileOperations +from .operations.transactions_by_invoice_section_operations import TransactionsByInvoiceSectionOperations from .operations.policy_operations import PolicyOperations from .operations.billing_property_operations import BillingPropertyOperations from .operations.transfers_operations import TransfersOperations @@ -147,6 +149,10 @@ class BillingManagementClient(SDKClient): :vartype products: azure.mgmt.billing.operations.ProductsOperations :ivar transactions_by_billing_account: TransactionsByBillingAccount operations :vartype transactions_by_billing_account: azure.mgmt.billing.operations.TransactionsByBillingAccountOperations + :ivar transactions_by_billing_profile: TransactionsByBillingProfile operations + :vartype transactions_by_billing_profile: azure.mgmt.billing.operations.TransactionsByBillingProfileOperations + :ivar transactions_by_invoice_section: TransactionsByInvoiceSection operations + :vartype transactions_by_invoice_section: azure.mgmt.billing.operations.TransactionsByInvoiceSectionOperations :ivar policy: Policy operations :vartype policy: azure.mgmt.billing.operations.PolicyOperations :ivar billing_property: BillingProperty operations @@ -245,6 +251,10 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.transactions_by_billing_account = TransactionsByBillingAccountOperations( self._client, self.config, self._serialize, self._deserialize) + self.transactions_by_billing_profile = TransactionsByBillingProfileOperations( + self._client, self.config, self._serialize, self._deserialize) + self.transactions_by_invoice_section = TransactionsByInvoiceSectionOperations( + self._client, self.config, self._serialize, self._deserialize) self.policy = PolicyOperations( self._client, self.config, self._serialize, self._deserialize) self.billing_property = BillingPropertyOperations( @@ -274,80 +284,6 @@ def __init__( self.billing_profile_billing_role_assignment = BillingProfileBillingRoleAssignmentOperations( self._client, self.config, self._serialize, self._deserialize) - def transactions_by_billing_profile( - self, billing_account_name, billing_profile_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): - """Lists the transactions by billingProfileName for given start date and - end date. - - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param billing_profile_name: Billing Profile Id. - :type billing_profile_name: str - :param start_date: Start date - :type start_date: str - :param end_date: End date - :type end_date: str - :param filter: May be used to filter by transaction kind. The filter - supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not - currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - string where key and value is separated by a colon (:). - :type filter: 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`. - :return: TransactionsListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.TransactionsListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.transactions_by_billing_profile.metadata['url'] - path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_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') - query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') - query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - # 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) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('TransactionsListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - transactions_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/transactions'} - def update_auto_renew_for_billing_account( self, billing_account_name, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): """Cancel product by product id. diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index 8c73c7b45153..7745128644cc 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -34,6 +34,8 @@ from .products_by_invoice_section_operations import ProductsByInvoiceSectionOperations from .products_operations import ProductsOperations from .transactions_by_billing_account_operations import TransactionsByBillingAccountOperations +from .transactions_by_billing_profile_operations import TransactionsByBillingProfileOperations +from .transactions_by_invoice_section_operations import TransactionsByInvoiceSectionOperations from .policy_operations import PolicyOperations from .billing_property_operations import BillingPropertyOperations from .transfers_operations import TransfersOperations @@ -75,6 +77,8 @@ 'ProductsByInvoiceSectionOperations', 'ProductsOperations', 'TransactionsByBillingAccountOperations', + 'TransactionsByBillingProfileOperations', + 'TransactionsByInvoiceSectionOperations', 'PolicyOperations', 'BillingPropertyOperations', 'TransfersOperations', diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_profile_operations.py new file mode 100644 index 000000000000..7361a8c6a7cb --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_profile_operations.py @@ -0,0 +1,111 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TransactionsByBillingProfileOperations(object): + """TransactionsByBillingProfileOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, billing_profile_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the transactions by billingProfileName for given start date and + end date. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param start_date: Start date + :type start_date: str + :param end_date: End date + :type end_date: str + :param filter: May be used to filter by transaction kind. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: 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`. + :return: TransactionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransactionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_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') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # 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) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransactionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/transactions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_invoice_section_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_invoice_section_operations.py new file mode 100644 index 000000000000..7ecf28a61874 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_invoice_section_operations.py @@ -0,0 +1,111 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TransactionsByInvoiceSectionOperations(object): + """TransactionsByInvoiceSectionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, invoice_section_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the transactions by invoiceSectionName for given start date and + end date. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param start_date: Start date + :type start_date: str + :param end_date: End date + :type end_date: str + :param filter: May be used to filter by transaction kind. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: 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`. + :return: TransactionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransactionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_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') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # 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) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransactionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transactions'}