From a5dbcc15c3284f127c75575989d3eb50a63a4da1 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 21 May 2019 22:19:17 +0000 Subject: [PATCH 1/5] Generated from 7dc3649e3e29fa741073f639589cbda471ec7d0b Spec for LineOfCredit API and other corrections Spec for LineOfCredit API and other corrections --- .../mgmt/billing/billing_management_client.py | 5 + .../azure/mgmt/billing/models/__init__.py | 6 + ...rease_line_of_credit_request_properties.py | 28 +++ ...e_line_of_credit_request_properties_py3.py | 28 +++ .../mgmt/billing/models/line_of_credit.py | 62 ++++++ .../mgmt/billing/models/line_of_credit_py3.py | 62 ++++++ .../azure/mgmt/billing/operations/__init__.py | 2 + .../operations/billing_profiles_operations.py | 2 +- .../operations/invoice_sections_operations.py | 2 +- .../operations/line_of_credits_operations.py | 184 ++++++++++++++++++ 10 files changed, 379 insertions(+), 2 deletions(-) create mode 100644 sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/increase_line_of_credit_request_properties.py create mode 100644 sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/increase_line_of_credit_request_properties_py3.py create mode 100644 sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit.py create mode 100644 sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit_py3.py create mode 100644 sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index 486e6ac5d4e0..07e5b7396335 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -34,6 +34,7 @@ from .operations.billing_role_definitions_operations import BillingRoleDefinitionsOperations from .operations.billing_role_assignments_operations import BillingRoleAssignmentsOperations from .operations.agreements_operations import AgreementsOperations +from .operations.line_of_credits_operations import LineOfCreditsOperations from . import models @@ -117,6 +118,8 @@ class BillingManagementClient(SDKClient): :vartype billing_role_assignments: azure.mgmt.billing.operations.BillingRoleAssignmentsOperations :ivar agreements: Agreements operations :vartype agreements: azure.mgmt.billing.operations.AgreementsOperations + :ivar line_of_credits: LineOfCredits operations + :vartype line_of_credits: azure.mgmt.billing.operations.LineOfCreditsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -179,3 +182,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.agreements = AgreementsOperations( self._client, self.config, self._serialize, self._deserialize) + self.line_of_credits = LineOfCreditsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py index 140c186dbd06..364f3da8f544 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py @@ -71,6 +71,8 @@ from .participants_py3 import Participants from .agreement_py3 import Agreement from .agreement_list_result_py3 import AgreementListResult + from .line_of_credit_py3 import LineOfCredit + from .increase_line_of_credit_request_properties_py3 import IncreaseLineOfCreditRequestProperties except (SyntaxError, ImportError): from .initiate_transfer_request import InitiateTransferRequest from .product_details import ProductDetails @@ -133,6 +135,8 @@ from .participants import Participants from .agreement import Agreement from .agreement_list_result import AgreementListResult + from .line_of_credit import LineOfCredit + from .increase_line_of_credit_request_properties import IncreaseLineOfCreditRequestProperties from .payment_method_paged import PaymentMethodPaged from .billing_subscription_summary_paged import BillingSubscriptionSummaryPaged from .product_summary_paged import ProductSummaryPaged @@ -216,6 +220,8 @@ 'Participants', 'Agreement', 'AgreementListResult', + 'LineOfCredit', + 'IncreaseLineOfCreditRequestProperties', 'PaymentMethodPaged', 'BillingSubscriptionSummaryPaged', 'ProductSummaryPaged', diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/increase_line_of_credit_request_properties.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/increase_line_of_credit_request_properties.py new file mode 100644 index 000000000000..85681b738b8f --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/increase_line_of_credit_request_properties.py @@ -0,0 +1,28 @@ +# 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 IncreaseLineOfCreditRequestProperties(Model): + """Request parameters to increase line of credit. + + :param desired_credit_limit: The desired credit limit. + :type desired_credit_limit: float + """ + + _attribute_map = { + 'desired_credit_limit': {'key': 'desiredCreditLimit', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(IncreaseLineOfCreditRequestProperties, self).__init__(**kwargs) + self.desired_credit_limit = kwargs.get('desired_credit_limit', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/increase_line_of_credit_request_properties_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/increase_line_of_credit_request_properties_py3.py new file mode 100644 index 000000000000..ffc46288e55b --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/increase_line_of_credit_request_properties_py3.py @@ -0,0 +1,28 @@ +# 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 IncreaseLineOfCreditRequestProperties(Model): + """Request parameters to increase line of credit. + + :param desired_credit_limit: The desired credit limit. + :type desired_credit_limit: float + """ + + _attribute_map = { + 'desired_credit_limit': {'key': 'desiredCreditLimit', 'type': 'float'}, + } + + def __init__(self, *, desired_credit_limit: float=None, **kwargs) -> None: + super(IncreaseLineOfCreditRequestProperties, self).__init__(**kwargs) + self.desired_credit_limit = desired_credit_limit diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit.py new file mode 100644 index 000000000000..92856b9d67d8 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit.py @@ -0,0 +1,62 @@ +# 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 LineOfCredit(Resource): + """Line of credit 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 credit_limit: The current credit limit. + :vartype credit_limit: ~azure.mgmt.billing.models.Amount + :ivar reason: The reason for the line of credit status when not approved. + :vartype reason: str + :ivar remaining_balance: Remaining balance. + :vartype remaining_balance: ~azure.mgmt.billing.models.Amount + :ivar status: The line of credit status. + :vartype status: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'credit_limit': {'readonly': True}, + 'reason': {'readonly': True}, + 'remaining_balance': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'credit_limit': {'key': 'properties.creditLimit', 'type': 'Amount'}, + 'reason': {'key': 'properties.reason', 'type': 'str'}, + 'remaining_balance': {'key': 'properties.remainingBalance', 'type': 'Amount'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LineOfCredit, self).__init__(**kwargs) + self.credit_limit = None + self.reason = None + self.remaining_balance = None + self.status = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit_py3.py new file mode 100644 index 000000000000..a6f84e6babee --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit_py3.py @@ -0,0 +1,62 @@ +# 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 LineOfCredit(Resource): + """Line of credit 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 credit_limit: The current credit limit. + :vartype credit_limit: ~azure.mgmt.billing.models.Amount + :ivar reason: The reason for the line of credit status when not approved. + :vartype reason: str + :ivar remaining_balance: Remaining balance. + :vartype remaining_balance: ~azure.mgmt.billing.models.Amount + :ivar status: The line of credit status. + :vartype status: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'credit_limit': {'readonly': True}, + 'reason': {'readonly': True}, + 'remaining_balance': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'credit_limit': {'key': 'properties.creditLimit', 'type': 'Amount'}, + 'reason': {'key': 'properties.reason', 'type': 'str'}, + 'remaining_balance': {'key': 'properties.remainingBalance', 'type': 'Amount'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(LineOfCredit, self).__init__(**kwargs) + self.credit_limit = None + self.reason = None + self.remaining_balance = None + self.status = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index db4077cbc9c5..de5bb964fe5a 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -30,6 +30,7 @@ from .billing_role_definitions_operations import BillingRoleDefinitionsOperations from .billing_role_assignments_operations import BillingRoleAssignmentsOperations from .agreements_operations import AgreementsOperations +from .line_of_credits_operations import LineOfCreditsOperations __all__ = [ 'BillingAccountsOperations', @@ -53,4 +54,5 @@ 'BillingRoleDefinitionsOperations', 'BillingRoleAssignmentsOperations', 'AgreementsOperations', + 'LineOfCreditsOperations', ] diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py index d98add3bbe9f..918c13dcd9b0 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py @@ -193,7 +193,7 @@ def _update_initial( body_content = self._serialize.body(parameters, 'BillingProfile') # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py index ef9c355efe1c..a40226e73bce 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py @@ -432,7 +432,7 @@ def _update_initial( body_content = self._serialize.body(parameters, 'InvoiceSection') # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py new file mode 100644 index 000000000000..0ec917aa6c7d --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py @@ -0,0 +1,184 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class LineOfCreditsOperations(object): + """LineOfCreditsOperations 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 get( + self, custom_headers=None, raw=False, **operation_config): + """Get the current line of credit. + + :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: LineOfCredit or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.LineOfCredit or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # 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('LineOfCredit', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingAccounts/default/lineOfCredit/default'} + + + def _increase_initial( + self, desired_credit_limit=None, custom_headers=None, raw=False, **operation_config): + parameters = models.IncreaseLineOfCreditRequestProperties(desired_credit_limit=desired_credit_limit) + + # Construct URL + url = self.increase.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # 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 body + body_content = self._serialize.body(parameters, 'IncreaseLineOfCreditRequestProperties') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + 'Azure-AsyncOperation': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def increase( + self, desired_credit_limit=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Increase the current line of credit. + + :param desired_credit_limit: The desired credit limit. + :type desired_credit_limit: float + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._increase_initial( + desired_credit_limit=desired_credit_limit, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Location': 'str', + 'Retry-After': 'int', + 'Azure-AsyncOperation': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + increase.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingAccounts/default/lineOfCredit/default/increase'} From e152c04594c4727bd09eaea3714cbd7688e60e6e Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 21 May 2019 23:32:14 +0000 Subject: [PATCH 2/5] Generated from 8b7638cffc50f458881188691f39a8e5d563436d Fixed build error --- .../mgmt/billing/billing_management_client.py | 5 + .../azure/mgmt/billing/models/__init__.py | 11 +- .../models/billing_management_client_enums.py | 6 ++ .../models/validate_address_response.py | 37 +++++++ .../models/validate_address_response_py3.py | 37 +++++++ .../azure/mgmt/billing/operations/__init__.py | 2 + ...ng_accounts_validate_address_operations.py | 100 ++++++++++++++++++ .../operations/line_of_credits_operations.py | 42 +++++--- 8 files changed, 224 insertions(+), 16 deletions(-) create mode 100644 sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response.py create mode 100644 sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response_py3.py create mode 100644 sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_validate_address_operations.py diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index 07e5b7396335..d04e5f0d8297 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -15,6 +15,7 @@ from .version import VERSION from .operations.billing_accounts_operations import BillingAccountsOperations from .operations.payment_methods_operations import PaymentMethodsOperations +from .operations.billing_accounts_validate_address_operations import BillingAccountsValidateAddressOperations from .operations.available_balances_operations import AvailableBalancesOperations from .operations.billing_profiles_operations import BillingProfilesOperations from .operations.invoice_sections_operations import InvoiceSectionsOperations @@ -80,6 +81,8 @@ class BillingManagementClient(SDKClient): :vartype billing_accounts: azure.mgmt.billing.operations.BillingAccountsOperations :ivar payment_methods: PaymentMethods operations :vartype payment_methods: azure.mgmt.billing.operations.PaymentMethodsOperations + :ivar billing_accounts_validate_address: BillingAccountsValidateAddress operations + :vartype billing_accounts_validate_address: azure.mgmt.billing.operations.BillingAccountsValidateAddressOperations :ivar available_balances: AvailableBalances operations :vartype available_balances: azure.mgmt.billing.operations.AvailableBalancesOperations :ivar billing_profiles: BillingProfiles operations @@ -144,6 +147,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.payment_methods = PaymentMethodsOperations( self._client, self.config, self._serialize, self._deserialize) + self.billing_accounts_validate_address = BillingAccountsValidateAddressOperations( + self._client, self.config, self._serialize, self._deserialize) self.available_balances = AvailableBalancesOperations( self._client, self.config, self._serialize, self._deserialize) self.billing_profiles = BillingProfilesOperations( diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py index 364f3da8f544..6ec31ad95fbd 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py @@ -11,6 +11,8 @@ try: from .initiate_transfer_request_py3 import InitiateTransferRequest + from .address_py3 import Address + from .validate_address_response_py3 import ValidateAddressResponse from .product_details_py3 import ProductDetails from .accept_transfer_request_py3 import AcceptTransferRequest from .error_py3 import Error @@ -22,7 +24,6 @@ from .transfer_billing_subscription_request_properties_py3 import TransferBillingSubscriptionRequestProperties from .transfer_billing_subscription_request_py3 import TransferBillingSubscriptionRequest from .update_auto_renew_operation_summary_py3 import UpdateAutoRenewOperationSummary - from .address_py3 import Address from .enabled_azure_sk_us_py3 import EnabledAzureSKUs from .billing_profile_py3 import BillingProfile from .invoice_section_properties_py3 import InvoiceSectionProperties @@ -75,6 +76,8 @@ from .increase_line_of_credit_request_properties_py3 import IncreaseLineOfCreditRequestProperties except (SyntaxError, ImportError): from .initiate_transfer_request import InitiateTransferRequest + from .address import Address + from .validate_address_response import ValidateAddressResponse from .product_details import ProductDetails from .accept_transfer_request import AcceptTransferRequest from .error import Error @@ -86,7 +89,6 @@ from .transfer_billing_subscription_request_properties import TransferBillingSubscriptionRequestProperties from .transfer_billing_subscription_request import TransferBillingSubscriptionRequest from .update_auto_renew_operation_summary import UpdateAutoRenewOperationSummary - from .address import Address from .enabled_azure_sk_us import EnabledAzureSKUs from .billing_profile import BillingProfile from .invoice_section_properties import InvoiceSectionProperties @@ -145,6 +147,7 @@ from .recipient_transfer_details_paged import RecipientTransferDetailsPaged from .operation_paged import OperationPaged from .billing_management_client_enums import ( + AddressValidationStatus, ProductType, TransferStatus, ProductTransferStatus, @@ -160,6 +163,8 @@ __all__ = [ 'InitiateTransferRequest', + 'Address', + 'ValidateAddressResponse', 'ProductDetails', 'AcceptTransferRequest', 'Error', @@ -171,7 +176,6 @@ 'TransferBillingSubscriptionRequestProperties', 'TransferBillingSubscriptionRequest', 'UpdateAutoRenewOperationSummary', - 'Address', 'EnabledAzureSKUs', 'BillingProfile', 'InvoiceSectionProperties', @@ -229,6 +233,7 @@ 'TransferDetailsPaged', 'RecipientTransferDetailsPaged', 'OperationPaged', + 'AddressValidationStatus', 'ProductType', 'TransferStatus', 'ProductTransferStatus', diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py index 39ace87835df..ac825bb2de95 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py @@ -12,6 +12,12 @@ from enum import Enum +class AddressValidationStatus(str, Enum): + + valid = "Valid" + invalid = "Invalid" + + class ProductType(str, Enum): azure_subscription = "AzureSubscription" diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response.py new file mode 100644 index 000000000000..387605d5e931 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response.py @@ -0,0 +1,37 @@ +# 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 ValidateAddressResponse(Model): + """Result of the address validation. + + :param status: status of the address validation. Possible values include: + 'Valid', 'Invalid' + :type status: str or ~azure.mgmt.billing.models.AddressValidationStatus + :param suggested_addresses: list of suggested addresses. + :type suggested_addresses: list[~azure.mgmt.billing.models.Address] + :param validation_message: Validation error message. + :type validation_message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'suggested_addresses': {'key': 'suggestedAddresses', 'type': '[Address]'}, + 'validation_message': {'key': 'validationMessage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ValidateAddressResponse, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.suggested_addresses = kwargs.get('suggested_addresses', None) + self.validation_message = kwargs.get('validation_message', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response_py3.py new file mode 100644 index 000000000000..9e01d7871ec4 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response_py3.py @@ -0,0 +1,37 @@ +# 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 ValidateAddressResponse(Model): + """Result of the address validation. + + :param status: status of the address validation. Possible values include: + 'Valid', 'Invalid' + :type status: str or ~azure.mgmt.billing.models.AddressValidationStatus + :param suggested_addresses: list of suggested addresses. + :type suggested_addresses: list[~azure.mgmt.billing.models.Address] + :param validation_message: Validation error message. + :type validation_message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'suggested_addresses': {'key': 'suggestedAddresses', 'type': '[Address]'}, + 'validation_message': {'key': 'validationMessage', 'type': 'str'}, + } + + def __init__(self, *, status=None, suggested_addresses=None, validation_message: str=None, **kwargs) -> None: + super(ValidateAddressResponse, self).__init__(**kwargs) + self.status = status + self.suggested_addresses = suggested_addresses + self.validation_message = validation_message diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index de5bb964fe5a..d9a2ca49fe76 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -11,6 +11,7 @@ from .billing_accounts_operations import BillingAccountsOperations from .payment_methods_operations import PaymentMethodsOperations +from .billing_accounts_validate_address_operations import BillingAccountsValidateAddressOperations from .available_balances_operations import AvailableBalancesOperations from .billing_profiles_operations import BillingProfilesOperations from .invoice_sections_operations import InvoiceSectionsOperations @@ -35,6 +36,7 @@ __all__ = [ 'BillingAccountsOperations', 'PaymentMethodsOperations', + 'BillingAccountsValidateAddressOperations', 'AvailableBalancesOperations', 'BillingProfilesOperations', 'InvoiceSectionsOperations', diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_validate_address_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_validate_address_operations.py new file mode 100644 index 000000000000..d9d42f694909 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_validate_address_operations.py @@ -0,0 +1,100 @@ +# 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 BillingAccountsValidateAddressOperations(object): + """BillingAccountsValidateAddressOperations 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 post( + self, billing_account_name, address, custom_headers=None, raw=False, **operation_config): + """Validates the address. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param address: + :type address: ~azure.mgmt.billing.models.Address + :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: ValidateAddressResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.ValidateAddressResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.post.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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(address, 'Address') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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('ValidateAddressResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + post.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/validateAddress'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py index 0ec917aa6c7d..0fc591e8d027 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py @@ -111,6 +111,7 @@ def _increase_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -126,19 +127,27 @@ def _increase_initial( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [202]: + if response.status_code not in [200, 202]: raise models.ErrorResponseException(self._deserialize, response) - if raw: - client_raw_response = ClientRawResponse(None, response) + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('LineOfCredit', response) header_dict = { 'Location': 'str', 'Retry-After': 'int', 'Azure-AsyncOperation': 'str', } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) client_raw_response.add_headers(header_dict) return client_raw_response + return deserialized + def increase( self, desired_credit_limit=None, custom_headers=None, raw=False, polling=True, **operation_config): """Increase the current line of credit. @@ -150,10 +159,12 @@ def increase( direct response alongside the deserialized response :param polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :return: An instance of LROPoller that returns LineOfCredit or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.LineOfCredit] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.LineOfCredit]] :raises: :class:`ErrorResponseException` """ @@ -165,15 +176,20 @@ def increase( ) def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + 'Azure-AsyncOperation': 'str', + } + deserialized = self._deserialize('LineOfCredit', response) + if raw: - client_raw_response = ClientRawResponse(None, response) - client_raw_response.add_headers({ - 'Location': 'str', - 'Retry-After': 'int', - 'Azure-AsyncOperation': 'str', - }) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + return deserialized + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) From 2618560852817e8b0636b35ddb6306e0dbbe521f Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 24 May 2019 20:36:01 +0000 Subject: [PATCH 3/5] Generated from 80551f21cab1e4f92c88998ba33a31f8ecf3cb11 Incorporated review comments Incorporated review comments --- .../azure/mgmt/billing/models/__init__.py | 2 ++ .../billing/models/billing_management_client_enums.py | 6 ++++++ .../azure/mgmt/billing/models/line_of_credit.py | 8 ++++---- .../azure/mgmt/billing/models/line_of_credit_py3.py | 10 +++++----- .../billing/operations/line_of_credits_operations.py | 2 +- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py index 6ec31ad95fbd..143fd913aff6 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py @@ -159,6 +159,7 @@ ReservationType, PaymentMethodType, UpdateAutoRenew, + Status, ) __all__ = [ @@ -245,4 +246,5 @@ 'ReservationType', 'PaymentMethodType', 'UpdateAutoRenew', + 'Status', ] diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py index ac825bb2de95..99813d1714b1 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py @@ -100,3 +100,9 @@ class UpdateAutoRenew(str, Enum): true = "true" false = "false" + + +class Status(str, Enum): + + approved = "Approved" + rejected = "Rejected" diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit.py index 92856b9d67d8..90cd13910903 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit.py @@ -30,8 +30,9 @@ class LineOfCredit(Resource): :vartype reason: str :ivar remaining_balance: Remaining balance. :vartype remaining_balance: ~azure.mgmt.billing.models.Amount - :ivar status: The line of credit status. - :vartype status: str + :param status: The line of credit status. Possible values include: + 'Approved', 'Rejected' + :type status: str or ~azure.mgmt.billing.models.Status """ _validation = { @@ -41,7 +42,6 @@ class LineOfCredit(Resource): 'credit_limit': {'readonly': True}, 'reason': {'readonly': True}, 'remaining_balance': {'readonly': True}, - 'status': {'readonly': True}, } _attribute_map = { @@ -59,4 +59,4 @@ def __init__(self, **kwargs): self.credit_limit = None self.reason = None self.remaining_balance = None - self.status = None + self.status = kwargs.get('status', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit_py3.py index a6f84e6babee..714701ecd222 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit_py3.py @@ -30,8 +30,9 @@ class LineOfCredit(Resource): :vartype reason: str :ivar remaining_balance: Remaining balance. :vartype remaining_balance: ~azure.mgmt.billing.models.Amount - :ivar status: The line of credit status. - :vartype status: str + :param status: The line of credit status. Possible values include: + 'Approved', 'Rejected' + :type status: str or ~azure.mgmt.billing.models.Status """ _validation = { @@ -41,7 +42,6 @@ class LineOfCredit(Resource): 'credit_limit': {'readonly': True}, 'reason': {'readonly': True}, 'remaining_balance': {'readonly': True}, - 'status': {'readonly': True}, } _attribute_map = { @@ -54,9 +54,9 @@ class LineOfCredit(Resource): 'status': {'key': 'properties.status', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, status=None, **kwargs) -> None: super(LineOfCredit, self).__init__(**kwargs) self.credit_limit = None self.reason = None self.remaining_balance = None - self.status = None + self.status = status diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py index 0fc591e8d027..d0c5d8cc5409 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py @@ -193,7 +193,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) From 3e28cf8f90ff646ece51b798358dbc4095771df4 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 28 May 2019 18:35:36 +0000 Subject: [PATCH 4/5] Generated from 78b382bcf6f31a2a155f0373c8ef55c8d18b6a90 Incorporated review comments Incorporated review comments --- .../mgmt/billing/operations/billing_profiles_operations.py | 2 +- .../mgmt/billing/operations/invoice_sections_operations.py | 2 +- .../mgmt/billing/operations/line_of_credits_operations.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py index 918c13dcd9b0..d98add3bbe9f 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py @@ -193,7 +193,7 @@ def _update_initial( body_content = self._serialize.body(parameters, 'BillingProfile') # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) + request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py index a40226e73bce..ef9c355efe1c 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py @@ -432,7 +432,7 @@ def _update_initial( body_content = self._serialize.body(parameters, 'InvoiceSection') # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) + request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py index d0c5d8cc5409..34571fb72c03 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py @@ -124,7 +124,7 @@ def _increase_initial( body_content = self._serialize.body(parameters, 'IncreaseLineOfCreditRequestProperties') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) + request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: @@ -193,7 +193,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) From e0e50a9e075f36395c8097f22af1f7eaab2a6180 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 28 May 2019 20:54:38 +0000 Subject: [PATCH 5/5] Generated from 0c5738c1ac902fc62400b432cbf3f0459ba831ea Updated the increase api Updated the increase api --- .../mgmt/billing/operations/line_of_credits_operations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py index 34571fb72c03..d0c5d8cc5409 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py @@ -124,7 +124,7 @@ def _increase_initial( body_content = self._serialize.body(parameters, 'IncreaseLineOfCreditRequestProperties') # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: @@ -193,7 +193,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method)