From 80e0bcbf0e22bba8577a845abaf0d9607d84f96c Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 18 Jul 2019 02:28:50 +0000 Subject: [PATCH 01/18] Generated from 967bc1303f9d53c4b90d8b99c4faae3c79adc8f8 Billing RP spec changes for GTM FieldLed-Go-Big Billing RP spec changes for GTM FieldLed-Go-Big --- .../mgmt/billing/billing_management_client.py | 10 +- .../azure/mgmt/billing/models/__init__.py | 89 +++--- .../{enabled_azure_sk_us.py => azure_plan.py} | 6 +- ...d_azure_sk_us_py3.py => azure_plan_py3.py} | 6 +- .../mgmt/billing/models/billing_account.py | 45 +-- .../billing/models/billing_account_py3.py | 47 ++- ...s.py => billing_account_update_request.py} | 51 ++- ... => billing_account_update_request_py3.py} | 53 ++-- .../models/billing_management_client_enums.py | 24 ++ .../mgmt/billing/models/billing_profile.py | 14 +- ...py => billing_profile_creation_request.py} | 15 +- ...> billing_profile_creation_request_py3.py} | 17 +- .../billing/models/billing_profile_py3.py | 16 +- .../mgmt/billing/models/billing_property.py | 30 +- .../billing/models/billing_property_py3.py | 30 +- ...ion_summary.py => billing_subscription.py} | 30 +- ...paged.py => billing_subscription_paged.py} | 8 +- ...ary_py3.py => billing_subscription_py3.py} | 30 +- .../billing_subscriptions_list_result.py | 9 +- .../billing_subscriptions_list_result_py3.py | 9 +- .../{download_properties.py => document.py} | 4 +- ...load_properties_py3.py => document_py3.py} | 4 +- .../models/initiate_transfer_request.py | 4 - .../models/initiate_transfer_request_py3.py | 6 +- .../models/{invoice_summary.py => invoice.py} | 28 +- .../billing/models/invoice_list_result.py | 4 +- .../billing/models/invoice_list_result_py3.py | 4 +- ...{invoice_summary_py3.py => invoice_py3.py} | 28 +- .../mgmt/billing/models/invoice_section.py | 5 - .../billing/models/invoice_section_py3.py | 7 +- .../mgmt/billing/models/operation_status.py | 43 --- .../billing/models/operation_status_py3.py | 43 --- .../azure/mgmt/billing/models/policy.py | 38 ++- .../azure/mgmt/billing/models/policy_py3.py | 40 ++- .../models/{product_summary.py => product.py} | 30 +- ...duct_summary_paged.py => product_paged.py} | 8 +- ...{product_summary_py3.py => product_py3.py} | 30 +- .../billing/models/products_list_result.py | 10 +- .../models/products_list_result_py3.py | 10 +- ...transactions_summary.py => transaction.py} | 30 +- ...t_result.py => transaction_list_result.py} | 12 +- ..._py3.py => transaction_list_result_py3.py} | 12 +- ..._summary_paged.py => transaction_paged.py} | 8 +- ...ions_summary_py3.py => transaction_py3.py} | 30 +- .../mgmt/billing/models/transfer_details.py | 5 + .../billing/models/transfer_details_py3.py | 5 + ...mary.py => update_auto_renew_operation.py} | 4 +- ....py => update_auto_renew_operation_py3.py} | 4 +- .../azure/mgmt/billing/operations/__init__.py | 4 +- ...es_operations.py => address_operations.py} | 8 +- .../operations/agreements_operations.py | 4 +- .../available_balances_operations.py | 4 +- .../operations/billing_accounts_operations.py | 16 +- .../billing_permissions_operations.py | 15 +- .../operations/billing_profiles_operations.py | 162 +++++----- .../operations/billing_property_operations.py | 4 +- .../billing_role_assignments_operations.py | 48 +-- .../billing_role_definitions_operations.py | 26 +- .../billing_subscriptions_operations.py | 51 +-- .../operations/departments_operations.py | 4 +- .../enrollment_accounts_operations.py | 4 +- .../operations/invoice_sections_operations.py | 300 +++++++----------- .../billing/operations/invoices_operations.py | 10 +- .../operations/line_of_credits_operations.py | 6 +- .../mgmt/billing/operations/operations.py | 4 +- .../operations/payment_methods_operations.py | 4 +- .../billing/operations/policies_operations.py | 4 +- .../operations/price_sheet_operations.py | 6 +- .../billing/operations/products_operations.py | 74 +++-- .../recipient_transfers_operations.py | 2 +- .../operations/transactions_operations.py | 97 +++++- .../operations/transfers_operations.py | 33 +- 72 files changed, 920 insertions(+), 965 deletions(-) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{enabled_azure_sk_us.py => azure_plan.py} (89%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{enabled_azure_sk_us_py3.py => azure_plan_py3.py} (89%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{billing_account_update_properties.py => billing_account_update_request.py} (62%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{billing_account_update_properties_py3.py => billing_account_update_request_py3.py} (59%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{billing_profile_creation_parameters.py => billing_profile_creation_request.py} (74%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{billing_profile_creation_parameters_py3.py => billing_profile_creation_request_py3.py} (70%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{billing_subscription_summary.py => billing_subscription.py} (80%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{billing_subscription_summary_paged.py => billing_subscription_paged.py} (77%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{billing_subscription_summary_py3.py => billing_subscription_py3.py} (80%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{download_properties.py => document.py} (92%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{download_properties_py3.py => document_py3.py} (92%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{invoice_summary.py => invoice.py} (83%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{invoice_summary_py3.py => invoice_py3.py} (83%) delete mode 100644 sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_status.py delete mode 100644 sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{product_summary.py => product.py} (86%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{product_summary_paged.py => product_paged.py} (75%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{product_summary_py3.py => product_py3.py} (86%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{transactions_summary.py => transaction.py} (85%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{transactions_list_result.py => transaction_list_result.py} (73%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{transactions_list_result_py3.py => transaction_list_result_py3.py} (73%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{transactions_summary_paged.py => transaction_paged.py} (73%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{transactions_summary_py3.py => transaction_py3.py} (86%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{update_auto_renew_operation_summary.py => update_auto_renew_operation.py} (87%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{update_auto_renew_operation_summary_py3.py => update_auto_renew_operation_py3.py} (87%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/{addresses_operations.py => address_operations.py} (94%) 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 95cf1a9c0b59..4506fcba2412 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,7 +15,7 @@ from .version import VERSION from .operations.billing_accounts_operations import BillingAccountsOperations from .operations.payment_methods_operations import PaymentMethodsOperations -from .operations.addresses_operations import AddressesOperations +from .operations.address_operations import AddressOperations from .operations.available_balances_operations import AvailableBalancesOperations from .operations.billing_profiles_operations import BillingProfilesOperations from .operations.invoice_sections_operations import InvoiceSectionsOperations @@ -81,8 +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 addresses: Addresses operations - :vartype addresses: azure.mgmt.billing.operations.AddressesOperations + :ivar address: Address operations + :vartype address: azure.mgmt.billing.operations.AddressOperations :ivar available_balances: AvailableBalances operations :vartype available_balances: azure.mgmt.billing.operations.AvailableBalancesOperations :ivar billing_profiles: BillingProfiles operations @@ -139,7 +139,7 @@ def __init__( 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-11-01-preview' + self.api_version = '2019-10-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -147,7 +147,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.payment_methods = PaymentMethodsOperations( self._client, self.config, self._serialize, self._deserialize) - self.addresses = AddressesOperations( + self.address = AddressOperations( self._client, self.config, self._serialize, self._deserialize) self.available_balances = AvailableBalancesOperations( 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 792d55a5e5b9..df5eab1ad7ef 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 @@ -25,43 +25,42 @@ from .transfer_billing_subscription_request_py3 import TransferBillingSubscriptionRequest from .validate_subscription_transfer_eligibility_error_py3 import ValidateSubscriptionTransferEligibilityError from .validate_subscription_transfer_eligibility_result_py3 import ValidateSubscriptionTransferEligibilityResult - from .update_auto_renew_operation_summary_py3 import UpdateAutoRenewOperationSummary - from .enabled_azure_sk_us_py3 import EnabledAzureSKUs - from .billing_profile_py3 import BillingProfile + from .update_auto_renew_operation_py3 import UpdateAutoRenewOperation + from .azure_plan_py3 import AzurePlan from .invoice_section_py3 import InvoiceSection + from .billing_profile_py3 import BillingProfile from .enrollment_policies_py3 import EnrollmentPolicies from .enrollment_py3 import Enrollment from .enrollment_account_py3 import EnrollmentAccount from .department_py3 import Department from .billing_account_py3 import BillingAccount from .billing_account_list_result_py3 import BillingAccountListResult - from .billing_account_update_properties_py3 import BillingAccountUpdateProperties + from .billing_account_update_request_py3 import BillingAccountUpdateRequest from .billing_property_py3 import BillingProperty from .department_list_result_py3 import DepartmentListResult from .enrollment_account_list_result_py3 import EnrollmentAccountListResult from .billing_profile_list_result_py3 import BillingProfileListResult - from .billing_profile_creation_parameters_py3 import BillingProfileCreationParameters + from .billing_profile_creation_request_py3 import BillingProfileCreationRequest from .invoice_section_creation_request_py3 import InvoiceSectionCreationRequest from .invoice_section_list_result_py3 import InvoiceSectionListResult - from .operation_status_py3 import OperationStatus from .download_url_py3 import DownloadUrl from .error_details_py3 import ErrorDetails from .error_response_py3 import ErrorResponse, ErrorResponseException from .resource_py3 import Resource from .amount_py3 import Amount - from .download_properties_py3 import DownloadProperties + from .document_py3 import Document from .payment_properties_py3 import PaymentProperties - from .invoice_summary_py3 import InvoiceSummary + from .invoice_py3 import Invoice from .invoice_list_result_py3 import InvoiceListResult - from .product_summary_py3 import ProductSummary + from .product_py3 import Product from .products_list_result_py3 import ProductsListResult from .validate_product_transfer_eligibility_error_py3 import ValidateProductTransferEligibilityError from .validate_product_transfer_eligibility_result_py3 import ValidateProductTransferEligibilityResult - from .billing_subscription_summary_py3 import BillingSubscriptionSummary + from .billing_subscription_py3 import BillingSubscription from .billing_subscriptions_list_result_py3 import BillingSubscriptionsListResult from .enrollment_account_context_py3 import EnrollmentAccountContext - from .transactions_summary_py3 import TransactionsSummary - from .transactions_list_result_py3 import TransactionsListResult + from .transaction_py3 import Transaction + from .transaction_list_result_py3 import TransactionListResult from .policy_py3 import Policy from .available_balance_py3 import AvailableBalance from .payment_method_py3 import PaymentMethod @@ -95,43 +94,42 @@ from .transfer_billing_subscription_request import TransferBillingSubscriptionRequest from .validate_subscription_transfer_eligibility_error import ValidateSubscriptionTransferEligibilityError from .validate_subscription_transfer_eligibility_result import ValidateSubscriptionTransferEligibilityResult - from .update_auto_renew_operation_summary import UpdateAutoRenewOperationSummary - from .enabled_azure_sk_us import EnabledAzureSKUs - from .billing_profile import BillingProfile + from .update_auto_renew_operation import UpdateAutoRenewOperation + from .azure_plan import AzurePlan from .invoice_section import InvoiceSection + from .billing_profile import BillingProfile from .enrollment_policies import EnrollmentPolicies from .enrollment import Enrollment from .enrollment_account import EnrollmentAccount from .department import Department from .billing_account import BillingAccount from .billing_account_list_result import BillingAccountListResult - from .billing_account_update_properties import BillingAccountUpdateProperties + from .billing_account_update_request import BillingAccountUpdateRequest from .billing_property import BillingProperty from .department_list_result import DepartmentListResult from .enrollment_account_list_result import EnrollmentAccountListResult from .billing_profile_list_result import BillingProfileListResult - from .billing_profile_creation_parameters import BillingProfileCreationParameters + from .billing_profile_creation_request import BillingProfileCreationRequest from .invoice_section_creation_request import InvoiceSectionCreationRequest from .invoice_section_list_result import InvoiceSectionListResult - from .operation_status import OperationStatus from .download_url import DownloadUrl from .error_details import ErrorDetails from .error_response import ErrorResponse, ErrorResponseException from .resource import Resource from .amount import Amount - from .download_properties import DownloadProperties + from .document import Document from .payment_properties import PaymentProperties - from .invoice_summary import InvoiceSummary + from .invoice import Invoice from .invoice_list_result import InvoiceListResult - from .product_summary import ProductSummary + from .product import Product from .products_list_result import ProductsListResult from .validate_product_transfer_eligibility_error import ValidateProductTransferEligibilityError from .validate_product_transfer_eligibility_result import ValidateProductTransferEligibilityResult - from .billing_subscription_summary import BillingSubscriptionSummary + from .billing_subscription import BillingSubscription from .billing_subscriptions_list_result import BillingSubscriptionsListResult from .enrollment_account_context import EnrollmentAccountContext - from .transactions_summary import TransactionsSummary - from .transactions_list_result import TransactionsListResult + from .transaction import Transaction + from .transaction_list_result import TransactionListResult from .policy import Policy from .available_balance import AvailableBalance from .payment_method import PaymentMethod @@ -150,9 +148,9 @@ from .agreement_list_result import AgreementListResult from .line_of_credit import LineOfCredit from .payment_method_paged import PaymentMethodPaged -from .billing_subscription_summary_paged import BillingSubscriptionSummaryPaged -from .product_summary_paged import ProductSummaryPaged -from .transactions_summary_paged import TransactionsSummaryPaged +from .billing_subscription_paged import BillingSubscriptionPaged +from .product_paged import ProductPaged +from .transaction_paged import TransactionPaged from .transfer_details_paged import TransferDetailsPaged from .recipient_transfer_details_paged import RecipientTransferDetailsPaged from .operation_paged import OperationPaged @@ -169,6 +167,10 @@ BillingSubscriptionStatusType, TransactionTypeKind, ReservationType, + MarketplacePurchasesPolicy, + ReservationPurchasesPolicy, + ViewChargesPolicy, + FreeMarketplacePurchasesPolicy, PaymentMethodType, UpdateAutoRenew, Status, @@ -190,43 +192,42 @@ 'TransferBillingSubscriptionRequest', 'ValidateSubscriptionTransferEligibilityError', 'ValidateSubscriptionTransferEligibilityResult', - 'UpdateAutoRenewOperationSummary', - 'EnabledAzureSKUs', - 'BillingProfile', + 'UpdateAutoRenewOperation', + 'AzurePlan', 'InvoiceSection', + 'BillingProfile', 'EnrollmentPolicies', 'Enrollment', 'EnrollmentAccount', 'Department', 'BillingAccount', 'BillingAccountListResult', - 'BillingAccountUpdateProperties', + 'BillingAccountUpdateRequest', 'BillingProperty', 'DepartmentListResult', 'EnrollmentAccountListResult', 'BillingProfileListResult', - 'BillingProfileCreationParameters', + 'BillingProfileCreationRequest', 'InvoiceSectionCreationRequest', 'InvoiceSectionListResult', - 'OperationStatus', 'DownloadUrl', 'ErrorDetails', 'ErrorResponse', 'ErrorResponseException', 'Resource', 'Amount', - 'DownloadProperties', + 'Document', 'PaymentProperties', - 'InvoiceSummary', + 'Invoice', 'InvoiceListResult', - 'ProductSummary', + 'Product', 'ProductsListResult', 'ValidateProductTransferEligibilityError', 'ValidateProductTransferEligibilityResult', - 'BillingSubscriptionSummary', + 'BillingSubscription', 'BillingSubscriptionsListResult', 'EnrollmentAccountContext', - 'TransactionsSummary', - 'TransactionsListResult', + 'Transaction', + 'TransactionListResult', 'Policy', 'AvailableBalance', 'PaymentMethod', @@ -245,9 +246,9 @@ 'AgreementListResult', 'LineOfCredit', 'PaymentMethodPaged', - 'BillingSubscriptionSummaryPaged', - 'ProductSummaryPaged', - 'TransactionsSummaryPaged', + 'BillingSubscriptionPaged', + 'ProductPaged', + 'TransactionPaged', 'TransferDetailsPaged', 'RecipientTransferDetailsPaged', 'OperationPaged', @@ -263,6 +264,10 @@ 'BillingSubscriptionStatusType', 'TransactionTypeKind', 'ReservationType', + 'MarketplacePurchasesPolicy', + 'ReservationPurchasesPolicy', + 'ViewChargesPolicy', + 'FreeMarketplacePurchasesPolicy', 'PaymentMethodType', 'UpdateAutoRenew', 'Status', diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/azure_plan.py similarity index 89% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/azure_plan.py index 0901afc5798b..35f94d6c4bb5 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/azure_plan.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class EnabledAzureSKUs(Model): - """Details about the enabled azure sku. +class AzurePlan(Model): + """Details about the azure plan. Variables are only populated by the server, and will be ignored when sending a request. @@ -34,6 +34,6 @@ class EnabledAzureSKUs(Model): } def __init__(self, **kwargs): - super(EnabledAzureSKUs, self).__init__(**kwargs) + super(AzurePlan, self).__init__(**kwargs) self.sku_id = kwargs.get('sku_id', None) self.sku_description = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/azure_plan_py3.py similarity index 89% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/azure_plan_py3.py index 8790cc2f3efb..cfc19829051c 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/azure_plan_py3.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class EnabledAzureSKUs(Model): - """Details about the enabled azure sku. +class AzurePlan(Model): + """Details about the azure plan. Variables are only populated by the server, and will be ignored when sending a request. @@ -34,6 +34,6 @@ class EnabledAzureSKUs(Model): } def __init__(self, *, sku_id: str=None, **kwargs) -> None: - super(EnabledAzureSKUs, self).__init__(**kwargs) + super(AzurePlan, self).__init__(**kwargs) self.sku_id = sku_id self.sku_description = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py index 2f36b5ce3732..75d45bb42afb 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py @@ -26,19 +26,14 @@ class BillingAccount(Resource): :vartype type: str :ivar display_name: The billing account name. :vartype display_name: str - :ivar account_type: The billing account Type. Possible values include: - 'Organization', 'Enrollment' - :vartype account_type: str or ~azure.mgmt.billing.models.enum :param address: The address associated with billing account. :type address: ~azure.mgmt.billing.models.Address - :ivar company: Company Name. - :vartype company: str - :ivar country: Country Name. - :vartype country: str - :param invoice_sections: The invoice sections associated to the billing - account. By default this is not populated, unless it's specified in - $expand. - :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] + :ivar agreement_type: The type of agreement. Possible values include: + 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'Legacy' + :vartype agreement_type: str or ~azure.mgmt.billing.models.enum + :ivar customer_type: The type of customer. Possible values include: + 'Enterprise', 'Individual', 'Partner' + :vartype customer_type: str or ~azure.mgmt.billing.models.enum :param billing_profiles: The billing profiles associated to the billing account. By default this is not populated, unless it's specified in $expand. @@ -52,9 +47,8 @@ class BillingAccount(Resource): :param enrollment_accounts: The accounts associated to the enrollment. :type enrollment_accounts: list[~azure.mgmt.billing.models.EnrollmentAccount] - :ivar has_read_access: Specifies whether the user has read access on - billing account. - :vartype has_read_access: bool + :ivar organization_id: Organization id. + :vartype organization_id: str """ _validation = { @@ -62,11 +56,10 @@ class BillingAccount(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'display_name': {'readonly': True}, - 'account_type': {'readonly': True}, - 'company': {'readonly': True}, - 'country': {'readonly': True}, + 'agreement_type': {'readonly': True}, + 'customer_type': {'readonly': True}, 'enrollment_details': {'readonly': True}, - 'has_read_access': {'readonly': True}, + 'organization_id': {'readonly': True}, } _attribute_map = { @@ -74,28 +67,24 @@ class BillingAccount(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'account_type': {'key': 'properties.accountType', 'type': 'str'}, 'address': {'key': 'properties.address', 'type': 'Address'}, - 'company': {'key': 'properties.company', 'type': 'str'}, - 'country': {'key': 'properties.country', 'type': 'str'}, - 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, + 'agreement_type': {'key': 'properties.agreementType', 'type': 'str'}, + 'customer_type': {'key': 'properties.customerType', 'type': 'str'}, 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, 'enrollment_details': {'key': 'properties.enrollmentDetails', 'type': 'Enrollment'}, 'departments': {'key': 'properties.departments', 'type': '[Department]'}, 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, - 'has_read_access': {'key': 'properties.hasReadAccess', 'type': 'bool'}, + 'organization_id': {'key': 'properties.organizationId', 'type': 'str'}, } def __init__(self, **kwargs): super(BillingAccount, self).__init__(**kwargs) self.display_name = None - self.account_type = None self.address = kwargs.get('address', None) - self.company = None - self.country = None - self.invoice_sections = kwargs.get('invoice_sections', None) + self.agreement_type = None + self.customer_type = None self.billing_profiles = kwargs.get('billing_profiles', None) self.enrollment_details = None self.departments = kwargs.get('departments', None) self.enrollment_accounts = kwargs.get('enrollment_accounts', None) - self.has_read_access = None + self.organization_id = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py index 5ecccfed7272..b2b163b09107 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py @@ -26,19 +26,14 @@ class BillingAccount(Resource): :vartype type: str :ivar display_name: The billing account name. :vartype display_name: str - :ivar account_type: The billing account Type. Possible values include: - 'Organization', 'Enrollment' - :vartype account_type: str or ~azure.mgmt.billing.models.enum :param address: The address associated with billing account. :type address: ~azure.mgmt.billing.models.Address - :ivar company: Company Name. - :vartype company: str - :ivar country: Country Name. - :vartype country: str - :param invoice_sections: The invoice sections associated to the billing - account. By default this is not populated, unless it's specified in - $expand. - :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] + :ivar agreement_type: The type of agreement. Possible values include: + 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'Legacy' + :vartype agreement_type: str or ~azure.mgmt.billing.models.enum + :ivar customer_type: The type of customer. Possible values include: + 'Enterprise', 'Individual', 'Partner' + :vartype customer_type: str or ~azure.mgmt.billing.models.enum :param billing_profiles: The billing profiles associated to the billing account. By default this is not populated, unless it's specified in $expand. @@ -52,9 +47,8 @@ class BillingAccount(Resource): :param enrollment_accounts: The accounts associated to the enrollment. :type enrollment_accounts: list[~azure.mgmt.billing.models.EnrollmentAccount] - :ivar has_read_access: Specifies whether the user has read access on - billing account. - :vartype has_read_access: bool + :ivar organization_id: Organization id. + :vartype organization_id: str """ _validation = { @@ -62,11 +56,10 @@ class BillingAccount(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'display_name': {'readonly': True}, - 'account_type': {'readonly': True}, - 'company': {'readonly': True}, - 'country': {'readonly': True}, + 'agreement_type': {'readonly': True}, + 'customer_type': {'readonly': True}, 'enrollment_details': {'readonly': True}, - 'has_read_access': {'readonly': True}, + 'organization_id': {'readonly': True}, } _attribute_map = { @@ -74,28 +67,24 @@ class BillingAccount(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'account_type': {'key': 'properties.accountType', 'type': 'str'}, 'address': {'key': 'properties.address', 'type': 'Address'}, - 'company': {'key': 'properties.company', 'type': 'str'}, - 'country': {'key': 'properties.country', 'type': 'str'}, - 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, + 'agreement_type': {'key': 'properties.agreementType', 'type': 'str'}, + 'customer_type': {'key': 'properties.customerType', 'type': 'str'}, 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, 'enrollment_details': {'key': 'properties.enrollmentDetails', 'type': 'Enrollment'}, 'departments': {'key': 'properties.departments', 'type': '[Department]'}, 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, - 'has_read_access': {'key': 'properties.hasReadAccess', 'type': 'bool'}, + 'organization_id': {'key': 'properties.organizationId', 'type': 'str'}, } - def __init__(self, *, address=None, invoice_sections=None, billing_profiles=None, departments=None, enrollment_accounts=None, **kwargs) -> None: + def __init__(self, *, address=None, billing_profiles=None, departments=None, enrollment_accounts=None, **kwargs) -> None: super(BillingAccount, self).__init__(**kwargs) self.display_name = None - self.account_type = None self.address = address - self.company = None - self.country = None - self.invoice_sections = invoice_sections + self.agreement_type = None + self.customer_type = None self.billing_profiles = billing_profiles self.enrollment_details = None self.departments = departments self.enrollment_accounts = enrollment_accounts - self.has_read_access = None + self.organization_id = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_properties.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request.py similarity index 62% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_properties.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request.py index ec14b8841115..51b8365bfea0 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_properties.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request.py @@ -12,27 +12,22 @@ from msrest.serialization import Model -class BillingAccountUpdateProperties(Model): - """The properties of the billing account that can be updated. +class BillingAccountUpdateRequest(Model): + """The request properties of the billing account that can be updated. Variables are only populated by the server, and will be ignored when sending a request. :ivar display_name: The billing account name. :vartype display_name: str - :ivar account_type: The billing account Type. Possible values include: - 'Organization', 'Enrollment' - :vartype account_type: str or ~azure.mgmt.billing.models.enum :param address: The address associated with billing account. :type address: ~azure.mgmt.billing.models.Address - :ivar company: Company Name. - :vartype company: str - :ivar country: Country Name. - :vartype country: str - :param invoice_sections: The invoice sections associated to the billing - account. By default this is not populated, unless it's specified in - $expand. - :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] + :ivar agreement_type: The type of agreement. Possible values include: + 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'Legacy' + :vartype agreement_type: str or ~azure.mgmt.billing.models.enum + :ivar customer_type: The type of customer. Possible values include: + 'Enterprise', 'Individual', 'Partner' + :vartype customer_type: str or ~azure.mgmt.billing.models.enum :param billing_profiles: The billing profiles associated to the billing account. By default this is not populated, unless it's specified in $expand. @@ -46,44 +41,38 @@ class BillingAccountUpdateProperties(Model): :param enrollment_accounts: The accounts associated to the enrollment. :type enrollment_accounts: list[~azure.mgmt.billing.models.EnrollmentAccount] - :ivar has_read_access: Specifies whether the user has read access on - billing account. - :vartype has_read_access: bool + :ivar organization_id: Organization id. + :vartype organization_id: str """ _validation = { 'display_name': {'readonly': True}, - 'account_type': {'readonly': True}, - 'company': {'readonly': True}, - 'country': {'readonly': True}, + 'agreement_type': {'readonly': True}, + 'customer_type': {'readonly': True}, 'enrollment_details': {'readonly': True}, - 'has_read_access': {'readonly': True}, + 'organization_id': {'readonly': True}, } _attribute_map = { 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'account_type': {'key': 'properties.accountType', 'type': 'str'}, 'address': {'key': 'properties.address', 'type': 'Address'}, - 'company': {'key': 'properties.company', 'type': 'str'}, - 'country': {'key': 'properties.country', 'type': 'str'}, - 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, + 'agreement_type': {'key': 'properties.agreementType', 'type': 'str'}, + 'customer_type': {'key': 'properties.customerType', 'type': 'str'}, 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, 'enrollment_details': {'key': 'properties.enrollmentDetails', 'type': 'Enrollment'}, 'departments': {'key': 'properties.departments', 'type': '[Department]'}, 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, - 'has_read_access': {'key': 'properties.hasReadAccess', 'type': 'bool'}, + 'organization_id': {'key': 'properties.organizationId', 'type': 'str'}, } def __init__(self, **kwargs): - super(BillingAccountUpdateProperties, self).__init__(**kwargs) + super(BillingAccountUpdateRequest, self).__init__(**kwargs) self.display_name = None - self.account_type = None self.address = kwargs.get('address', None) - self.company = None - self.country = None - self.invoice_sections = kwargs.get('invoice_sections', None) + self.agreement_type = None + self.customer_type = None self.billing_profiles = kwargs.get('billing_profiles', None) self.enrollment_details = None self.departments = kwargs.get('departments', None) self.enrollment_accounts = kwargs.get('enrollment_accounts', None) - self.has_read_access = None + self.organization_id = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_properties_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request_py3.py similarity index 59% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_properties_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request_py3.py index b04d059fc9dc..ab7fa54c8d4f 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_properties_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request_py3.py @@ -12,27 +12,22 @@ from msrest.serialization import Model -class BillingAccountUpdateProperties(Model): - """The properties of the billing account that can be updated. +class BillingAccountUpdateRequest(Model): + """The request properties of the billing account that can be updated. Variables are only populated by the server, and will be ignored when sending a request. :ivar display_name: The billing account name. :vartype display_name: str - :ivar account_type: The billing account Type. Possible values include: - 'Organization', 'Enrollment' - :vartype account_type: str or ~azure.mgmt.billing.models.enum :param address: The address associated with billing account. :type address: ~azure.mgmt.billing.models.Address - :ivar company: Company Name. - :vartype company: str - :ivar country: Country Name. - :vartype country: str - :param invoice_sections: The invoice sections associated to the billing - account. By default this is not populated, unless it's specified in - $expand. - :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] + :ivar agreement_type: The type of agreement. Possible values include: + 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'Legacy' + :vartype agreement_type: str or ~azure.mgmt.billing.models.enum + :ivar customer_type: The type of customer. Possible values include: + 'Enterprise', 'Individual', 'Partner' + :vartype customer_type: str or ~azure.mgmt.billing.models.enum :param billing_profiles: The billing profiles associated to the billing account. By default this is not populated, unless it's specified in $expand. @@ -46,44 +41,38 @@ class BillingAccountUpdateProperties(Model): :param enrollment_accounts: The accounts associated to the enrollment. :type enrollment_accounts: list[~azure.mgmt.billing.models.EnrollmentAccount] - :ivar has_read_access: Specifies whether the user has read access on - billing account. - :vartype has_read_access: bool + :ivar organization_id: Organization id. + :vartype organization_id: str """ _validation = { 'display_name': {'readonly': True}, - 'account_type': {'readonly': True}, - 'company': {'readonly': True}, - 'country': {'readonly': True}, + 'agreement_type': {'readonly': True}, + 'customer_type': {'readonly': True}, 'enrollment_details': {'readonly': True}, - 'has_read_access': {'readonly': True}, + 'organization_id': {'readonly': True}, } _attribute_map = { 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'account_type': {'key': 'properties.accountType', 'type': 'str'}, 'address': {'key': 'properties.address', 'type': 'Address'}, - 'company': {'key': 'properties.company', 'type': 'str'}, - 'country': {'key': 'properties.country', 'type': 'str'}, - 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, + 'agreement_type': {'key': 'properties.agreementType', 'type': 'str'}, + 'customer_type': {'key': 'properties.customerType', 'type': 'str'}, 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, 'enrollment_details': {'key': 'properties.enrollmentDetails', 'type': 'Enrollment'}, 'departments': {'key': 'properties.departments', 'type': '[Department]'}, 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, - 'has_read_access': {'key': 'properties.hasReadAccess', 'type': 'bool'}, + 'organization_id': {'key': 'properties.organizationId', 'type': 'str'}, } - def __init__(self, *, address=None, invoice_sections=None, billing_profiles=None, departments=None, enrollment_accounts=None, **kwargs) -> None: - super(BillingAccountUpdateProperties, self).__init__(**kwargs) + def __init__(self, *, address=None, billing_profiles=None, departments=None, enrollment_accounts=None, **kwargs) -> None: + super(BillingAccountUpdateRequest, self).__init__(**kwargs) self.display_name = None - self.account_type = None self.address = address - self.company = None - self.country = None - self.invoice_sections = invoice_sections + self.agreement_type = None + self.customer_type = None self.billing_profiles = billing_profiles self.enrollment_details = None self.departments = departments self.enrollment_accounts = enrollment_accounts - self.has_read_access = None + self.organization_id = None 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 0a6d8f324cc9..25b4b20e11fc 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 @@ -115,6 +115,30 @@ class ReservationType(str, Enum): usage_charge = "Usage Charge" +class MarketplacePurchasesPolicy(str, Enum): + + allowed = "Allowed" + not_allowed = "NotAllowed" + + +class ReservationPurchasesPolicy(str, Enum): + + allowed = "Allowed" + not_allowed = "NotAllowed" + + +class ViewChargesPolicy(str, Enum): + + none = "None" + subscription_owner = "SubscriptionOwner" + + +class FreeMarketplacePurchasesPolicy(str, Enum): + + allowed = "Allowed" + not_allowed = "NotAllowed" + + class PaymentMethodType(str, Enum): credits = "Credits" diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py index daf0f24078cc..f7f0e0178443 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py @@ -33,15 +33,12 @@ class BillingProfile(Resource): :ivar invoice_email_opt_in: If the billing profile is opted in to receive invoices via email. :vartype invoice_email_opt_in: bool - :ivar is_classic: Is OMS bootstrapped billing profile. - :vartype is_classic: bool :ivar invoice_day: Invoice day. :vartype invoice_day: int :ivar currency: The currency associated with the billing profile. :vartype currency: str - :param enabled_azure_sk_us: Information about the product. - :type enabled_azure_sk_us: - list[~azure.mgmt.billing.models.EnabledAzureSKUs] + :param enabled_azure_plans: Information about the enabled azure plans. + :type enabled_azure_plans: list[~azure.mgmt.billing.models.AzurePlan] :param invoice_sections: The invoice sections associated to the billing profile. :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] @@ -52,7 +49,6 @@ class BillingProfile(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'invoice_email_opt_in': {'readonly': True}, - 'is_classic': {'readonly': True}, 'invoice_day': {'readonly': True}, 'currency': {'readonly': True}, } @@ -65,10 +61,9 @@ class BillingProfile(Resource): 'po_number': {'key': 'properties.poNumber', 'type': 'str'}, 'address': {'key': 'properties.address', 'type': 'Address'}, 'invoice_email_opt_in': {'key': 'properties.invoiceEmailOptIn', 'type': 'bool'}, - 'is_classic': {'key': 'properties.isClassic', 'type': 'bool'}, 'invoice_day': {'key': 'properties.invoiceDay', 'type': 'int'}, 'currency': {'key': 'properties.currency', 'type': 'str'}, - 'enabled_azure_sk_us': {'key': 'properties.enabledAzureSKUs', 'type': '[EnabledAzureSKUs]'}, + 'enabled_azure_plans': {'key': 'properties.enabledAzurePlans', 'type': '[AzurePlan]'}, 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, } @@ -78,8 +73,7 @@ def __init__(self, **kwargs): self.po_number = kwargs.get('po_number', None) self.address = kwargs.get('address', None) self.invoice_email_opt_in = None - self.is_classic = None self.invoice_day = None self.currency = None - self.enabled_azure_sk_us = kwargs.get('enabled_azure_sk_us', None) + self.enabled_azure_plans = kwargs.get('enabled_azure_plans', None) self.invoice_sections = kwargs.get('invoice_sections', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_parameters.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request.py similarity index 74% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_parameters.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request.py index 21b02b693320..a091c6b6d460 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_parameters.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class BillingProfileCreationParameters(Model): - """The parameters for creating a new billing profile. +class BillingProfileCreationRequest(Model): + """The request parameters for creating a new billing profile. :param display_name: The billing profile name. :type display_name: str @@ -24,9 +24,8 @@ class BillingProfileCreationParameters(Model): :param invoice_email_opt_in: If the billing profile is opted in to receive invoices via email. :type invoice_email_opt_in: bool - :param enable_azure_sk_us: Azure skus to enable for this billing profile.. - :type enable_azure_sk_us: - list[~azure.mgmt.billing.models.EnabledAzureSKUs] + :param enabled_azure_plans: Enabled azure plans for this billing profile. + :type enabled_azure_plans: list[~azure.mgmt.billing.models.AzurePlan] """ _attribute_map = { @@ -34,13 +33,13 @@ class BillingProfileCreationParameters(Model): 'po_number': {'key': 'poNumber', 'type': 'str'}, 'address': {'key': 'address', 'type': 'Address'}, 'invoice_email_opt_in': {'key': 'invoiceEmailOptIn', 'type': 'bool'}, - 'enable_azure_sk_us': {'key': 'enableAzureSKUs', 'type': '[EnabledAzureSKUs]'}, + 'enabled_azure_plans': {'key': 'enabledAzurePlans', 'type': '[AzurePlan]'}, } def __init__(self, **kwargs): - super(BillingProfileCreationParameters, self).__init__(**kwargs) + super(BillingProfileCreationRequest, self).__init__(**kwargs) self.display_name = kwargs.get('display_name', None) self.po_number = kwargs.get('po_number', None) self.address = kwargs.get('address', None) self.invoice_email_opt_in = kwargs.get('invoice_email_opt_in', None) - self.enable_azure_sk_us = kwargs.get('enable_azure_sk_us', None) + self.enabled_azure_plans = kwargs.get('enabled_azure_plans', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_parameters_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request_py3.py similarity index 70% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_parameters_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request_py3.py index c57cdd0ebf94..4ca235650906 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_parameters_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request_py3.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class BillingProfileCreationParameters(Model): - """The parameters for creating a new billing profile. +class BillingProfileCreationRequest(Model): + """The request parameters for creating a new billing profile. :param display_name: The billing profile name. :type display_name: str @@ -24,9 +24,8 @@ class BillingProfileCreationParameters(Model): :param invoice_email_opt_in: If the billing profile is opted in to receive invoices via email. :type invoice_email_opt_in: bool - :param enable_azure_sk_us: Azure skus to enable for this billing profile.. - :type enable_azure_sk_us: - list[~azure.mgmt.billing.models.EnabledAzureSKUs] + :param enabled_azure_plans: Enabled azure plans for this billing profile. + :type enabled_azure_plans: list[~azure.mgmt.billing.models.AzurePlan] """ _attribute_map = { @@ -34,13 +33,13 @@ class BillingProfileCreationParameters(Model): 'po_number': {'key': 'poNumber', 'type': 'str'}, 'address': {'key': 'address', 'type': 'Address'}, 'invoice_email_opt_in': {'key': 'invoiceEmailOptIn', 'type': 'bool'}, - 'enable_azure_sk_us': {'key': 'enableAzureSKUs', 'type': '[EnabledAzureSKUs]'}, + 'enabled_azure_plans': {'key': 'enabledAzurePlans', 'type': '[AzurePlan]'}, } - def __init__(self, *, display_name: str=None, po_number: str=None, address=None, invoice_email_opt_in: bool=None, enable_azure_sk_us=None, **kwargs) -> None: - super(BillingProfileCreationParameters, self).__init__(**kwargs) + def __init__(self, *, display_name: str=None, po_number: str=None, address=None, invoice_email_opt_in: bool=None, enabled_azure_plans=None, **kwargs) -> None: + super(BillingProfileCreationRequest, self).__init__(**kwargs) self.display_name = display_name self.po_number = po_number self.address = address self.invoice_email_opt_in = invoice_email_opt_in - self.enable_azure_sk_us = enable_azure_sk_us + self.enabled_azure_plans = enabled_azure_plans diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py index 4e1feba37af7..d5263e090b5a 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py @@ -33,15 +33,12 @@ class BillingProfile(Resource): :ivar invoice_email_opt_in: If the billing profile is opted in to receive invoices via email. :vartype invoice_email_opt_in: bool - :ivar is_classic: Is OMS bootstrapped billing profile. - :vartype is_classic: bool :ivar invoice_day: Invoice day. :vartype invoice_day: int :ivar currency: The currency associated with the billing profile. :vartype currency: str - :param enabled_azure_sk_us: Information about the product. - :type enabled_azure_sk_us: - list[~azure.mgmt.billing.models.EnabledAzureSKUs] + :param enabled_azure_plans: Information about the enabled azure plans. + :type enabled_azure_plans: list[~azure.mgmt.billing.models.AzurePlan] :param invoice_sections: The invoice sections associated to the billing profile. :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] @@ -52,7 +49,6 @@ class BillingProfile(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'invoice_email_opt_in': {'readonly': True}, - 'is_classic': {'readonly': True}, 'invoice_day': {'readonly': True}, 'currency': {'readonly': True}, } @@ -65,21 +61,19 @@ class BillingProfile(Resource): 'po_number': {'key': 'properties.poNumber', 'type': 'str'}, 'address': {'key': 'properties.address', 'type': 'Address'}, 'invoice_email_opt_in': {'key': 'properties.invoiceEmailOptIn', 'type': 'bool'}, - 'is_classic': {'key': 'properties.isClassic', 'type': 'bool'}, 'invoice_day': {'key': 'properties.invoiceDay', 'type': 'int'}, 'currency': {'key': 'properties.currency', 'type': 'str'}, - 'enabled_azure_sk_us': {'key': 'properties.enabledAzureSKUs', 'type': '[EnabledAzureSKUs]'}, + 'enabled_azure_plans': {'key': 'properties.enabledAzurePlans', 'type': '[AzurePlan]'}, 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, } - def __init__(self, *, display_name: str=None, po_number: str=None, address=None, enabled_azure_sk_us=None, invoice_sections=None, **kwargs) -> None: + def __init__(self, *, display_name: str=None, po_number: str=None, address=None, enabled_azure_plans=None, invoice_sections=None, **kwargs) -> None: super(BillingProfile, self).__init__(**kwargs) self.display_name = display_name self.po_number = po_number self.address = address self.invoice_email_opt_in = None - self.is_classic = None self.invoice_day = None self.currency = None - self.enabled_azure_sk_us = enabled_azure_sk_us + self.enabled_azure_plans = enabled_azure_plans self.invoice_sections = invoice_sections diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py index bb89970c45a4..4d26452f52e9 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py @@ -28,18 +28,18 @@ class BillingProperty(Resource): :vartype billing_tenant_id: str :ivar billing_account_id: Billing account Id. :vartype billing_account_id: str - :ivar billing_account_name: Billing account name. - :vartype billing_account_name: str + :ivar billing_account_display_name: Billing account display name. + :vartype billing_account_display_name: str :ivar billing_profile_id: Billing profile Id. :vartype billing_profile_id: str - :ivar billing_profile_name: Billing profile name. - :vartype billing_profile_name: str + :ivar billing_profile_display_name: Billing profile display name. + :vartype billing_profile_display_name: str :ivar cost_center: Cost center name. :vartype cost_center: str :ivar invoice_section_id: Invoice Section Id. :vartype invoice_section_id: str - :ivar invoice_section_name: Invoice Section name. - :vartype invoice_section_name: str + :ivar invoice_section_display_name: Invoice Section display name. + :vartype invoice_section_display_name: str :ivar product_id: Product Id. :vartype product_id: str :ivar product_name: Product name. @@ -56,12 +56,12 @@ class BillingProperty(Resource): 'type': {'readonly': True}, 'billing_tenant_id': {'readonly': True}, 'billing_account_id': {'readonly': True}, - 'billing_account_name': {'readonly': True}, + 'billing_account_display_name': {'readonly': True}, 'billing_profile_id': {'readonly': True}, - 'billing_profile_name': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, 'cost_center': {'readonly': True}, 'invoice_section_id': {'readonly': True}, - 'invoice_section_name': {'readonly': True}, + 'invoice_section_display_name': {'readonly': True}, 'product_id': {'readonly': True}, 'product_name': {'readonly': True}, 'sku_id': {'readonly': True}, @@ -74,12 +74,12 @@ class BillingProperty(Resource): 'type': {'key': 'type', 'type': 'str'}, 'billing_tenant_id': {'key': 'properties.billingTenantId', 'type': 'str'}, 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, - 'billing_account_name': {'key': 'properties.billingAccountName', 'type': 'str'}, + 'billing_account_display_name': {'key': 'properties.billingAccountDisplayName', 'type': 'str'}, 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, - 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, - 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'invoice_section_display_name': {'key': 'properties.invoiceSectionDisplayName', 'type': 'str'}, 'product_id': {'key': 'properties.productId', 'type': 'str'}, 'product_name': {'key': 'properties.productName', 'type': 'str'}, 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, @@ -90,12 +90,12 @@ def __init__(self, **kwargs): super(BillingProperty, self).__init__(**kwargs) self.billing_tenant_id = None self.billing_account_id = None - self.billing_account_name = None + self.billing_account_display_name = None self.billing_profile_id = None - self.billing_profile_name = None + self.billing_profile_display_name = None self.cost_center = None self.invoice_section_id = None - self.invoice_section_name = None + self.invoice_section_display_name = None self.product_id = None self.product_name = None self.sku_id = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py index ab5bcfe3a8ca..a57550f087de 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py @@ -28,18 +28,18 @@ class BillingProperty(Resource): :vartype billing_tenant_id: str :ivar billing_account_id: Billing account Id. :vartype billing_account_id: str - :ivar billing_account_name: Billing account name. - :vartype billing_account_name: str + :ivar billing_account_display_name: Billing account display name. + :vartype billing_account_display_name: str :ivar billing_profile_id: Billing profile Id. :vartype billing_profile_id: str - :ivar billing_profile_name: Billing profile name. - :vartype billing_profile_name: str + :ivar billing_profile_display_name: Billing profile display name. + :vartype billing_profile_display_name: str :ivar cost_center: Cost center name. :vartype cost_center: str :ivar invoice_section_id: Invoice Section Id. :vartype invoice_section_id: str - :ivar invoice_section_name: Invoice Section name. - :vartype invoice_section_name: str + :ivar invoice_section_display_name: Invoice Section display name. + :vartype invoice_section_display_name: str :ivar product_id: Product Id. :vartype product_id: str :ivar product_name: Product name. @@ -56,12 +56,12 @@ class BillingProperty(Resource): 'type': {'readonly': True}, 'billing_tenant_id': {'readonly': True}, 'billing_account_id': {'readonly': True}, - 'billing_account_name': {'readonly': True}, + 'billing_account_display_name': {'readonly': True}, 'billing_profile_id': {'readonly': True}, - 'billing_profile_name': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, 'cost_center': {'readonly': True}, 'invoice_section_id': {'readonly': True}, - 'invoice_section_name': {'readonly': True}, + 'invoice_section_display_name': {'readonly': True}, 'product_id': {'readonly': True}, 'product_name': {'readonly': True}, 'sku_id': {'readonly': True}, @@ -74,12 +74,12 @@ class BillingProperty(Resource): 'type': {'key': 'type', 'type': 'str'}, 'billing_tenant_id': {'key': 'properties.billingTenantId', 'type': 'str'}, 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, - 'billing_account_name': {'key': 'properties.billingAccountName', 'type': 'str'}, + 'billing_account_display_name': {'key': 'properties.billingAccountDisplayName', 'type': 'str'}, 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, - 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, - 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'invoice_section_display_name': {'key': 'properties.invoiceSectionDisplayName', 'type': 'str'}, 'product_id': {'key': 'properties.productId', 'type': 'str'}, 'product_name': {'key': 'properties.productName', 'type': 'str'}, 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, @@ -90,12 +90,12 @@ def __init__(self, **kwargs) -> None: super(BillingProperty, self).__init__(**kwargs) self.billing_tenant_id = None self.billing_account_id = None - self.billing_account_name = None + self.billing_account_display_name = None self.billing_profile_id = None - self.billing_profile_name = None + self.billing_profile_display_name = None self.cost_center = None self.invoice_section_id = None - self.invoice_section_name = None + self.invoice_section_display_name = None self.product_id = None self.product_name = None self.sku_id = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription.py similarity index 80% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription.py index 2bc957b75bd3..7054405293d8 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription.py @@ -12,8 +12,8 @@ from .resource import Resource -class BillingSubscriptionSummary(Resource): - """A billing Subscription summary resource. +class BillingSubscription(Resource): + """A billing Subscription resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -39,15 +39,15 @@ class BillingSubscriptionSummary(Resource): :ivar billing_profile_id: Billing Profile id to which this product belongs. :vartype billing_profile_id: str - :ivar billing_profile_name: Billing Profile name to which this product - belongs. - :vartype billing_profile_name: str + :ivar billing_profile_display_name: Billing Profile display name to which + this product belongs. + :vartype billing_profile_display_name: str :ivar invoice_section_id: Invoice section id to which this product belongs. :vartype invoice_section_id: str - :ivar invoice_section_name: Invoice section name to which this product - belongs. - :vartype invoice_section_name: str + :ivar invoice_section_display_name: Invoice section display name to which + this product belongs. + :vartype invoice_section_display_name: str :param sku_id: The sku id. :type sku_id: str :ivar sku_description: The sku description. @@ -63,9 +63,9 @@ class BillingSubscriptionSummary(Resource): 'last_month_charges': {'readonly': True}, 'month_to_date_charges': {'readonly': True}, 'billing_profile_id': {'readonly': True}, - 'billing_profile_name': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, 'invoice_section_id': {'readonly': True}, - 'invoice_section_name': {'readonly': True}, + 'invoice_section_display_name': {'readonly': True}, 'sku_description': {'readonly': True}, } @@ -79,23 +79,23 @@ class BillingSubscriptionSummary(Resource): 'last_month_charges': {'key': 'properties.lastMonthCharges', 'type': 'Amount'}, 'month_to_date_charges': {'key': 'properties.monthToDateCharges', 'type': 'Amount'}, 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, - 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, - 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'invoice_section_display_name': {'key': 'properties.invoiceSectionDisplayName', 'type': 'str'}, 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, } def __init__(self, **kwargs): - super(BillingSubscriptionSummary, self).__init__(**kwargs) + super(BillingSubscription, self).__init__(**kwargs) self.display_name = None self.subscription_id = None self.subscription_billing_status = kwargs.get('subscription_billing_status', None) self.last_month_charges = None self.month_to_date_charges = None self.billing_profile_id = None - self.billing_profile_name = None + self.billing_profile_display_name = None self.invoice_section_id = None - self.invoice_section_name = None + self.invoice_section_display_name = None self.sku_id = kwargs.get('sku_id', None) self.sku_description = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_paged.py similarity index 77% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_paged.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_paged.py index 9c32206b6654..a92e57cfd52c 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_paged.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class BillingSubscriptionSummaryPaged(Paged): +class BillingSubscriptionPaged(Paged): """ - A paging container for iterating over a list of :class:`BillingSubscriptionSummary ` object + A paging container for iterating over a list of :class:`BillingSubscription ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[BillingSubscriptionSummary]'} + 'current_page': {'key': 'value', 'type': '[BillingSubscription]'} } def __init__(self, *args, **kwargs): - super(BillingSubscriptionSummaryPaged, self).__init__(*args, **kwargs) + super(BillingSubscriptionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_py3.py similarity index 80% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_py3.py index be61f23b614f..114e7e970685 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_py3.py @@ -12,8 +12,8 @@ from .resource_py3 import Resource -class BillingSubscriptionSummary(Resource): - """A billing Subscription summary resource. +class BillingSubscription(Resource): + """A billing Subscription resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -39,15 +39,15 @@ class BillingSubscriptionSummary(Resource): :ivar billing_profile_id: Billing Profile id to which this product belongs. :vartype billing_profile_id: str - :ivar billing_profile_name: Billing Profile name to which this product - belongs. - :vartype billing_profile_name: str + :ivar billing_profile_display_name: Billing Profile display name to which + this product belongs. + :vartype billing_profile_display_name: str :ivar invoice_section_id: Invoice section id to which this product belongs. :vartype invoice_section_id: str - :ivar invoice_section_name: Invoice section name to which this product - belongs. - :vartype invoice_section_name: str + :ivar invoice_section_display_name: Invoice section display name to which + this product belongs. + :vartype invoice_section_display_name: str :param sku_id: The sku id. :type sku_id: str :ivar sku_description: The sku description. @@ -63,9 +63,9 @@ class BillingSubscriptionSummary(Resource): 'last_month_charges': {'readonly': True}, 'month_to_date_charges': {'readonly': True}, 'billing_profile_id': {'readonly': True}, - 'billing_profile_name': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, 'invoice_section_id': {'readonly': True}, - 'invoice_section_name': {'readonly': True}, + 'invoice_section_display_name': {'readonly': True}, 'sku_description': {'readonly': True}, } @@ -79,23 +79,23 @@ class BillingSubscriptionSummary(Resource): 'last_month_charges': {'key': 'properties.lastMonthCharges', 'type': 'Amount'}, 'month_to_date_charges': {'key': 'properties.monthToDateCharges', 'type': 'Amount'}, 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, - 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, - 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'invoice_section_display_name': {'key': 'properties.invoiceSectionDisplayName', 'type': 'str'}, 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, } def __init__(self, *, subscription_billing_status=None, sku_id: str=None, **kwargs) -> None: - super(BillingSubscriptionSummary, self).__init__(**kwargs) + super(BillingSubscription, self).__init__(**kwargs) self.display_name = None self.subscription_id = None self.subscription_billing_status = subscription_billing_status self.last_month_charges = None self.month_to_date_charges = None self.billing_profile_id = None - self.billing_profile_name = None + self.billing_profile_display_name = None self.invoice_section_id = None - self.invoice_section_name = None + self.invoice_section_display_name = None self.sku_id = sku_id self.sku_description = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py index e6f539a0c3de..c0cd95f08a17 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py @@ -13,14 +13,13 @@ class BillingSubscriptionsListResult(Model): - """Result of listing billing subscriptions summary. + """Result of listing billing subscriptions. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of billing subscriptions summary. - :vartype value: - list[~azure.mgmt.billing.models.BillingSubscriptionSummary] + :ivar value: The list of billing subscriptions. + :vartype value: list[~azure.mgmt.billing.models.BillingSubscription] :ivar next_link: The link (url) to the next page of results. :vartype next_link: str """ @@ -31,7 +30,7 @@ class BillingSubscriptionsListResult(Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[BillingSubscriptionSummary]'}, + 'value': {'key': 'value', 'type': '[BillingSubscription]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py index b5b5de332d98..cd24113e7cb7 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py @@ -13,14 +13,13 @@ class BillingSubscriptionsListResult(Model): - """Result of listing billing subscriptions summary. + """Result of listing billing subscriptions. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of billing subscriptions summary. - :vartype value: - list[~azure.mgmt.billing.models.BillingSubscriptionSummary] + :ivar value: The list of billing subscriptions. + :vartype value: list[~azure.mgmt.billing.models.BillingSubscription] :ivar next_link: The link (url) to the next page of results. :vartype next_link: str """ @@ -31,7 +30,7 @@ class BillingSubscriptionsListResult(Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[BillingSubscriptionSummary]'}, + 'value': {'key': 'value', 'type': '[BillingSubscription]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_properties.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document.py similarity index 92% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_properties.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document.py index f6b17398e035..408c8032519e 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_properties.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class DownloadProperties(Model): +class Document(Model): """The properties of the invoice download. Variables are only populated by the server, and will be ignored when @@ -36,6 +36,6 @@ class DownloadProperties(Model): } def __init__(self, **kwargs): - super(DownloadProperties, self).__init__(**kwargs) + super(Document, self).__init__(**kwargs) self.kind = None self.url = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_properties_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document_py3.py similarity index 92% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_properties_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document_py3.py index b10a00755b25..af1f1422e524 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_properties_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document_py3.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class DownloadProperties(Model): +class Document(Model): """The properties of the invoice download. Variables are only populated by the server, and will be ignored when @@ -36,6 +36,6 @@ class DownloadProperties(Model): } def __init__(self, **kwargs) -> None: - super(DownloadProperties, self).__init__(**kwargs) + super(Document, self).__init__(**kwargs) self.kind = None self.url = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py index 726b8b201c15..251289645390 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py @@ -15,18 +15,14 @@ class InitiateTransferRequest(Model): """Request parameters to initiate transfer. - :param billing_profile_id: Target Usage context for devTest subscriptions. - :type billing_profile_id: str :param recipient_email_id: Email Id of recipient for transfer. :type recipient_email_id: str """ _attribute_map = { - 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, } def __init__(self, **kwargs): super(InitiateTransferRequest, self).__init__(**kwargs) - self.billing_profile_id = kwargs.get('billing_profile_id', None) self.recipient_email_id = kwargs.get('recipient_email_id', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py index 564bdd8fbbb0..9547d5971a5c 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py @@ -15,18 +15,14 @@ class InitiateTransferRequest(Model): """Request parameters to initiate transfer. - :param billing_profile_id: Target Usage context for devTest subscriptions. - :type billing_profile_id: str :param recipient_email_id: Email Id of recipient for transfer. :type recipient_email_id: str """ _attribute_map = { - 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, } - def __init__(self, *, billing_profile_id: str=None, recipient_email_id: str=None, **kwargs) -> None: + def __init__(self, *, recipient_email_id: str=None, **kwargs) -> None: super(InitiateTransferRequest, self).__init__(**kwargs) - self.billing_profile_id = billing_profile_id self.recipient_email_id = recipient_email_id diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py similarity index 83% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py index ad984d6e6f83..919a2d0a2d67 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py @@ -12,7 +12,7 @@ from .resource import Resource -class InvoiceSummary(Resource): +class Invoice(Resource): """An invoice resource. Variables are only populated by the server, and will be ignored when @@ -41,14 +41,14 @@ class InvoiceSummary(Resource): :vartype invoice_period_end_date: datetime :ivar billing_profile_id: The billing profile id this invoice belongs to. :vartype billing_profile_id: str - :ivar billing_profile_name: The profile name this invoice belongs to. - :vartype billing_profile_name: str + :ivar billing_profile_display_name: The billing profile display name this + invoice belongs to. + :vartype billing_profile_display_name: str :ivar purchase_order_number: The purchase identifier for the invoice. :vartype purchase_order_number: str - :ivar document_urls: List of document urls available to download including - invoice and tax documents. - :vartype document_urls: - list[~azure.mgmt.billing.models.DownloadProperties] + :ivar documents: List of documents available to download including invoice + and tax documents. + :vartype documents: list[~azure.mgmt.billing.models.Document] :ivar payments: List of payments. :vartype payments: list[~azure.mgmt.billing.models.PaymentProperties] """ @@ -65,9 +65,9 @@ class InvoiceSummary(Resource): 'invoice_period_start_date': {'readonly': True}, 'invoice_period_end_date': {'readonly': True}, 'billing_profile_id': {'readonly': True}, - 'billing_profile_name': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, 'purchase_order_number': {'readonly': True}, - 'document_urls': {'readonly': True}, + 'documents': {'readonly': True}, 'payments': {'readonly': True}, } @@ -83,14 +83,14 @@ class InvoiceSummary(Resource): 'invoice_period_start_date': {'key': 'properties.invoicePeriodStartDate', 'type': 'iso-8601'}, 'invoice_period_end_date': {'key': 'properties.invoicePeriodEndDate', 'type': 'iso-8601'}, 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, - 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, 'purchase_order_number': {'key': 'properties.purchaseOrderNumber', 'type': 'str'}, - 'document_urls': {'key': 'properties.documentUrls', 'type': '[DownloadProperties]'}, + 'documents': {'key': 'properties.documents', 'type': '[Document]'}, 'payments': {'key': 'properties.payments', 'type': '[PaymentProperties]'}, } def __init__(self, **kwargs): - super(InvoiceSummary, self).__init__(**kwargs) + super(Invoice, self).__init__(**kwargs) self.due_date = None self.invoice_date = None self.status = None @@ -99,7 +99,7 @@ def __init__(self, **kwargs): self.invoice_period_start_date = None self.invoice_period_end_date = None self.billing_profile_id = None - self.billing_profile_name = None + self.billing_profile_display_name = None self.purchase_order_number = None - self.document_urls = None + self.documents = None self.payments = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result.py index 0e0156b4eaa6..3be6cc257137 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result.py @@ -19,7 +19,7 @@ class InvoiceListResult(Model): sending a request. :ivar value: The list of invoices. - :vartype value: list[~azure.mgmt.billing.models.InvoiceSummary] + :vartype value: list[~azure.mgmt.billing.models.Invoice] :ivar next_link: The link (url) to the next page of results. :vartype next_link: str """ @@ -30,7 +30,7 @@ class InvoiceListResult(Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[InvoiceSummary]'}, + 'value': {'key': 'value', 'type': '[Invoice]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result_py3.py index cc7db9c465d8..76446f395e68 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result_py3.py @@ -19,7 +19,7 @@ class InvoiceListResult(Model): sending a request. :ivar value: The list of invoices. - :vartype value: list[~azure.mgmt.billing.models.InvoiceSummary] + :vartype value: list[~azure.mgmt.billing.models.Invoice] :ivar next_link: The link (url) to the next page of results. :vartype next_link: str """ @@ -30,7 +30,7 @@ class InvoiceListResult(Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[InvoiceSummary]'}, + 'value': {'key': 'value', 'type': '[Invoice]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py similarity index 83% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py index 2c49b9a389fa..d2b92d5f4162 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py @@ -12,7 +12,7 @@ from .resource_py3 import Resource -class InvoiceSummary(Resource): +class Invoice(Resource): """An invoice resource. Variables are only populated by the server, and will be ignored when @@ -41,14 +41,14 @@ class InvoiceSummary(Resource): :vartype invoice_period_end_date: datetime :ivar billing_profile_id: The billing profile id this invoice belongs to. :vartype billing_profile_id: str - :ivar billing_profile_name: The profile name this invoice belongs to. - :vartype billing_profile_name: str + :ivar billing_profile_display_name: The billing profile display name this + invoice belongs to. + :vartype billing_profile_display_name: str :ivar purchase_order_number: The purchase identifier for the invoice. :vartype purchase_order_number: str - :ivar document_urls: List of document urls available to download including - invoice and tax documents. - :vartype document_urls: - list[~azure.mgmt.billing.models.DownloadProperties] + :ivar documents: List of documents available to download including invoice + and tax documents. + :vartype documents: list[~azure.mgmt.billing.models.Document] :ivar payments: List of payments. :vartype payments: list[~azure.mgmt.billing.models.PaymentProperties] """ @@ -65,9 +65,9 @@ class InvoiceSummary(Resource): 'invoice_period_start_date': {'readonly': True}, 'invoice_period_end_date': {'readonly': True}, 'billing_profile_id': {'readonly': True}, - 'billing_profile_name': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, 'purchase_order_number': {'readonly': True}, - 'document_urls': {'readonly': True}, + 'documents': {'readonly': True}, 'payments': {'readonly': True}, } @@ -83,14 +83,14 @@ class InvoiceSummary(Resource): 'invoice_period_start_date': {'key': 'properties.invoicePeriodStartDate', 'type': 'iso-8601'}, 'invoice_period_end_date': {'key': 'properties.invoicePeriodEndDate', 'type': 'iso-8601'}, 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, - 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, 'purchase_order_number': {'key': 'properties.purchaseOrderNumber', 'type': 'str'}, - 'document_urls': {'key': 'properties.documentUrls', 'type': '[DownloadProperties]'}, + 'documents': {'key': 'properties.documents', 'type': '[Document]'}, 'payments': {'key': 'properties.payments', 'type': '[PaymentProperties]'}, } def __init__(self, **kwargs) -> None: - super(InvoiceSummary, self).__init__(**kwargs) + super(Invoice, self).__init__(**kwargs) self.due_date = None self.invoice_date = None self.status = None @@ -99,7 +99,7 @@ def __init__(self, **kwargs) -> None: self.invoice_period_start_date = None self.invoice_period_end_date = None self.billing_profile_id = None - self.billing_profile_name = None + self.billing_profile_display_name = None self.purchase_order_number = None - self.document_urls = None + self.documents = None self.payments = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py index 00342ac237f9..ea78f2d1985e 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py @@ -26,9 +26,6 @@ class InvoiceSection(Resource): :vartype type: str :param display_name: The name of the InvoiceSection. :type display_name: str - :param billing_profiles: The billing profiles associated to the billing - account. - :type billing_profiles: list[~azure.mgmt.billing.models.BillingProfile] """ _validation = { @@ -42,10 +39,8 @@ class InvoiceSection(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, } def __init__(self, **kwargs): super(InvoiceSection, self).__init__(**kwargs) self.display_name = kwargs.get('display_name', None) - self.billing_profiles = kwargs.get('billing_profiles', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py index 16420f33e703..13c336c2ef4b 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py @@ -26,9 +26,6 @@ class InvoiceSection(Resource): :vartype type: str :param display_name: The name of the InvoiceSection. :type display_name: str - :param billing_profiles: The billing profiles associated to the billing - account. - :type billing_profiles: list[~azure.mgmt.billing.models.BillingProfile] """ _validation = { @@ -42,10 +39,8 @@ class InvoiceSection(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, } - def __init__(self, *, display_name: str=None, billing_profiles=None, **kwargs) -> None: + def __init__(self, *, display_name: str=None, **kwargs) -> None: super(InvoiceSection, self).__init__(**kwargs) self.display_name = display_name - self.billing_profiles = billing_profiles diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_status.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_status.py deleted file mode 100644 index b4bd9e976219..000000000000 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_status.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 OperationStatus(Model): - """status of the Billing POST/PUT operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The operation Id. - :vartype id: str - :param status: Status of the pending operation - :type status: str - :param status_detail: Status Detail of the pending operation - :type status_detail: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'status_detail': {'key': 'statusDetail', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationStatus, self).__init__(**kwargs) - self.id = None - self.status = kwargs.get('status', None) - self.status_detail = kwargs.get('status_detail', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py deleted file mode 100644 index 325cee1d2b7e..000000000000 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 OperationStatus(Model): - """status of the Billing POST/PUT operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The operation Id. - :vartype id: str - :param status: Status of the pending operation - :type status: str - :param status_detail: Status Detail of the pending operation - :type status_detail: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'status_detail': {'key': 'statusDetail', 'type': 'str'}, - } - - def __init__(self, *, status: str=None, status_detail: str=None, **kwargs) -> None: - super(OperationStatus, self).__init__(**kwargs) - self.id = None - self.status = status - self.status_detail = status_detail diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy.py index a153f1d3aa8c..5f2e1eb3e6c9 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy.py @@ -24,15 +24,21 @@ class Policy(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param marketplace_purchases_allowed: The marketplacePurchasesAllowed - flag. - :type marketplace_purchases_allowed: bool - :param reservation_purchases_allowed: The reservationPurchasesAllowed - flag. - :type reservation_purchases_allowed: bool - :param subscription_owner_can_view_charges: The - subscriptionOwnerCanViewCharges flag. - :type subscription_owner_can_view_charges: bool + :param marketplace_purchases: The marketplace purchases allowed or not. + Possible values include: 'Allowed', 'NotAllowed' + :type marketplace_purchases: str or + ~azure.mgmt.billing.models.MarketplacePurchasesPolicy + :param reservation_purchases: The reservation purchases allowed or not. + Possible values include: 'Allowed', 'NotAllowed' + :type reservation_purchases: str or + ~azure.mgmt.billing.models.ReservationPurchasesPolicy + :param view_charges: Who can view charges. Possible values include: + 'None', 'SubscriptionOwner' + :type view_charges: str or ~azure.mgmt.billing.models.ViewChargesPolicy + :param free_marketplace_purchases: The free marketplace purchases allowed + or not. Possible values include: 'Allowed', 'NotAllowed' + :type free_marketplace_purchases: str or + ~azure.mgmt.billing.models.FreeMarketplacePurchasesPolicy """ _validation = { @@ -45,13 +51,15 @@ class Policy(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'marketplace_purchases_allowed': {'key': 'properties.marketplacePurchasesAllowed', 'type': 'bool'}, - 'reservation_purchases_allowed': {'key': 'properties.reservationPurchasesAllowed', 'type': 'bool'}, - 'subscription_owner_can_view_charges': {'key': 'properties.subscriptionOwnerCanViewCharges', 'type': 'bool'}, + 'marketplace_purchases': {'key': 'properties.marketplacePurchases', 'type': 'str'}, + 'reservation_purchases': {'key': 'properties.reservationPurchases', 'type': 'str'}, + 'view_charges': {'key': 'properties.viewCharges', 'type': 'str'}, + 'free_marketplace_purchases': {'key': 'properties.freeMarketplacePurchases', 'type': 'str'}, } def __init__(self, **kwargs): super(Policy, self).__init__(**kwargs) - self.marketplace_purchases_allowed = kwargs.get('marketplace_purchases_allowed', None) - self.reservation_purchases_allowed = kwargs.get('reservation_purchases_allowed', None) - self.subscription_owner_can_view_charges = kwargs.get('subscription_owner_can_view_charges', None) + self.marketplace_purchases = kwargs.get('marketplace_purchases', None) + self.reservation_purchases = kwargs.get('reservation_purchases', None) + self.view_charges = kwargs.get('view_charges', None) + self.free_marketplace_purchases = kwargs.get('free_marketplace_purchases', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py index 6fcb7d8b1561..3630405ef6a7 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py @@ -24,15 +24,21 @@ class Policy(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param marketplace_purchases_allowed: The marketplacePurchasesAllowed - flag. - :type marketplace_purchases_allowed: bool - :param reservation_purchases_allowed: The reservationPurchasesAllowed - flag. - :type reservation_purchases_allowed: bool - :param subscription_owner_can_view_charges: The - subscriptionOwnerCanViewCharges flag. - :type subscription_owner_can_view_charges: bool + :param marketplace_purchases: The marketplace purchases allowed or not. + Possible values include: 'Allowed', 'NotAllowed' + :type marketplace_purchases: str or + ~azure.mgmt.billing.models.MarketplacePurchasesPolicy + :param reservation_purchases: The reservation purchases allowed or not. + Possible values include: 'Allowed', 'NotAllowed' + :type reservation_purchases: str or + ~azure.mgmt.billing.models.ReservationPurchasesPolicy + :param view_charges: Who can view charges. Possible values include: + 'None', 'SubscriptionOwner' + :type view_charges: str or ~azure.mgmt.billing.models.ViewChargesPolicy + :param free_marketplace_purchases: The free marketplace purchases allowed + or not. Possible values include: 'Allowed', 'NotAllowed' + :type free_marketplace_purchases: str or + ~azure.mgmt.billing.models.FreeMarketplacePurchasesPolicy """ _validation = { @@ -45,13 +51,15 @@ class Policy(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'marketplace_purchases_allowed': {'key': 'properties.marketplacePurchasesAllowed', 'type': 'bool'}, - 'reservation_purchases_allowed': {'key': 'properties.reservationPurchasesAllowed', 'type': 'bool'}, - 'subscription_owner_can_view_charges': {'key': 'properties.subscriptionOwnerCanViewCharges', 'type': 'bool'}, + 'marketplace_purchases': {'key': 'properties.marketplacePurchases', 'type': 'str'}, + 'reservation_purchases': {'key': 'properties.reservationPurchases', 'type': 'str'}, + 'view_charges': {'key': 'properties.viewCharges', 'type': 'str'}, + 'free_marketplace_purchases': {'key': 'properties.freeMarketplacePurchases', 'type': 'str'}, } - def __init__(self, *, marketplace_purchases_allowed: bool=None, reservation_purchases_allowed: bool=None, subscription_owner_can_view_charges: bool=None, **kwargs) -> None: + def __init__(self, *, marketplace_purchases=None, reservation_purchases=None, view_charges=None, free_marketplace_purchases=None, **kwargs) -> None: super(Policy, self).__init__(**kwargs) - self.marketplace_purchases_allowed = marketplace_purchases_allowed - self.reservation_purchases_allowed = reservation_purchases_allowed - self.subscription_owner_can_view_charges = subscription_owner_can_view_charges + self.marketplace_purchases = marketplace_purchases + self.reservation_purchases = reservation_purchases + self.view_charges = view_charges + self.free_marketplace_purchases = free_marketplace_purchases diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product.py similarity index 86% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product.py index 8ff4b299b84c..480154f9d3a8 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product.py @@ -12,8 +12,8 @@ from .resource import Resource -class ProductSummary(Resource): - """A product summary resource. +class Product(Resource): + """A product resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -59,15 +59,15 @@ class ProductSummary(Resource): :ivar invoice_section_id: Invoice section id to which this product belongs. :vartype invoice_section_id: str - :ivar invoice_section_name: Invoice section name to which this product - belongs. - :vartype invoice_section_name: str + :ivar invoice_section_display_name: Invoice section display name to which + this product belongs. + :vartype invoice_section_display_name: str :ivar billing_profile_id: Billing Profile id to which this product belongs. :vartype billing_profile_id: str - :ivar billing_profile_name: Billing Profile name to which this product - belongs. - :vartype billing_profile_name: str + :ivar billing_profile_display_name: Billing Profile display name to which + this product belongs. + :vartype billing_profile_display_name: str """ _validation = { @@ -87,9 +87,9 @@ class ProductSummary(Resource): 'availability_id': {'readonly': True}, 'parent_product_id': {'readonly': True}, 'invoice_section_id': {'readonly': True}, - 'invoice_section_name': {'readonly': True}, + 'invoice_section_display_name': {'readonly': True}, 'billing_profile_id': {'readonly': True}, - 'billing_profile_name': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, } _attribute_map = { @@ -111,13 +111,13 @@ class ProductSummary(Resource): 'availability_id': {'key': 'properties.availabilityId', 'type': 'str'}, 'parent_product_id': {'key': 'properties.parentProductId', 'type': 'str'}, 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, - 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'invoice_section_display_name': {'key': 'properties.invoiceSectionDisplayName', 'type': 'str'}, 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, - 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, } def __init__(self, **kwargs): - super(ProductSummary, self).__init__(**kwargs) + super(Product, self).__init__(**kwargs) self.display_name = None self.purchase_date = None self.product_type_id = None @@ -133,6 +133,6 @@ def __init__(self, **kwargs): self.availability_id = None self.parent_product_id = None self.invoice_section_id = None - self.invoice_section_name = None + self.invoice_section_display_name = None self.billing_profile_id = None - self.billing_profile_name = None + self.billing_profile_display_name = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_paged.py similarity index 75% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_paged.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_paged.py index d34d96d175af..ba946bdaee1c 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_paged.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class ProductSummaryPaged(Paged): +class ProductPaged(Paged): """ - A paging container for iterating over a list of :class:`ProductSummary ` object + A paging container for iterating over a list of :class:`Product ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ProductSummary]'} + 'current_page': {'key': 'value', 'type': '[Product]'} } def __init__(self, *args, **kwargs): - super(ProductSummaryPaged, self).__init__(*args, **kwargs) + super(ProductPaged, self).__init__(*args, **kwargs) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_py3.py similarity index 86% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_py3.py index 182b96e9526f..dbbc497aa68a 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_py3.py @@ -12,8 +12,8 @@ from .resource_py3 import Resource -class ProductSummary(Resource): - """A product summary resource. +class Product(Resource): + """A product resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -59,15 +59,15 @@ class ProductSummary(Resource): :ivar invoice_section_id: Invoice section id to which this product belongs. :vartype invoice_section_id: str - :ivar invoice_section_name: Invoice section name to which this product - belongs. - :vartype invoice_section_name: str + :ivar invoice_section_display_name: Invoice section display name to which + this product belongs. + :vartype invoice_section_display_name: str :ivar billing_profile_id: Billing Profile id to which this product belongs. :vartype billing_profile_id: str - :ivar billing_profile_name: Billing Profile name to which this product - belongs. - :vartype billing_profile_name: str + :ivar billing_profile_display_name: Billing Profile display name to which + this product belongs. + :vartype billing_profile_display_name: str """ _validation = { @@ -87,9 +87,9 @@ class ProductSummary(Resource): 'availability_id': {'readonly': True}, 'parent_product_id': {'readonly': True}, 'invoice_section_id': {'readonly': True}, - 'invoice_section_name': {'readonly': True}, + 'invoice_section_display_name': {'readonly': True}, 'billing_profile_id': {'readonly': True}, - 'billing_profile_name': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, } _attribute_map = { @@ -111,13 +111,13 @@ class ProductSummary(Resource): 'availability_id': {'key': 'properties.availabilityId', 'type': 'str'}, 'parent_product_id': {'key': 'properties.parentProductId', 'type': 'str'}, 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, - 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'invoice_section_display_name': {'key': 'properties.invoiceSectionDisplayName', 'type': 'str'}, 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, - 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, } def __init__(self, *, status=None, billing_frequency=None, **kwargs) -> None: - super(ProductSummary, self).__init__(**kwargs) + super(Product, self).__init__(**kwargs) self.display_name = None self.purchase_date = None self.product_type_id = None @@ -133,6 +133,6 @@ def __init__(self, *, status=None, billing_frequency=None, **kwargs) -> None: self.availability_id = None self.parent_product_id = None self.invoice_section_id = None - self.invoice_section_name = None + self.invoice_section_display_name = None self.billing_profile_id = None - self.billing_profile_name = None + self.billing_profile_display_name = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result.py index 3bafba7449aa..2d6fe9c52f56 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result.py @@ -13,14 +13,14 @@ class ProductsListResult(Model): - """Result of listing products summary. It contains a list of available - products summaries in reverse chronological order by purchase date. + """Result of listing products. It contains a list of available products + summaries in reverse chronological order by purchase date. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of products summary. - :vartype value: list[~azure.mgmt.billing.models.ProductSummary] + :ivar value: The list of products. + :vartype value: list[~azure.mgmt.billing.models.Product] :ivar next_link: The link (url) to the next page of results. :vartype next_link: str """ @@ -31,7 +31,7 @@ class ProductsListResult(Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[ProductSummary]'}, + 'value': {'key': 'value', 'type': '[Product]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result_py3.py index d8afea8a7d89..9eb9cce28107 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result_py3.py @@ -13,14 +13,14 @@ class ProductsListResult(Model): - """Result of listing products summary. It contains a list of available - products summaries in reverse chronological order by purchase date. + """Result of listing products. It contains a list of available products + summaries in reverse chronological order by purchase date. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of products summary. - :vartype value: list[~azure.mgmt.billing.models.ProductSummary] + :ivar value: The list of products. + :vartype value: list[~azure.mgmt.billing.models.Product] :ivar next_link: The link (url) to the next page of results. :vartype next_link: str """ @@ -31,7 +31,7 @@ class ProductsListResult(Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[ProductSummary]'}, + 'value': {'key': 'value', 'type': '[Product]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction.py similarity index 85% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction.py index b614b9deb73d..e1a932bef24e 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction.py @@ -12,8 +12,8 @@ from .resource import Resource -class TransactionsSummary(Resource): - """A reservation transaction summary resource. +class Transaction(Resource): + """A reservation transaction resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -53,15 +53,15 @@ class TransactionsSummary(Resource): :ivar invoice_section_id: Invoice section id to which this product belongs. :vartype invoice_section_id: str - :ivar invoice_section_name: Invoice section name to which this product - belongs. - :vartype invoice_section_name: str + :ivar invoice_section_display_name: Invoice section display name to which + this product belongs. + :vartype invoice_section_display_name: str :ivar billing_profile_id: Billing Profile id to which this product belongs. :vartype billing_profile_id: str - :ivar billing_profile_name: Billing Profile name to which this product - belongs. - :vartype billing_profile_name: str + :ivar billing_profile_display_name: Billing Profile display name to which + this product belongs. + :vartype billing_profile_display_name: str :ivar subscription_id: The subscription id. :vartype subscription_id: str :ivar subscription_name: The subscription name. @@ -83,9 +83,9 @@ class TransactionsSummary(Resource): 'transaction_amount': {'readonly': True}, 'quantity': {'readonly': True}, 'invoice_section_id': {'readonly': True}, - 'invoice_section_name': {'readonly': True}, + 'invoice_section_display_name': {'readonly': True}, 'billing_profile_id': {'readonly': True}, - 'billing_profile_name': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, 'subscription_id': {'readonly': True}, 'subscription_name': {'readonly': True}, } @@ -107,15 +107,15 @@ class TransactionsSummary(Resource): 'transaction_amount': {'key': 'properties.transactionAmount', 'type': 'Amount'}, 'quantity': {'key': 'properties.quantity', 'type': 'int'}, 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, - 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'invoice_section_display_name': {'key': 'properties.invoiceSectionDisplayName', 'type': 'str'}, 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, - 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, } def __init__(self, **kwargs): - super(TransactionsSummary, self).__init__(**kwargs) + super(Transaction, self).__init__(**kwargs) self.kind = kwargs.get('kind', None) self.date_property = None self.invoice = None @@ -129,8 +129,8 @@ def __init__(self, **kwargs): self.transaction_amount = None self.quantity = None self.invoice_section_id = None - self.invoice_section_name = None + self.invoice_section_display_name = None self.billing_profile_id = None - self.billing_profile_name = None + self.billing_profile_display_name = None self.subscription_id = None self.subscription_name = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_list_result.py similarity index 73% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_list_result.py index 156d834158bf..62d79a0def5a 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_list_result.py @@ -12,14 +12,14 @@ from msrest.serialization import Model -class TransactionsListResult(Model): - """Result of listing reservation transactions summary. +class TransactionListResult(Model): + """Result of listing reservation transactions. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of reservation transactions summary. - :vartype value: list[~azure.mgmt.billing.models.TransactionsSummary] + :ivar value: The list of reservation transactions. + :vartype value: list[~azure.mgmt.billing.models.Transaction] :ivar next_link: The link (url) to the next page of results. :vartype next_link: str """ @@ -30,11 +30,11 @@ class TransactionsListResult(Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[TransactionsSummary]'}, + 'value': {'key': 'value', 'type': '[Transaction]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__(self, **kwargs): - super(TransactionsListResult, self).__init__(**kwargs) + super(TransactionListResult, self).__init__(**kwargs) self.value = None self.next_link = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_list_result_py3.py similarity index 73% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_list_result_py3.py index 621cb39dc478..efc812413471 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_list_result_py3.py @@ -12,14 +12,14 @@ from msrest.serialization import Model -class TransactionsListResult(Model): - """Result of listing reservation transactions summary. +class TransactionListResult(Model): + """Result of listing reservation transactions. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of reservation transactions summary. - :vartype value: list[~azure.mgmt.billing.models.TransactionsSummary] + :ivar value: The list of reservation transactions. + :vartype value: list[~azure.mgmt.billing.models.Transaction] :ivar next_link: The link (url) to the next page of results. :vartype next_link: str """ @@ -30,11 +30,11 @@ class TransactionsListResult(Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[TransactionsSummary]'}, + 'value': {'key': 'value', 'type': '[Transaction]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__(self, **kwargs) -> None: - super(TransactionsListResult, self).__init__(**kwargs) + super(TransactionListResult, self).__init__(**kwargs) self.value = None self.next_link = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_paged.py similarity index 73% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_paged.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_paged.py index f1626e6b12ab..47c6c3c8ac54 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_paged.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class TransactionsSummaryPaged(Paged): +class TransactionPaged(Paged): """ - A paging container for iterating over a list of :class:`TransactionsSummary ` object + A paging container for iterating over a list of :class:`Transaction ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[TransactionsSummary]'} + 'current_page': {'key': 'value', 'type': '[Transaction]'} } def __init__(self, *args, **kwargs): - super(TransactionsSummaryPaged, self).__init__(*args, **kwargs) + super(TransactionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_py3.py similarity index 86% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_py3.py index 8e438dbdf077..a3058621988e 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_py3.py @@ -12,8 +12,8 @@ from .resource_py3 import Resource -class TransactionsSummary(Resource): - """A reservation transaction summary resource. +class Transaction(Resource): + """A reservation transaction resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -53,15 +53,15 @@ class TransactionsSummary(Resource): :ivar invoice_section_id: Invoice section id to which this product belongs. :vartype invoice_section_id: str - :ivar invoice_section_name: Invoice section name to which this product - belongs. - :vartype invoice_section_name: str + :ivar invoice_section_display_name: Invoice section display name to which + this product belongs. + :vartype invoice_section_display_name: str :ivar billing_profile_id: Billing Profile id to which this product belongs. :vartype billing_profile_id: str - :ivar billing_profile_name: Billing Profile name to which this product - belongs. - :vartype billing_profile_name: str + :ivar billing_profile_display_name: Billing Profile display name to which + this product belongs. + :vartype billing_profile_display_name: str :ivar subscription_id: The subscription id. :vartype subscription_id: str :ivar subscription_name: The subscription name. @@ -83,9 +83,9 @@ class TransactionsSummary(Resource): 'transaction_amount': {'readonly': True}, 'quantity': {'readonly': True}, 'invoice_section_id': {'readonly': True}, - 'invoice_section_name': {'readonly': True}, + 'invoice_section_display_name': {'readonly': True}, 'billing_profile_id': {'readonly': True}, - 'billing_profile_name': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, 'subscription_id': {'readonly': True}, 'subscription_name': {'readonly': True}, } @@ -107,15 +107,15 @@ class TransactionsSummary(Resource): 'transaction_amount': {'key': 'properties.transactionAmount', 'type': 'Amount'}, 'quantity': {'key': 'properties.quantity', 'type': 'int'}, 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, - 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'invoice_section_display_name': {'key': 'properties.invoiceSectionDisplayName', 'type': 'str'}, 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, - 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, } def __init__(self, *, kind=None, transaction_type=None, **kwargs) -> None: - super(TransactionsSummary, self).__init__(**kwargs) + super(Transaction, self).__init__(**kwargs) self.kind = kind self.date_property = None self.invoice = None @@ -129,8 +129,8 @@ def __init__(self, *, kind=None, transaction_type=None, **kwargs) -> None: self.transaction_amount = None self.quantity = None self.invoice_section_id = None - self.invoice_section_name = None + self.invoice_section_display_name = None self.billing_profile_id = None - self.billing_profile_name = None + self.billing_profile_display_name = None self.subscription_id = None self.subscription_name = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py index 9355b9f49ce2..8d60c4cfa092 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py @@ -26,6 +26,8 @@ class TransferDetails(Model): :vartype invoice_section_id: str :ivar billing_account_id: Target billing account Id. :vartype billing_account_id: str + :ivar billing_profile_id: Target billing profile Id. + :vartype billing_profile_id: str :ivar transfer_status: Overall transfer status. Possible values include: 'Pending', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', 'Canceled', 'Declined' @@ -48,6 +50,7 @@ class TransferDetails(Model): 'expiration_time': {'readonly': True}, 'invoice_section_id': {'readonly': True}, 'billing_account_id': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, 'transfer_status': {'readonly': True}, 'recipient_email_id': {'readonly': True}, 'initiator_email_id': {'readonly': True}, @@ -61,6 +64,7 @@ class TransferDetails(Model): 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, 'transfer_status': {'key': 'properties.transferStatus', 'type': 'str'}, 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, 'initiator_email_id': {'key': 'properties.initiatorEmailId', 'type': 'str'}, @@ -75,6 +79,7 @@ def __init__(self, **kwargs): self.expiration_time = None self.invoice_section_id = None self.billing_account_id = None + self.billing_profile_id = None self.transfer_status = None self.recipient_email_id = None self.initiator_email_id = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py index 53670056ccf4..5231d9d916e8 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py @@ -26,6 +26,8 @@ class TransferDetails(Model): :vartype invoice_section_id: str :ivar billing_account_id: Target billing account Id. :vartype billing_account_id: str + :ivar billing_profile_id: Target billing profile Id. + :vartype billing_profile_id: str :ivar transfer_status: Overall transfer status. Possible values include: 'Pending', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', 'Canceled', 'Declined' @@ -48,6 +50,7 @@ class TransferDetails(Model): 'expiration_time': {'readonly': True}, 'invoice_section_id': {'readonly': True}, 'billing_account_id': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, 'transfer_status': {'readonly': True}, 'recipient_email_id': {'readonly': True}, 'initiator_email_id': {'readonly': True}, @@ -61,6 +64,7 @@ class TransferDetails(Model): 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, 'transfer_status': {'key': 'properties.transferStatus', 'type': 'str'}, 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, 'initiator_email_id': {'key': 'properties.initiatorEmailId', 'type': 'str'}, @@ -75,6 +79,7 @@ def __init__(self, **kwargs) -> None: self.expiration_time = None self.invoice_section_id = None self.billing_account_id = None + self.billing_profile_id = None self.transfer_status = None self.recipient_email_id = None self.initiator_email_id = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation.py similarity index 87% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation.py index 58c13360fb33..50984bf843c8 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class UpdateAutoRenewOperationSummary(Model): +class UpdateAutoRenewOperation(Model): """Summary of cancel product operation. :param end_date: The end date of this asset @@ -24,5 +24,5 @@ class UpdateAutoRenewOperationSummary(Model): } def __init__(self, **kwargs): - super(UpdateAutoRenewOperationSummary, self).__init__(**kwargs) + super(UpdateAutoRenewOperation, self).__init__(**kwargs) self.end_date = kwargs.get('end_date', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_py3.py similarity index 87% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_py3.py index df7e37b21cd6..8a3f6622fcb0 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_py3.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class UpdateAutoRenewOperationSummary(Model): +class UpdateAutoRenewOperation(Model): """Summary of cancel product operation. :param end_date: The end date of this asset @@ -24,5 +24,5 @@ class UpdateAutoRenewOperationSummary(Model): } def __init__(self, *, end_date=None, **kwargs) -> None: - super(UpdateAutoRenewOperationSummary, self).__init__(**kwargs) + super(UpdateAutoRenewOperation, self).__init__(**kwargs) self.end_date = end_date 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 1afb90bce96d..da39667d8041 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,7 +11,7 @@ from .billing_accounts_operations import BillingAccountsOperations from .payment_methods_operations import PaymentMethodsOperations -from .addresses_operations import AddressesOperations +from .address_operations import AddressOperations from .available_balances_operations import AvailableBalancesOperations from .billing_profiles_operations import BillingProfilesOperations from .invoice_sections_operations import InvoiceSectionsOperations @@ -36,7 +36,7 @@ __all__ = [ 'BillingAccountsOperations', 'PaymentMethodsOperations', - 'AddressesOperations', + 'AddressOperations', 'AvailableBalancesOperations', 'BillingProfilesOperations', 'InvoiceSectionsOperations', diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/addresses_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/address_operations.py similarity index 94% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/addresses_operations.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/address_operations.py index d2a69e73def5..26944451d4c5 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/addresses_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/address_operations.py @@ -15,14 +15,14 @@ from .. import models -class AddressesOperations(object): - """AddressesOperations operations. +class AddressOperations(object): + """AddressOperations 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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/agreements_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/agreements_operations.py index edab2766fb75..eaf36ff6e056 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/agreements_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/agreements_operations.py @@ -22,7 +22,7 @@ class AgreementsOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/available_balances_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/available_balances_operations.py index f425396e08b1..69b543cd0b1d 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/available_balances_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/available_balances_operations.py @@ -22,7 +22,7 @@ class AvailableBalancesOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py index b62f4ba1e944..f7fb5e9c1e21 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py @@ -24,7 +24,7 @@ class BillingAccountsOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config @@ -42,7 +42,7 @@ def list( self, expand=None, custom_headers=None, raw=False, **operation_config): """Lists all billing accounts for a user which he has access to. - :param expand: May be used to expand the invoiceSections and + :param expand: May be used to expand the address, invoiceSections and billingProfiles. :type expand: str :param dict custom_headers: headers that will be added to the request @@ -100,7 +100,7 @@ def get( :param billing_account_name: billing Account Id. :type billing_account_name: str - :param expand: May be used to expand the invoiceSections and + :param expand: May be used to expand the address, invoiceSections and billingProfiles. :type expand: str :param dict custom_headers: headers that will be added to the request @@ -182,7 +182,7 @@ def _update_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'BillingAccountUpdateProperties') + body_content = self._serialize.body(parameters, 'BillingAccountUpdateRequest') # Construct and send request request = self._client.patch(url, query_parameters, header_parameters, body_content) @@ -208,10 +208,10 @@ def update( :param billing_account_name: billing Account Id. :type billing_account_name: str - :param parameters: Parameters supplied to the update billing account - operation. + :param parameters: Request parameters supplied to the update billing + account operation. :type parameters: - ~azure.mgmt.billing.models.BillingAccountUpdateProperties + ~azure.mgmt.billing.models.BillingAccountUpdateRequest :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 diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py index f31a5475cb64..d65086c157d6 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py @@ -22,7 +22,7 @@ class BillingPermissionsOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config @@ -91,14 +91,16 @@ def list_by_billing_account( return client_raw_response return deserialized - list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingPermissions'} + list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingPermissions'} def list_by_invoice_sections( - self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): """Lists all billing permissions for the caller under invoice section. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param dict custom_headers: headers that will be added to the request @@ -116,6 +118,7 @@ def list_by_invoice_sections( url = self.list_by_invoice_sections.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -151,7 +154,7 @@ def list_by_invoice_sections( return client_raw_response return deserialized - list_by_invoice_sections.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingPermissions'} + list_by_invoice_sections.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingPermissions'} def list_by_billing_profile( self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): @@ -211,4 +214,4 @@ def list_by_billing_profile( return client_raw_response return deserialized - list_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingPermissions'} + list_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingPermissions'} 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 869fa49ece30..8e12a121031c 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 @@ -24,7 +24,7 @@ class BillingProfilesOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config @@ -99,13 +99,78 @@ def list_by_billing_account_name( return deserialized list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles'} + def get( + self, billing_account_name, billing_profile_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the billing profile by id. + + :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 expand: May be used to expand the invoiceSections. + :type expand: 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: BillingProfile or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingProfile or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, '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('BillingProfile', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}'} + def _create_initial( - self, billing_account_name, parameters, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create.metadata['url'] path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + '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) @@ -125,10 +190,10 @@ def _create_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'BillingProfileCreationParameters') + body_content = self._serialize.body(parameters, 'BillingProfileCreationRequest') # 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]: @@ -142,7 +207,6 @@ def _create_initial( header_dict = { 'Location': 'str', 'Retry-After': 'int', - 'Azure-AsyncOperation': 'str', } if raw: @@ -153,15 +217,17 @@ def _create_initial( return deserialized def create( - self, billing_account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + self, billing_account_name, billing_profile_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to create a BillingProfile. :param billing_account_name: billing Account Id. :type billing_account_name: str - :param parameters: Parameters supplied to the Create BillingProfile - operation. + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param parameters: Request parameters supplied to the Create + BillingProfile operation. :type parameters: - ~azure.mgmt.billing.models.BillingProfileCreationParameters + ~azure.mgmt.billing.models.BillingProfileCreationRequest :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 @@ -178,6 +244,7 @@ def create( """ raw_result = self._create_initial( billing_account_name=billing_account_name, + billing_profile_name=billing_profile_name, parameters=parameters, custom_headers=custom_headers, raw=True, @@ -188,7 +255,6 @@ def get_long_running_output(response): header_dict = { 'Location': 'str', 'Retry-After': 'int', - 'Azure-AsyncOperation': 'str', } deserialized = self._deserialize('BillingProfile', response) @@ -206,71 +272,7 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles'} - - def get( - self, billing_account_name, billing_profile_name, expand=None, custom_headers=None, raw=False, **operation_config): - """Get the billing profile by id. - - :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 expand: May be used to expand the invoiceSections. - :type expand: 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: BillingProfile or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingProfile or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.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') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, '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('BillingProfile', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}'} + create.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}'} def _update_initial( @@ -302,7 +304,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]: @@ -333,8 +335,8 @@ def update( :type billing_account_name: str :param billing_profile_name: Billing Profile Id. :type billing_profile_name: str - :param parameters: Parameters supplied to the update billing profile - operation. + :param parameters: Request parameters supplied to the update billing + profile operation. :type parameters: ~azure.mgmt.billing.models.BillingProfile :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_property_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_property_operations.py index 38d4ca1f0ce3..8af44a766c15 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_property_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_property_operations.py @@ -22,7 +22,7 @@ class BillingPropertyOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py index a20aa6afde99..7deb7df6ced3 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py @@ -22,7 +22,7 @@ class BillingRoleAssignmentsOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config @@ -94,7 +94,7 @@ def get_by_billing_account( return client_raw_response return deserialized - get_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + get_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}'} def delete_by_billing_account_name( self, billing_account_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): @@ -154,14 +154,16 @@ def delete_by_billing_account_name( return client_raw_response return deserialized - delete_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + delete_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}'} def get_by_invoice_section_name( - self, billing_account_name, invoice_section_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): """Get the role assignment for the caller on the invoice Section. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param billing_role_assignment_name: role assignment id. @@ -181,6 +183,7 @@ def get_by_invoice_section_name( url = self.get_by_invoice_section_name.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') } @@ -217,14 +220,16 @@ def get_by_invoice_section_name( return client_raw_response return deserialized - get_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + get_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}'} def delete_by_invoice_section_name( - self, billing_account_name, invoice_section_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): """Delete the role assignment on the invoice Section. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param billing_role_assignment_name: role assignment id. @@ -244,6 +249,7 @@ def delete_by_invoice_section_name( url = self.delete_by_invoice_section_name.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') } @@ -280,7 +286,7 @@ def delete_by_invoice_section_name( return client_raw_response return deserialized - delete_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + delete_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}'} def get_by_billing_profile_name( self, billing_account_name, billing_profile_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): @@ -343,7 +349,7 @@ def get_by_billing_profile_name( return client_raw_response return deserialized - get_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + get_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}'} def delete_by_billing_profile_name( self, billing_account_name, billing_profile_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): @@ -406,7 +412,7 @@ def delete_by_billing_profile_name( return client_raw_response return deserialized - delete_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + delete_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}'} def list_by_billing_account_name( self, billing_account_name, custom_headers=None, raw=False, **operation_config): @@ -464,7 +470,7 @@ def list_by_billing_account_name( return client_raw_response return deserialized - list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments'} + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments'} def add_by_billing_account_name( self, billing_account_name, principal_id=None, billing_role_definition_id=None, custom_headers=None, raw=False, **operation_config): @@ -533,14 +539,16 @@ def add_by_billing_account_name( return client_raw_response return deserialized - add_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/createBillingRoleAssignment'} + add_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments'} def list_by_invoice_section_name( - self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): """Get the role assignments on the invoice Section. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param dict custom_headers: headers that will be added to the request @@ -559,6 +567,7 @@ def list_by_invoice_section_name( url = self.list_by_invoice_section_name.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -594,14 +603,16 @@ def list_by_invoice_section_name( return client_raw_response return deserialized - list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments'} + list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments'} def add_by_invoice_section_name( - self, billing_account_name, invoice_section_name, principal_id=None, billing_role_definition_id=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, principal_id=None, billing_role_definition_id=None, custom_headers=None, raw=False, **operation_config): """The operation to add a role assignment to a invoice Section. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param principal_id: The user's principal id that the role gets @@ -627,6 +638,7 @@ def add_by_invoice_section_name( url = self.add_by_invoice_section_name.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -666,7 +678,7 @@ def add_by_invoice_section_name( return client_raw_response return deserialized - add_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/createBillingRoleAssignment'} + add_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments'} def list_by_billing_profile_name( self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): @@ -727,7 +739,7 @@ def list_by_billing_profile_name( return client_raw_response return deserialized - list_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleAssignments'} + list_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments'} def add_by_billing_profile_name( self, billing_account_name, billing_profile_name, principal_id=None, billing_role_definition_id=None, custom_headers=None, raw=False, **operation_config): @@ -799,4 +811,4 @@ def add_by_billing_profile_name( return client_raw_response return deserialized - add_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/createBillingRoleAssignment'} + add_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_definitions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_definitions_operations.py index 9ee44c433066..1bc1fe026f32 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_definitions_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_definitions_operations.py @@ -22,7 +22,7 @@ class BillingRoleDefinitionsOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config @@ -94,14 +94,16 @@ def get_by_billing_account_name( return client_raw_response return deserialized - get_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}'} + get_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/{billingRoleDefinitionName}'} def get_by_invoice_section_name( - self, billing_account_name, invoice_section_name, billing_role_definition_name, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, billing_role_definition_name, custom_headers=None, raw=False, **operation_config): """Gets the role definition for a role. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param billing_role_definition_name: role definition id. @@ -121,6 +123,7 @@ def get_by_invoice_section_name( url = self.get_by_invoice_section_name.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), 'billingRoleDefinitionName': self._serialize.url("billing_role_definition_name", billing_role_definition_name, 'str') } @@ -157,7 +160,7 @@ def get_by_invoice_section_name( return client_raw_response return deserialized - get_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}'} + get_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/{billingRoleDefinitionName}'} def get_by_billing_profile_name( self, billing_account_name, billing_profile_name, billing_role_definition_name, custom_headers=None, raw=False, **operation_config): @@ -220,7 +223,7 @@ def get_by_billing_profile_name( return client_raw_response return deserialized - get_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}'} + get_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions/{billingRoleDefinitionName}'} def list_by_billing_account_name( self, billing_account_name, custom_headers=None, raw=False, **operation_config): @@ -278,14 +281,16 @@ def list_by_billing_account_name( return client_raw_response return deserialized - list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleDefinitions'} + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions'} def list_by_invoice_section_name( - self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): """Lists the role definition for an invoice Section. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param dict custom_headers: headers that will be added to the request @@ -304,6 +309,7 @@ def list_by_invoice_section_name( url = self.list_by_invoice_section_name.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -339,7 +345,7 @@ def list_by_invoice_section_name( return client_raw_response return deserialized - list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleDefinitions'} + list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions'} def list_by_billing_profile_name( self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): @@ -400,4 +406,4 @@ def list_by_billing_profile_name( return client_raw_response return deserialized - list_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleDefinitions'} + list_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_operations.py index 26d11b6b070d..65232a578453 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_operations.py @@ -24,7 +24,7 @@ class BillingSubscriptionsOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config @@ -49,9 +49,9 @@ def list_by_billing_account_name( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of BillingSubscriptionSummary + :return: An iterator like instance of BillingSubscription :rtype: - ~azure.mgmt.billing.models.BillingSubscriptionSummaryPaged[~azure.mgmt.billing.models.BillingSubscriptionSummary] + ~azure.mgmt.billing.models.BillingSubscriptionPaged[~azure.mgmt.billing.models.BillingSubscription] :raises: :class:`ErrorResponseException` """ @@ -93,11 +93,11 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.BillingSubscriptionSummaryPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.BillingSubscriptionPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.BillingSubscriptionSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.BillingSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized @@ -165,11 +165,13 @@ def list_by_billing_profile_name( list_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingSubscriptions'} def list_by_invoice_section_name( - self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): """Lists billing subscription by invoice section name. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param dict custom_headers: headers that will be added to the request @@ -188,6 +190,7 @@ def list_by_invoice_section_name( url = self.list_by_invoice_section_name.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -223,14 +226,16 @@ def list_by_invoice_section_name( return client_raw_response return deserialized - list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions'} + list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions'} def get( - self, billing_account_name, invoice_section_name, billing_subscription_name, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, billing_subscription_name, custom_headers=None, raw=False, **operation_config): """Get a single billing subscription by name. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param billing_subscription_name: Billing Subscription Id. @@ -240,8 +245,8 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: BillingSubscriptionSummary or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingSubscriptionSummary or + :return: BillingSubscription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingSubscription or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -250,6 +255,7 @@ def get( url = self.get.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), 'billingSubscriptionName': self._serialize.url("billing_subscription_name", billing_subscription_name, 'str') } @@ -279,24 +285,25 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('BillingSubscriptionSummary', response) + deserialized = self._deserialize('BillingSubscription', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}'} + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}'} def _transfer_initial( - self, billing_account_name, invoice_section_name, billing_subscription_name, destination_invoice_section_id=None, destination_billing_profile_id=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, billing_subscription_name, destination_invoice_section_id=None, destination_billing_profile_id=None, custom_headers=None, raw=False, **operation_config): parameters = models.TransferBillingSubscriptionRequestProperties(destination_invoice_section_id=destination_invoice_section_id, destination_billing_profile_id=destination_billing_profile_id) # Construct URL url = self.transfer.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), 'billingSubscriptionName': self._serialize.url("billing_subscription_name", billing_subscription_name, 'str') } @@ -334,7 +341,6 @@ def _transfer_initial( header_dict = { 'Location': 'str', 'Retry-After': 'int', - 'Azure-AsyncOperation': 'str', } if raw: @@ -345,12 +351,14 @@ def _transfer_initial( return deserialized def transfer( - self, billing_account_name, invoice_section_name, billing_subscription_name, destination_invoice_section_id=None, destination_billing_profile_id=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, billing_subscription_name, destination_invoice_section_id=None, destination_billing_profile_id=None, custom_headers=None, raw=False, polling=True, **operation_config): """Transfers the subscription from one invoice section to another within a billing account. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param billing_subscription_name: Billing Subscription Id. @@ -378,6 +386,7 @@ def transfer( """ raw_result = self._transfer_initial( billing_account_name=billing_account_name, + billing_profile_name=billing_profile_name, invoice_section_name=invoice_section_name, billing_subscription_name=billing_subscription_name, destination_invoice_section_id=destination_invoice_section_id, @@ -391,7 +400,6 @@ def get_long_running_output(response): header_dict = { 'Location': 'str', 'Retry-After': 'int', - 'Azure-AsyncOperation': 'str', } deserialized = self._deserialize('TransferBillingSubscriptionResult', response) @@ -409,15 +417,17 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/transfer'} + transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/transfer'} def validate_transfer( - self, billing_account_name, invoice_section_name, billing_subscription_name, destination_invoice_section_id=None, destination_billing_profile_id=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, billing_subscription_name, destination_invoice_section_id=None, destination_billing_profile_id=None, custom_headers=None, raw=False, **operation_config): """Validates the transfer of billing subscriptions across invoice sections. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param billing_subscription_name: Billing Subscription Id. @@ -447,6 +457,7 @@ def validate_transfer( url = self.validate_transfer.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), 'billingSubscriptionName': self._serialize.url("billing_subscription_name", billing_subscription_name, 'str') } @@ -486,4 +497,4 @@ def validate_transfer( return client_raw_response return deserialized - validate_transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/validateTransferEligibility'} + validate_transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/validateTransferEligibility'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py index dd5044ad7ef5..20a0c90af6b7 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py @@ -22,7 +22,7 @@ class DepartmentsOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py index b996cb2b6890..89ac4d1e7f8b 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py @@ -22,7 +22,7 @@ class EnrollmentAccountsOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config 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 e55dbd2ba3d1..e93a6116b1c3 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 @@ -24,7 +24,7 @@ class InvoiceSectionsOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -34,18 +34,18 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config def list_by_billing_account_name( - self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): """Lists all invoice sections for a user which he has access to. :param billing_account_name: billing Account Id. :type billing_account_name: str - :param expand: May be used to expand the billingProfiles. - :type expand: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_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 @@ -60,15 +60,14 @@ def list_by_billing_account_name( # 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') + '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') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') # Construct headers header_parameters = {} @@ -97,124 +96,12 @@ def list_by_billing_account_name( return client_raw_response return deserialized - list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections'} - - - def _create_initial( - self, billing_account_name, display_name=None, billing_profile_id=None, custom_headers=None, raw=False, **operation_config): - parameters = models.InvoiceSectionCreationRequest(display_name=display_name, billing_profile_id=billing_profile_id) - - # Construct URL - url = self.create.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(parameters, 'InvoiceSectionCreationRequest') - - # 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, 202]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('InvoiceSection', 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 create( - self, billing_account_name, display_name=None, billing_profile_id=None, custom_headers=None, raw=False, polling=True, **operation_config): - """The operation to create a InvoiceSection. + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections'} - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param display_name: The name of the InvoiceSection. - :type display_name: str - :param billing_profile_id: The billing profile id. - :type billing_profile_id: str - :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 InvoiceSection or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.InvoiceSection] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.InvoiceSection]] - :raises: - :class:`ErrorResponseException` - """ - raw_result = self._create_initial( - billing_account_name=billing_account_name, - display_name=display_name, - billing_profile_id=billing_profile_id, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - header_dict = { - 'Location': 'str', - 'Retry-After': 'int', - 'Azure-AsyncOperation': 'str', - } - deserialized = self._deserialize('InvoiceSection', response) - - if raw: - 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) - 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) - create.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections'} - - def list_by_billing_profile_name( + def list_by_create_subscription_permission( self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): - """Lists all invoice sections under a billing profile for a user which he - has access to. + """Lists all invoiceSections with create subscription permission for a + user. :param billing_account_name: billing Account Id. :type billing_account_name: str @@ -232,7 +119,7 @@ def list_by_billing_profile_name( :class:`ErrorResponseException` """ # Construct URL - url = self.list_by_billing_profile_name.metadata['url'] + url = self.list_by_create_subscription_permission.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') @@ -270,40 +157,41 @@ def list_by_billing_profile_name( return client_raw_response return deserialized - list_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections'} + list_by_create_subscription_permission.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/listInvoiceSectionsWithCreateSubscriptionPermission'} - def list_by_create_subscription_permission( - self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): - """Lists all invoiceSections with create subscription permission for a - user. + def get( + self, billing_account_name, billing_profile_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Get the InvoiceSection by id. :param billing_account_name: billing Account Id. :type billing_account_name: str - :param expand: May be used to expand the billingProfiles. - :type expand: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_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`. - :return: InvoiceSectionListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.InvoiceSectionListResult or + :return: InvoiceSection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceSection or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.list_by_create_subscription_permission.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_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') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') # Construct headers header_parameters = {} @@ -325,40 +213,25 @@ def list_by_create_subscription_permission( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('InvoiceSectionListResult', response) + deserialized = self._deserialize('InvoiceSection', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_by_create_subscription_permission.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/listInvoiceSectionsWithCreateSubscriptionPermission'} + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}'} - def get( - self, billing_account_name, invoice_section_name, expand=None, custom_headers=None, raw=False, **operation_config): - """Get the InvoiceSection by id. - :param billing_account_name: billing Account Id. - :type billing_account_name: str - :param invoice_section_name: InvoiceSection Id. - :type invoice_section_name: str - :param expand: May be used to expand the billingProfiles. - :type expand: 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: InvoiceSection or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.InvoiceSection or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ + def _create_initial( + self, billing_account_name, billing_profile_name, invoice_section_name, display_name=None, billing_profile_id=None, custom_headers=None, raw=False, **operation_config): + parameters = models.InvoiceSectionCreationRequest(display_name=display_name, billing_profile_id=billing_profile_id) + # Construct URL - url = self.get.metadata['url'] + url = self.create.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -366,12 +239,11 @@ def get( # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, '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: @@ -379,34 +251,105 @@ def get( 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, 'InvoiceSectionCreationRequest') + # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + 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]: + if response.status_code not in [200, 202]: raise models.ErrorResponseException(self._deserialize, response) deserialized = None + header_dict = {} if response.status_code == 200: deserialized = self._deserialize('InvoiceSection', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + } if raw: client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}'} + + def create( + self, billing_account_name, billing_profile_name, invoice_section_name, display_name=None, billing_profile_id=None, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to create an invoice section. + + :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 invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param display_name: The name of the InvoiceSection. + :type display_name: str + :param billing_profile_id: The billing profile id. + :type billing_profile_id: str + :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 InvoiceSection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.InvoiceSection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.InvoiceSection]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_initial( + billing_account_name=billing_account_name, + billing_profile_name=billing_profile_name, + invoice_section_name=invoice_section_name, + display_name=display_name, + billing_profile_id=billing_profile_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + } + deserialized = self._deserialize('InvoiceSection', response) + + if raw: + 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) + 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) + create.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}'} def _update_initial( - self, billing_account_name, invoice_section_name, display_name=None, billing_profiles=None, custom_headers=None, raw=False, **operation_config): - parameters = models.InvoiceSection(display_name=display_name, billing_profiles=billing_profiles) + self, billing_account_name, billing_profile_name, invoice_section_name, display_name=None, custom_headers=None, raw=False, **operation_config): + parameters = models.InvoiceSection(display_name=display_name) # Construct URL url = self.update.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -430,7 +373,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]: @@ -454,19 +397,17 @@ def _update_initial( return deserialized def update( - self, billing_account_name, invoice_section_name, display_name=None, billing_profiles=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, display_name=None, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to update a InvoiceSection. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param display_name: The name of the InvoiceSection. :type display_name: str - :param billing_profiles: The billing profiles associated to the - billing account. - :type billing_profiles: - list[~azure.mgmt.billing.models.BillingProfile] :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 @@ -483,9 +424,9 @@ def update( """ raw_result = self._update_initial( billing_account_name=billing_account_name, + billing_profile_name=billing_profile_name, invoice_section_name=invoice_section_name, display_name=display_name, - billing_profiles=billing_profiles, custom_headers=custom_headers, raw=True, **operation_config @@ -512,14 +453,16 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}'} + update.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}'} def elevate_to_billing_profile( - self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): """Elevates the caller's access to match their billing profile access. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param dict custom_headers: headers that will be added to the request @@ -536,6 +479,7 @@ def elevate_to_billing_profile( url = self.elevate_to_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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -562,4 +506,4 @@ def elevate_to_billing_profile( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - elevate_to_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/elevate'} + elevate_to_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/elevate'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py index c5ed960009b8..9af57c027d62 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py @@ -22,7 +22,7 @@ class InvoicesOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config @@ -180,8 +180,8 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: InvoiceSummary or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.InvoiceSummary or + :return: Invoice or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.Invoice or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -219,7 +219,7 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('InvoiceSummary', response) + deserialized = self._deserialize('Invoice', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) 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 dd7bf04d7df4..a12de7c70440 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 @@ -24,7 +24,7 @@ class LineOfCreditsOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config @@ -138,7 +138,6 @@ def _update_initial( header_dict = { 'Location': 'str', 'Retry-After': 'int', - 'Azure-AsyncOperation': 'str', } if raw: @@ -183,7 +182,6 @@ def get_long_running_output(response): header_dict = { 'Location': 'str', 'Retry-After': 'int', - 'Azure-AsyncOperation': 'str', } deserialized = self._deserialize('LineOfCredit', response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py index 09088dd24e9a..7beab7125226 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_operations.py index 462791ae4262..5babbbd9bcda 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_operations.py @@ -22,7 +22,7 @@ class PaymentMethodsOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/policies_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/policies_operations.py index 1dcbc3d125e7..14c4cf690934 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/policies_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/policies_operations.py @@ -22,7 +22,7 @@ class PoliciesOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py index b2e7e67f49b5..d8879878b44d 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py @@ -24,7 +24,7 @@ class PriceSheetOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config @@ -78,7 +78,6 @@ def _download_initial( header_dict = { 'Location': 'str', 'Retry-After': 'str', - 'Azure-AsyncOperation': 'str', 'OData-EntityId': 'str', } @@ -123,7 +122,6 @@ def get_long_running_output(response): header_dict = { 'Location': 'str', 'Retry-After': 'str', - 'Azure-AsyncOperation': 'str', 'OData-EntityId': 'str', } deserialized = self._deserialize('DownloadUrl', response) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py index 90592416de49..da73ea5fd031 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py @@ -22,7 +22,7 @@ class ProductsOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config @@ -52,9 +52,9 @@ def list_by_billing_account_name( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of ProductSummary + :return: An iterator like instance of Product :rtype: - ~azure.mgmt.billing.models.ProductSummaryPaged[~azure.mgmt.billing.models.ProductSummary] + ~azure.mgmt.billing.models.ProductPaged[~azure.mgmt.billing.models.Product] :raises: :class:`ErrorResponseException` """ @@ -98,22 +98,24 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.ProductSummaryPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.ProductPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.ProductSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.ProductPaged(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}/products'} def list_by_invoice_section_name( - self, billing_account_name, invoice_section_name, filter=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, filter=None, custom_headers=None, raw=False, **operation_config): """Lists products by invoice section name. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param filter: May be used to filter by product type. The filter @@ -136,6 +138,7 @@ def list_by_invoice_section_name( url = self.list_by_invoice_section_name.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -173,14 +176,16 @@ def list_by_invoice_section_name( return client_raw_response return deserialized - list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products'} + list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products'} def get( - self, billing_account_name, invoice_section_name, product_name, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, product_name, custom_headers=None, raw=False, **operation_config): """Get a single product by name. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param product_name: Invoice Id. @@ -190,8 +195,8 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: ProductSummary or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.ProductSummary or + :return: Product or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.Product or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -200,6 +205,7 @@ def get( url = self.get.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), 'productName': self._serialize.url("product_name", product_name, 'str') } @@ -229,21 +235,23 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ProductSummary', response) + deserialized = self._deserialize('Product', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}'} + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products/{productName}'} def transfer( - self, billing_account_name, invoice_section_name, product_name, destination_invoice_section_id=None, destination_billing_profile_id=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, product_name, destination_invoice_section_id=None, destination_billing_profile_id=None, custom_headers=None, raw=False, **operation_config): """The operation to transfer a Product to another invoice section. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param product_name: Invoice Id. @@ -259,8 +267,8 @@ def transfer( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: ProductSummary or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.ProductSummary or + :return: Product or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.Product or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -271,6 +279,7 @@ def transfer( url = self.transfer.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), 'productName': self._serialize.url("product_name", product_name, 'str') } @@ -305,11 +314,10 @@ def transfer( header_dict = {} if response.status_code == 200: - deserialized = self._deserialize('ProductSummary', response) + deserialized = self._deserialize('Product', response) header_dict = { 'Location': 'str', 'Retry-After': 'int', - 'Azure-AsyncOperation': 'str', } if raw: @@ -318,14 +326,16 @@ def transfer( return client_raw_response return deserialized - transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}/transfer'} + transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products/{productName}/transfer'} def validate_transfer( - self, billing_account_name, invoice_section_name, product_name, destination_invoice_section_id=None, destination_billing_profile_id=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, product_name, destination_invoice_section_id=None, destination_billing_profile_id=None, custom_headers=None, raw=False, **operation_config): """Validates the transfer of products across invoice sections. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param product_name: Invoice Id. @@ -355,6 +365,7 @@ def validate_transfer( url = self.validate_transfer.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), 'productName': self._serialize.url("product_name", product_name, 'str') } @@ -394,7 +405,7 @@ def validate_transfer( return client_raw_response return deserialized - validate_transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}/validateTransferEligibility'} + validate_transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products/{productName}/validateTransferEligibility'} def update_auto_renew_by_billing_account_name( self, billing_account_name, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): @@ -412,9 +423,8 @@ def update_auto_renew_by_billing_account_name( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: UpdateAutoRenewOperationSummary or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.billing.models.UpdateAutoRenewOperationSummary or + :return: UpdateAutoRenewOperation or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.UpdateAutoRenewOperation or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -457,7 +467,7 @@ def update_auto_renew_by_billing_account_name( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('UpdateAutoRenewOperationSummary', response) + deserialized = self._deserialize('UpdateAutoRenewOperation', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -467,11 +477,13 @@ def update_auto_renew_by_billing_account_name( update_auto_renew_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/updateAutoRenew'} def update_auto_renew_by_invoice_section_name( - self, billing_account_name, invoice_section_name, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): """Cancel auto renew for product by product id and invoice section name. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param product_name: Invoice Id. @@ -484,9 +496,8 @@ def update_auto_renew_by_invoice_section_name( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: UpdateAutoRenewOperationSummary or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.billing.models.UpdateAutoRenewOperationSummary or + :return: UpdateAutoRenewOperation or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.UpdateAutoRenewOperation or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -497,6 +508,7 @@ def update_auto_renew_by_invoice_section_name( url = self.update_auto_renew_by_invoice_section_name.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), 'productName': self._serialize.url("product_name", product_name, 'str') } @@ -530,11 +542,11 @@ def update_auto_renew_by_invoice_section_name( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('UpdateAutoRenewOperationSummary', response) + deserialized = self._deserialize('UpdateAutoRenewOperation', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update_auto_renew_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}/updateAutoRenew'} + update_auto_renew_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products/{productName}/updateAutoRenew'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py index 04d1f8d4dd43..81a3dc42f157 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py @@ -208,7 +208,7 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/transfers/{transferName}/'} + get.metadata = {'url': '/providers/Microsoft.Billing/transfers/{transferName}'} def list( self, custom_headers=None, raw=False, **operation_config): diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py index 3b5566d34793..8282ef261bea 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py @@ -22,7 +22,7 @@ class TransactionsOperations(object): :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". + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-11-01-preview" + self.api_version = "2019-10-01-preview" self.config = config @@ -57,9 +57,9 @@ def list_by_billing_account_name( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of TransactionsSummary + :return: An iterator like instance of Transaction :rtype: - ~azure.mgmt.billing.models.TransactionsSummaryPaged[~azure.mgmt.billing.models.TransactionsSummary] + ~azure.mgmt.billing.models.TransactionPaged[~azure.mgmt.billing.models.Transaction] :raises: :class:`ErrorResponseException` """ @@ -105,11 +105,11 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.TransactionsSummaryPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.TransactionPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.TransactionsSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.TransactionPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized @@ -138,8 +138,8 @@ def list_by_billing_profile_name( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: TransactionsListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.TransactionsListResult or + :return: TransactionListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransactionListResult or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -180,7 +180,7 @@ def list_by_billing_profile_name( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('TransactionsListResult', response) + deserialized = self._deserialize('TransactionListResult', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -190,12 +190,14 @@ def list_by_billing_profile_name( list_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/transactions'} def list_by_invoice_section_name( - self, billing_account_name, invoice_section_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): """Lists the transactions by invoice section name 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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param start_date: Start date @@ -212,8 +214,8 @@ def list_by_invoice_section_name( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: TransactionsListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.TransactionsListResult or + :return: TransactionListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransactionListResult or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -222,6 +224,7 @@ def list_by_invoice_section_name( url = self.list_by_invoice_section_name.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -254,11 +257,77 @@ def list_by_invoice_section_name( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('TransactionsListResult', response) + deserialized = self._deserialize('TransactionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transactions'} + + def get( + self, billing_account_name, billing_profile_name, invoice_section_name, transaction_name, custom_headers=None, raw=False, **operation_config): + """Get the transaction. + + :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 invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param transaction_name: Transaction name. + :type transaction_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`. + :return: Transaction or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.Transaction or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.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'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'transactionName': self._serialize.url("transaction_name", transaction_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' + 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('Transaction', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transactions'} + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transactions/{transactionName}'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py index 2daf9f4588e8..48d91589d676 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py @@ -35,16 +35,15 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def initiate( - self, billing_account_name, invoice_section_name, billing_profile_id=None, recipient_email_id=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, recipient_email_id=None, custom_headers=None, raw=False, **operation_config): """Initiates the request to transfer the legacy subscriptions or RIs. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str - :param billing_profile_id: Target Usage context for devTest - subscriptions. - :type billing_profile_id: str :param recipient_email_id: Email Id of recipient for transfer. :type recipient_email_id: str :param dict custom_headers: headers that will be added to the request @@ -58,12 +57,13 @@ def initiate( :raises: :class:`ErrorResponseException` """ - body = models.InitiateTransferRequest(billing_profile_id=billing_profile_id, recipient_email_id=recipient_email_id) + body = models.InitiateTransferRequest(recipient_email_id=recipient_email_id) # Construct URL url = self.initiate.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -102,14 +102,16 @@ def initiate( return client_raw_response return deserialized - initiate.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/initiateTransfer'} + initiate.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/initiateTransfer'} def get( - self, billing_account_name, invoice_section_name, transfer_name, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, transfer_name, custom_headers=None, raw=False, **operation_config): """Gets the transfer details for given transfer Id. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param transfer_name: Transfer Name. @@ -129,6 +131,7 @@ def get( url = self.get.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') } @@ -164,14 +167,16 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}'} + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}'} def cancel( - self, billing_account_name, invoice_section_name, transfer_name, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, transfer_name, custom_headers=None, raw=False, **operation_config): """Cancels the transfer for given transfer Id. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param transfer_name: Transfer Name. @@ -191,6 +196,7 @@ def cancel( url = self.cancel.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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') } @@ -226,14 +232,16 @@ def cancel( return client_raw_response return deserialized - cancel.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}'} + cancel.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}'} def list( - self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): """Lists all transfer's details initiated from given invoice section. :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 invoice_section_name: InvoiceSection Id. :type invoice_section_name: str :param dict custom_headers: headers that will be added to the request @@ -254,6 +262,7 @@ def internal_paging(next_link=None, raw=False): 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'), 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -293,4 +302,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transfers'} + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers'} From 32d083a7b40fe4535557648d3a612dd36b1486c4 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 18 Jul 2019 06:36:56 +0000 Subject: [PATCH 02/18] Generated from d03bdfdbfa03bc69371ac55b5cea86958a4d79ca Fixed build errors --- .../azure/mgmt/billing/models/payment_method.py | 6 +++--- .../azure/mgmt/billing/models/payment_method_py3.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py index b2551b8f4fa2..f5e5e53ae3f5 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py @@ -30,8 +30,8 @@ class PaymentMethod(Resource): ~azure.mgmt.billing.models.PaymentMethodType :ivar details: Details about the payment method. :vartype details: str - :ivar expiration: Expiration date. - :vartype expiration: datetime + :ivar expiration: Expiration month and year. + :vartype expiration: str :ivar currency: The currency associated with the payment method. :vartype currency: str """ @@ -51,7 +51,7 @@ class PaymentMethod(Resource): 'type': {'key': 'type', 'type': 'str'}, 'payment_method_type': {'key': 'properties.paymentMethodType', 'type': 'str'}, 'details': {'key': 'properties.details', 'type': 'str'}, - 'expiration': {'key': 'properties.expiration', 'type': 'iso-8601'}, + 'expiration': {'key': 'properties.expiration', 'type': 'str'}, 'currency': {'key': 'properties.currency', 'type': 'str'}, } diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py index 1c4ad14cd61a..e4176955e527 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py @@ -30,8 +30,8 @@ class PaymentMethod(Resource): ~azure.mgmt.billing.models.PaymentMethodType :ivar details: Details about the payment method. :vartype details: str - :ivar expiration: Expiration date. - :vartype expiration: datetime + :ivar expiration: Expiration month and year. + :vartype expiration: str :ivar currency: The currency associated with the payment method. :vartype currency: str """ @@ -51,7 +51,7 @@ class PaymentMethod(Resource): 'type': {'key': 'type', 'type': 'str'}, 'payment_method_type': {'key': 'properties.paymentMethodType', 'type': 'str'}, 'details': {'key': 'properties.details', 'type': 'str'}, - 'expiration': {'key': 'properties.expiration', 'type': 'iso-8601'}, + 'expiration': {'key': 'properties.expiration', 'type': 'str'}, 'currency': {'key': 'properties.currency', 'type': 'str'}, } From e8886bf2ea8ba96c55676ad6d08109f0b0531389 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 18 Jul 2019 07:14:37 +0000 Subject: [PATCH 03/18] Generated from 12a3f4c2d0f0aef8f7f234edb51c3f7827dee716 Update billing.json --- .../mgmt/billing/operations/billing_permissions_operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py index d65086c157d6..d30310e261d2 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py @@ -158,7 +158,7 @@ def list_by_invoice_sections( def list_by_billing_profile( self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): - """Lists all billingPermissions for the caller has for a billing account. + """Lists all billing permissions for the caller has for a billing account. :param billing_account_name: billing Account Id. :type billing_account_name: str From 09b27e984d3f59916287a9725802c7921ee44593 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 19 Jul 2019 00:28:20 +0000 Subject: [PATCH 04/18] Generated from 0a3d64eb9ccc600dc982bb778223c2f3de38b6de Updated policy properties Updated policy properties --- .../azure/mgmt/billing/models/__init__.py | 2 -- .../models/billing_management_client_enums.py | 9 ++------- .../azure/mgmt/billing/models/policy.py | 11 +++-------- .../azure/mgmt/billing/models/policy_py3.py | 13 ++++--------- 4 files changed, 9 insertions(+), 26 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 df5eab1ad7ef..4682c89f8cde 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 @@ -170,7 +170,6 @@ MarketplacePurchasesPolicy, ReservationPurchasesPolicy, ViewChargesPolicy, - FreeMarketplacePurchasesPolicy, PaymentMethodType, UpdateAutoRenew, Status, @@ -267,7 +266,6 @@ 'MarketplacePurchasesPolicy', 'ReservationPurchasesPolicy', 'ViewChargesPolicy', - 'FreeMarketplacePurchasesPolicy', '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 25b4b20e11fc..75426eaedbbc 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 @@ -117,7 +117,8 @@ class ReservationType(str, Enum): class MarketplacePurchasesPolicy(str, Enum): - allowed = "Allowed" + all_allowed = "AllAllowed" + free_allowed = "FreeAllowed" not_allowed = "NotAllowed" @@ -133,12 +134,6 @@ class ViewChargesPolicy(str, Enum): subscription_owner = "SubscriptionOwner" -class FreeMarketplacePurchasesPolicy(str, Enum): - - allowed = "Allowed" - not_allowed = "NotAllowed" - - class PaymentMethodType(str, Enum): credits = "Credits" diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy.py index 5f2e1eb3e6c9..5a55d57edd6c 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy.py @@ -24,8 +24,9 @@ class Policy(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param marketplace_purchases: The marketplace purchases allowed or not. - Possible values include: 'Allowed', 'NotAllowed' + :param marketplace_purchases: The marketplace purchases are free, allowed + or not allowed. Possible values include: 'AllAllowed', 'FreeAllowed', + 'NotAllowed' :type marketplace_purchases: str or ~azure.mgmt.billing.models.MarketplacePurchasesPolicy :param reservation_purchases: The reservation purchases allowed or not. @@ -35,10 +36,6 @@ class Policy(Resource): :param view_charges: Who can view charges. Possible values include: 'None', 'SubscriptionOwner' :type view_charges: str or ~azure.mgmt.billing.models.ViewChargesPolicy - :param free_marketplace_purchases: The free marketplace purchases allowed - or not. Possible values include: 'Allowed', 'NotAllowed' - :type free_marketplace_purchases: str or - ~azure.mgmt.billing.models.FreeMarketplacePurchasesPolicy """ _validation = { @@ -54,7 +51,6 @@ class Policy(Resource): 'marketplace_purchases': {'key': 'properties.marketplacePurchases', 'type': 'str'}, 'reservation_purchases': {'key': 'properties.reservationPurchases', 'type': 'str'}, 'view_charges': {'key': 'properties.viewCharges', 'type': 'str'}, - 'free_marketplace_purchases': {'key': 'properties.freeMarketplacePurchases', 'type': 'str'}, } def __init__(self, **kwargs): @@ -62,4 +58,3 @@ def __init__(self, **kwargs): self.marketplace_purchases = kwargs.get('marketplace_purchases', None) self.reservation_purchases = kwargs.get('reservation_purchases', None) self.view_charges = kwargs.get('view_charges', None) - self.free_marketplace_purchases = kwargs.get('free_marketplace_purchases', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py index 3630405ef6a7..cf316ef3eda0 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py @@ -24,8 +24,9 @@ class Policy(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param marketplace_purchases: The marketplace purchases allowed or not. - Possible values include: 'Allowed', 'NotAllowed' + :param marketplace_purchases: The marketplace purchases are free, allowed + or not allowed. Possible values include: 'AllAllowed', 'FreeAllowed', + 'NotAllowed' :type marketplace_purchases: str or ~azure.mgmt.billing.models.MarketplacePurchasesPolicy :param reservation_purchases: The reservation purchases allowed or not. @@ -35,10 +36,6 @@ class Policy(Resource): :param view_charges: Who can view charges. Possible values include: 'None', 'SubscriptionOwner' :type view_charges: str or ~azure.mgmt.billing.models.ViewChargesPolicy - :param free_marketplace_purchases: The free marketplace purchases allowed - or not. Possible values include: 'Allowed', 'NotAllowed' - :type free_marketplace_purchases: str or - ~azure.mgmt.billing.models.FreeMarketplacePurchasesPolicy """ _validation = { @@ -54,12 +51,10 @@ class Policy(Resource): 'marketplace_purchases': {'key': 'properties.marketplacePurchases', 'type': 'str'}, 'reservation_purchases': {'key': 'properties.reservationPurchases', 'type': 'str'}, 'view_charges': {'key': 'properties.viewCharges', 'type': 'str'}, - 'free_marketplace_purchases': {'key': 'properties.freeMarketplacePurchases', 'type': 'str'}, } - def __init__(self, *, marketplace_purchases=None, reservation_purchases=None, view_charges=None, free_marketplace_purchases=None, **kwargs) -> None: + def __init__(self, *, marketplace_purchases=None, reservation_purchases=None, view_charges=None, **kwargs) -> None: super(Policy, self).__init__(**kwargs) self.marketplace_purchases = marketplace_purchases self.reservation_purchases = reservation_purchases self.view_charges = view_charges - self.free_marketplace_purchases = free_marketplace_purchases From 5d435da164e5f67e61f386f888eb3c79447f9f02 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 19 Jul 2019 20:51:41 +0000 Subject: [PATCH 05/18] Generated from aa563c57138bdbbe0239bc88f677eceff72ed420 Incorporated review comments Incorporated review comments --- .../mgmt/billing/operations/invoice_sections_operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 e93a6116b1c3..f463d81b75d9 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 @@ -141,7 +141,7 @@ def list_by_create_subscription_permission( 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) + request = self._client.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: From 028792a6cfe1c42d0e633168bcf390fada9b42f8 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 22 Jul 2019 22:52:55 +0000 Subject: [PATCH 06/18] Generated from cf675f37afa739fa046b09c9623e3e366007cd5e Updated autorenew request params Updated autorenew request params --- .../azure/mgmt/billing/operations/products_operations.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py index da73ea5fd031..c829bf6999a7 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py @@ -429,7 +429,7 @@ def update_auto_renew_by_billing_account_name( :raises: :class:`ErrorResponseException` """ - body = models.UpdateAutoRenewRequest(auto_renew=auto_renew) + parameters = models.UpdateAutoRenewRequest(auto_renew=auto_renew) # Construct URL url = self.update_auto_renew_by_billing_account_name.metadata['url'] @@ -455,7 +455,7 @@ def update_auto_renew_by_billing_account_name( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(body, 'UpdateAutoRenewRequest') + body_content = self._serialize.body(parameters, 'UpdateAutoRenewRequest') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) @@ -502,7 +502,7 @@ def update_auto_renew_by_invoice_section_name( :raises: :class:`ErrorResponseException` """ - body = models.UpdateAutoRenewRequest(auto_renew=auto_renew) + parameters = models.UpdateAutoRenewRequest(auto_renew=auto_renew) # Construct URL url = self.update_auto_renew_by_invoice_section_name.metadata['url'] @@ -530,7 +530,7 @@ def update_auto_renew_by_invoice_section_name( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(body, 'UpdateAutoRenewRequest') + body_content = self._serialize.body(parameters, 'UpdateAutoRenewRequest') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) From 94506d65f4ed66eadb6640ef0f8120b320bd1e5e Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 23 Jul 2019 18:57:47 +0000 Subject: [PATCH 07/18] Generated from f192330d3afec7a8f1283d9a5978e2399bf1b7b2 Updated types for payment methods and available balance Updated types for payment methods and available balance --- .../mgmt/billing/operations/recipient_transfers_operations.py | 4 ++-- .../azure/mgmt/billing/operations/transfers_operations.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py index 81a3dc42f157..14981f5c037e 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py @@ -53,7 +53,7 @@ def accept( :raises: :class:`ErrorResponseException` """ - body = models.AcceptTransferRequest(product_details=product_details) + parameters = models.AcceptTransferRequest(product_details=product_details) # Construct URL url = self.accept.metadata['url'] @@ -77,7 +77,7 @@ def accept( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(body, 'AcceptTransferRequest') + body_content = self._serialize.body(parameters, 'AcceptTransferRequest') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py index 48d91589d676..8bcf950440ff 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py @@ -57,7 +57,7 @@ def initiate( :raises: :class:`ErrorResponseException` """ - body = models.InitiateTransferRequest(recipient_email_id=recipient_email_id) + parameters = models.InitiateTransferRequest(recipient_email_id=recipient_email_id) # Construct URL url = self.initiate.metadata['url'] @@ -83,7 +83,7 @@ def initiate( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(body, 'InitiateTransferRequest') + body_content = self._serialize.body(parameters, 'InitiateTransferRequest') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) From 8b9773272bd632244ab26d2690a26f40fc67a26a Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 23 Jul 2019 22:39:19 +0000 Subject: [PATCH 08/18] Generated from c018eb9e097a219934be08933636eaa8546f2914 Updated invoice section list examples Updated invoice section list examples --- .../mgmt/billing/operations/invoice_sections_operations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 f463d81b75d9..575ec3c9c1ff 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 @@ -38,7 +38,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def list_by_billing_account_name( + def list_by_billing_profile_name( self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): """Lists all invoice sections for a user which he has access to. @@ -58,7 +58,7 @@ def list_by_billing_account_name( :class:`ErrorResponseException` """ # Construct URL - url = self.list_by_billing_account_name.metadata['url'] + url = self.list_by_billing_profile_name.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') @@ -96,7 +96,7 @@ def list_by_billing_account_name( return client_raw_response return deserialized - list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections'} + list_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections'} def list_by_create_subscription_permission( self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): From 2ad5ccc9e3f7441310da249f4ffd58b18da9c93f Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 25 Jul 2019 02:11:23 +0000 Subject: [PATCH 09/18] Generated from 5275e24316fffeb0b90572c5a0489621c5869ea3 Fixed few errors --- .../mgmt/billing/models/billing_account.py | 3 +- .../billing/models/billing_account_py3.py | 3 +- .../models/billing_account_update_request.py | 3 +- .../billing_account_update_request_py3.py | 3 +- .../operations/price_sheet_operations.py | 118 +++++++++++++++++- 5 files changed, 121 insertions(+), 9 deletions(-) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py index 75d45bb42afb..db29f2c3383b 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py @@ -29,7 +29,8 @@ class BillingAccount(Resource): :param address: The address associated with billing account. :type address: ~azure.mgmt.billing.models.Address :ivar agreement_type: The type of agreement. Possible values include: - 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'Legacy' + 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', + 'MicrosoftOnlineServicesProgram' :vartype agreement_type: str or ~azure.mgmt.billing.models.enum :ivar customer_type: The type of customer. Possible values include: 'Enterprise', 'Individual', 'Partner' diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py index b2b163b09107..60bb6a4be0b5 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py @@ -29,7 +29,8 @@ class BillingAccount(Resource): :param address: The address associated with billing account. :type address: ~azure.mgmt.billing.models.Address :ivar agreement_type: The type of agreement. Possible values include: - 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'Legacy' + 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', + 'MicrosoftOnlineServicesProgram' :vartype agreement_type: str or ~azure.mgmt.billing.models.enum :ivar customer_type: The type of customer. Possible values include: 'Enterprise', 'Individual', 'Partner' diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request.py index 51b8365bfea0..77cb15b1f2db 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request.py @@ -23,7 +23,8 @@ class BillingAccountUpdateRequest(Model): :param address: The address associated with billing account. :type address: ~azure.mgmt.billing.models.Address :ivar agreement_type: The type of agreement. Possible values include: - 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'Legacy' + 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', + 'MicrosoftOnlineServicesProgram' :vartype agreement_type: str or ~azure.mgmt.billing.models.enum :ivar customer_type: The type of customer. Possible values include: 'Enterprise', 'Individual', 'Partner' diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request_py3.py index ab7fa54c8d4f..f20e5609af2f 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request_py3.py @@ -23,7 +23,8 @@ class BillingAccountUpdateRequest(Model): :param address: The address associated with billing account. :type address: ~azure.mgmt.billing.models.Address :ivar agreement_type: The type of agreement. Possible values include: - 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'Legacy' + 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', + 'MicrosoftOnlineServicesProgram' :vartype agreement_type: str or ~azure.mgmt.billing.models.enum :ivar customer_type: The type of customer. Possible values include: 'Enterprise', 'Individual', 'Partner' diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py index d8879878b44d..d92cbdeaf76b 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py @@ -40,11 +40,12 @@ def __init__(self, client, config, serializer, deserializer): def _download_initial( - self, billing_account_name, invoice_name, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.download.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'), 'invoiceName': self._serialize.url("invoice_name", invoice_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -89,12 +90,14 @@ def _download_initial( return deserialized def download( - self, billing_account_name, invoice_name, custom_headers=None, raw=False, polling=True, **operation_config): + self, billing_account_name, billing_profile_name, invoice_name, custom_headers=None, raw=False, polling=True, **operation_config): """Download price sheet for an invoice. - :param billing_account_name: Azure Billing Account ID. + :param billing_account_name: billing Account Id. :type billing_account_name: str - :param invoice_name: The name of an invoice resource. + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_name: Invoice Id. :type invoice_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the @@ -112,6 +115,7 @@ def download( """ raw_result = self._download_initial( billing_account_name=billing_account_name, + billing_profile_name=billing_profile_name, invoice_name=invoice_name, custom_headers=custom_headers, raw=True, @@ -140,4 +144,108 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - download.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/pricesheet/default/download'} + download.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}/pricesheet/default/download'} + + + def _download_by_billing_profile_name_initial( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.download_by_billing_profile_name.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') + + # 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('DownloadUrl', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + 'OData-EntityId': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def download_by_billing_profile_name( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Download price sheet for a billing profile. + + :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 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 DownloadUrl or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.DownloadUrl] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.DownloadUrl]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._download_by_billing_profile_name_initial( + billing_account_name=billing_account_name, + billing_profile_name=billing_profile_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + 'OData-EntityId': 'str', + } + deserialized = self._deserialize('DownloadUrl', response) + + if raw: + 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) + 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) + download_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/pricesheet/default/download'} From a6f764ae0f0761b4c9d3ec1cca9b1d42665762ea Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 27 Jul 2019 01:35:16 +0000 Subject: [PATCH 10/18] Generated from 09d21178677c38f079ec5f83bb8d242243f326a6 Updated transaction api examples Updated transaction api examples --- .../mgmt/billing/operations/transactions_operations.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py index 8282ef261bea..fdac62139fb6 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py @@ -267,7 +267,7 @@ def list_by_invoice_section_name( list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transactions'} def get( - self, billing_account_name, billing_profile_name, invoice_section_name, transaction_name, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, transaction_name, start_date, end_date, custom_headers=None, raw=False, **operation_config): """Get the transaction. :param billing_account_name: billing Account Id. @@ -278,6 +278,10 @@ def get( :type invoice_section_name: str :param transaction_name: Transaction name. :type transaction_name: str + :param start_date: Start date + :type start_date: str + :param end_date: End date + :type end_date: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -301,6 +305,8 @@ def get( # Construct parameters query_parameters = {} + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers @@ -330,4 +336,4 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transactions/{transactionName}'} + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/transactions/{transactionName}'} From bcfa36affb2999291c8d962107d55aae1097af5d Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 2 Aug 2019 23:18:46 +0000 Subject: [PATCH 11/18] Generated from 1790ba79f9d9f149fa1916e94d8a1c886ecd4305 Incorporated review coments --- .../azure/mgmt/billing/models/__init__.py | 8 +++++ .../mgmt/billing/models/billing_account.py | 4 +-- .../billing/models/billing_account_py3.py | 4 +-- .../models/billing_account_update_request.py | 4 +-- .../billing_account_update_request_py3.py | 4 +-- .../models/billing_management_client_enums.py | 30 +++++++++++++++++++ .../azure/mgmt/billing/models/document.py | 2 +- .../azure/mgmt/billing/models/document_py3.py | 2 +- .../azure/mgmt/billing/models/invoice.py | 2 +- .../azure/mgmt/billing/models/invoice_py3.py | 2 +- 10 files changed, 50 insertions(+), 12 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 4682c89f8cde..5d6c26f4d78e 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 @@ -161,6 +161,10 @@ ProductTransferStatus, EligibleProductType, SubscriptionTransferValidationErrorCode, + AgreementType, + CustomerType, + InvoiceStatus, + DocumentType, ProductStatusType, BillingFrequency, ProductTransferValidationErrorCode, @@ -257,6 +261,10 @@ 'ProductTransferStatus', 'EligibleProductType', 'SubscriptionTransferValidationErrorCode', + 'AgreementType', + 'CustomerType', + 'InvoiceStatus', + 'DocumentType', 'ProductStatusType', 'BillingFrequency', 'ProductTransferValidationErrorCode', diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py index db29f2c3383b..e3a2757fa268 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py @@ -31,10 +31,10 @@ class BillingAccount(Resource): :ivar agreement_type: The type of agreement. Possible values include: 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'MicrosoftOnlineServicesProgram' - :vartype agreement_type: str or ~azure.mgmt.billing.models.enum + :vartype agreement_type: str or ~azure.mgmt.billing.models.AgreementType :ivar customer_type: The type of customer. Possible values include: 'Enterprise', 'Individual', 'Partner' - :vartype customer_type: str or ~azure.mgmt.billing.models.enum + :vartype customer_type: str or ~azure.mgmt.billing.models.CustomerType :param billing_profiles: The billing profiles associated to the billing account. By default this is not populated, unless it's specified in $expand. diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py index 60bb6a4be0b5..e3cb16ddb50e 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py @@ -31,10 +31,10 @@ class BillingAccount(Resource): :ivar agreement_type: The type of agreement. Possible values include: 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'MicrosoftOnlineServicesProgram' - :vartype agreement_type: str or ~azure.mgmt.billing.models.enum + :vartype agreement_type: str or ~azure.mgmt.billing.models.AgreementType :ivar customer_type: The type of customer. Possible values include: 'Enterprise', 'Individual', 'Partner' - :vartype customer_type: str or ~azure.mgmt.billing.models.enum + :vartype customer_type: str or ~azure.mgmt.billing.models.CustomerType :param billing_profiles: The billing profiles associated to the billing account. By default this is not populated, unless it's specified in $expand. diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request.py index 77cb15b1f2db..82945e43c5e0 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request.py @@ -25,10 +25,10 @@ class BillingAccountUpdateRequest(Model): :ivar agreement_type: The type of agreement. Possible values include: 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'MicrosoftOnlineServicesProgram' - :vartype agreement_type: str or ~azure.mgmt.billing.models.enum + :vartype agreement_type: str or ~azure.mgmt.billing.models.AgreementType :ivar customer_type: The type of customer. Possible values include: 'Enterprise', 'Individual', 'Partner' - :vartype customer_type: str or ~azure.mgmt.billing.models.enum + :vartype customer_type: str or ~azure.mgmt.billing.models.CustomerType :param billing_profiles: The billing profiles associated to the billing account. By default this is not populated, unless it's specified in $expand. diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request_py3.py index f20e5609af2f..71bd583eb95b 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request_py3.py @@ -25,10 +25,10 @@ class BillingAccountUpdateRequest(Model): :ivar agreement_type: The type of agreement. Possible values include: 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'MicrosoftOnlineServicesProgram' - :vartype agreement_type: str or ~azure.mgmt.billing.models.enum + :vartype agreement_type: str or ~azure.mgmt.billing.models.AgreementType :ivar customer_type: The type of customer. Possible values include: 'Enterprise', 'Individual', 'Partner' - :vartype customer_type: str or ~azure.mgmt.billing.models.enum + :vartype customer_type: str or ~azure.mgmt.billing.models.CustomerType :param billing_profiles: The billing profiles associated to the billing account. By default this is not populated, unless it's specified in $expand. 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 75426eaedbbc..d261a13b3646 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 @@ -62,6 +62,36 @@ class SubscriptionTransferValidationErrorCode(str, Enum): not_available_for_destination_market = "NotAvailableForDestinationMarket" +class AgreementType(str, Enum): + + microsoft_customer_agreement = "MicrosoftCustomerAgreement" + enterprise_agreement = "EnterpriseAgreement" + microsoft_online_services_program = "MicrosoftOnlineServicesProgram" + + +class CustomerType(str, Enum): + + enterprise = "Enterprise" + individual = "Individual" + partner = "Partner" + + +class InvoiceStatus(str, Enum): + + past_due = "PastDue" + due = "Due" + paid = "Paid" + void = "Void" + + +class DocumentType(str, Enum): + + invoice = "Invoice" + void_note = "VoidNote" + receipt = "Receipt" + credit_note = "CreditNote" + + class ProductStatusType(str, Enum): active = "Active" diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document.py index 408c8032519e..7ab0b8866b26 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document.py @@ -20,7 +20,7 @@ class Document(Model): :ivar kind: Document type. Possible values include: 'Invoice', 'VoidNote', 'Receipt', 'CreditNote' - :vartype kind: str or ~azure.mgmt.billing.models.enum + :vartype kind: str or ~azure.mgmt.billing.models.DocumentType :ivar url: Document URL. :vartype url: str """ diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document_py3.py index af1f1422e524..0775ca7dc086 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document_py3.py @@ -20,7 +20,7 @@ class Document(Model): :ivar kind: Document type. Possible values include: 'Invoice', 'VoidNote', 'Receipt', 'CreditNote' - :vartype kind: str or ~azure.mgmt.billing.models.enum + :vartype kind: str or ~azure.mgmt.billing.models.DocumentType :ivar url: Document URL. :vartype url: str """ diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py index 919a2d0a2d67..46ec34f15a55 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py @@ -30,7 +30,7 @@ class Invoice(Resource): :vartype invoice_date: datetime :ivar status: Invoice status. Possible values include: 'PastDue', 'Due', 'Paid', 'Void' - :vartype status: str or ~azure.mgmt.billing.models.enum + :vartype status: str or ~azure.mgmt.billing.models.InvoiceStatus :ivar amount_due: Amount due. :vartype amount_due: ~azure.mgmt.billing.models.Amount :ivar billed_amount: Amount billed. diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py index d2b92d5f4162..b564e05d5a27 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py @@ -30,7 +30,7 @@ class Invoice(Resource): :vartype invoice_date: datetime :ivar status: Invoice status. Possible values include: 'PastDue', 'Due', 'Paid', 'Void' - :vartype status: str or ~azure.mgmt.billing.models.enum + :vartype status: str or ~azure.mgmt.billing.models.InvoiceStatus :ivar amount_due: Amount due. :vartype amount_due: ~azure.mgmt.billing.models.Amount :ivar billed_amount: Amount billed. From 0304e091861c342abb986e35c213ef34ff55c8a2 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 2 Aug 2019 23:32:39 +0000 Subject: [PATCH 12/18] Generated from d0721ddc7c577d30f8286ad1ce552c09affcca72 Incorporated review comments --- .../azure/mgmt/billing/operations/transactions_operations.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py index fdac62139fb6..b113bf635835 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py @@ -267,15 +267,13 @@ def list_by_invoice_section_name( list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transactions'} def get( - self, billing_account_name, billing_profile_name, invoice_section_name, transaction_name, start_date, end_date, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, transaction_name, start_date, end_date, custom_headers=None, raw=False, **operation_config): """Get the transaction. :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 invoice_section_name: InvoiceSection Id. - :type invoice_section_name: str :param transaction_name: Transaction name. :type transaction_name: str :param start_date: Start date @@ -298,7 +296,6 @@ def get( 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'), - 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), 'transactionName': self._serialize.url("transaction_name", transaction_name, 'str') } url = self._client.format_url(url, **path_format_arguments) From a47dfe9347b00b2f2861f953b7a339608244c55d Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 3 Aug 2019 00:05:19 +0000 Subject: [PATCH 13/18] Generated from 5091b5f1f0e8a217df5b395b6ff10a0fd0766e67 Fixed build errors Fixed build errors --- .../azure/mgmt/billing/operations/products_operations.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py index c829bf6999a7..da73ea5fd031 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py @@ -429,7 +429,7 @@ def update_auto_renew_by_billing_account_name( :raises: :class:`ErrorResponseException` """ - parameters = models.UpdateAutoRenewRequest(auto_renew=auto_renew) + body = models.UpdateAutoRenewRequest(auto_renew=auto_renew) # Construct URL url = self.update_auto_renew_by_billing_account_name.metadata['url'] @@ -455,7 +455,7 @@ def update_auto_renew_by_billing_account_name( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'UpdateAutoRenewRequest') + body_content = self._serialize.body(body, 'UpdateAutoRenewRequest') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) @@ -502,7 +502,7 @@ def update_auto_renew_by_invoice_section_name( :raises: :class:`ErrorResponseException` """ - parameters = models.UpdateAutoRenewRequest(auto_renew=auto_renew) + body = models.UpdateAutoRenewRequest(auto_renew=auto_renew) # Construct URL url = self.update_auto_renew_by_invoice_section_name.metadata['url'] @@ -530,7 +530,7 @@ def update_auto_renew_by_invoice_section_name( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'UpdateAutoRenewRequest') + body_content = self._serialize.body(body, 'UpdateAutoRenewRequest') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) From 6cc5bb994276bb1aa1f5966198dfcbe19cf7bc14 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 3 Aug 2019 00:31:12 +0000 Subject: [PATCH 14/18] Generated from 3559e48931a1b39939120514a3061ac5967e4488 Fixed build errors Fixed build errors --- .../azure/mgmt/billing/models/__init__.py | 6 +++--- .../mgmt/billing/models/{address.py => address_details.py} | 4 ++-- .../models/{address_py3.py => address_details_py3.py} | 4 ++-- .../azure/mgmt/billing/models/billing_account.py | 4 ++-- .../azure/mgmt/billing/models/billing_account_py3.py | 4 ++-- .../mgmt/billing/models/billing_account_update_request.py | 4 ++-- .../billing/models/billing_account_update_request_py3.py | 4 ++-- .../azure/mgmt/billing/models/billing_profile.py | 4 ++-- .../mgmt/billing/models/billing_profile_creation_request.py | 4 ++-- .../billing/models/billing_profile_creation_request_py3.py | 4 ++-- .../azure/mgmt/billing/models/billing_profile_py3.py | 4 ++-- .../azure/mgmt/billing/models/validate_address_response.py | 4 ++-- .../mgmt/billing/models/validate_address_response_py3.py | 4 ++-- .../azure/mgmt/billing/operations/address_operations.py | 4 ++-- 14 files changed, 29 insertions(+), 29 deletions(-) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{address.py => address_details.py} (96%) rename sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/{address_py3.py => address_details_py3.py} (96%) 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 5d6c26f4d78e..8262396dc255 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,7 +11,7 @@ try: from .initiate_transfer_request_py3 import InitiateTransferRequest - from .address_py3 import Address + from .address_details_py3 import AddressDetails from .validate_address_response_py3 import ValidateAddressResponse from .product_details_py3 import ProductDetails from .accept_transfer_request_py3 import AcceptTransferRequest @@ -80,7 +80,7 @@ from .line_of_credit_py3 import LineOfCredit except (SyntaxError, ImportError): from .initiate_transfer_request import InitiateTransferRequest - from .address import Address + from .address_details import AddressDetails from .validate_address_response import ValidateAddressResponse from .product_details import ProductDetails from .accept_transfer_request import AcceptTransferRequest @@ -181,7 +181,7 @@ __all__ = [ 'InitiateTransferRequest', - 'Address', + 'AddressDetails', 'ValidateAddressResponse', 'ProductDetails', 'AcceptTransferRequest', diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_details.py similarity index 96% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_details.py index 062465328263..482bb0977023 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_details.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class Address(Model): +class AddressDetails(Model): """Address details. :param first_name: First Name. @@ -51,7 +51,7 @@ class Address(Model): } def __init__(self, **kwargs): - super(Address, self).__init__(**kwargs) + super(AddressDetails, self).__init__(**kwargs) self.first_name = kwargs.get('first_name', None) self.last_name = kwargs.get('last_name', None) self.company_name = kwargs.get('company_name', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_details_py3.py similarity index 96% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_py3.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_details_py3.py index df46f07863f2..5c588a787a1e 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_details_py3.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class Address(Model): +class AddressDetails(Model): """Address details. :param first_name: First Name. @@ -51,7 +51,7 @@ class Address(Model): } def __init__(self, *, first_name: str=None, last_name: str=None, company_name: str=None, address_line1: str=None, address_line2: str=None, address_line3: str=None, city: str=None, region: str=None, country: str=None, postal_code: str=None, **kwargs) -> None: - super(Address, self).__init__(**kwargs) + super(AddressDetails, self).__init__(**kwargs) self.first_name = first_name self.last_name = last_name self.company_name = company_name diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py index e3a2757fa268..16a130bce1d6 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py @@ -27,7 +27,7 @@ class BillingAccount(Resource): :ivar display_name: The billing account name. :vartype display_name: str :param address: The address associated with billing account. - :type address: ~azure.mgmt.billing.models.Address + :type address: ~azure.mgmt.billing.models.AddressDetails :ivar agreement_type: The type of agreement. Possible values include: 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'MicrosoftOnlineServicesProgram' @@ -68,7 +68,7 @@ class BillingAccount(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'address': {'key': 'properties.address', 'type': 'Address'}, + 'address': {'key': 'properties.address', 'type': 'AddressDetails'}, 'agreement_type': {'key': 'properties.agreementType', 'type': 'str'}, 'customer_type': {'key': 'properties.customerType', 'type': 'str'}, 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py index e3cb16ddb50e..952411134ac6 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py @@ -27,7 +27,7 @@ class BillingAccount(Resource): :ivar display_name: The billing account name. :vartype display_name: str :param address: The address associated with billing account. - :type address: ~azure.mgmt.billing.models.Address + :type address: ~azure.mgmt.billing.models.AddressDetails :ivar agreement_type: The type of agreement. Possible values include: 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'MicrosoftOnlineServicesProgram' @@ -68,7 +68,7 @@ class BillingAccount(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'address': {'key': 'properties.address', 'type': 'Address'}, + 'address': {'key': 'properties.address', 'type': 'AddressDetails'}, 'agreement_type': {'key': 'properties.agreementType', 'type': 'str'}, 'customer_type': {'key': 'properties.customerType', 'type': 'str'}, 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request.py index 82945e43c5e0..4640cd3ace9b 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request.py @@ -21,7 +21,7 @@ class BillingAccountUpdateRequest(Model): :ivar display_name: The billing account name. :vartype display_name: str :param address: The address associated with billing account. - :type address: ~azure.mgmt.billing.models.Address + :type address: ~azure.mgmt.billing.models.AddressDetails :ivar agreement_type: The type of agreement. Possible values include: 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'MicrosoftOnlineServicesProgram' @@ -56,7 +56,7 @@ class BillingAccountUpdateRequest(Model): _attribute_map = { 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'address': {'key': 'properties.address', 'type': 'Address'}, + 'address': {'key': 'properties.address', 'type': 'AddressDetails'}, 'agreement_type': {'key': 'properties.agreementType', 'type': 'str'}, 'customer_type': {'key': 'properties.customerType', 'type': 'str'}, 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request_py3.py index 71bd583eb95b..66743e347ee1 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request_py3.py @@ -21,7 +21,7 @@ class BillingAccountUpdateRequest(Model): :ivar display_name: The billing account name. :vartype display_name: str :param address: The address associated with billing account. - :type address: ~azure.mgmt.billing.models.Address + :type address: ~azure.mgmt.billing.models.AddressDetails :ivar agreement_type: The type of agreement. Possible values include: 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'MicrosoftOnlineServicesProgram' @@ -56,7 +56,7 @@ class BillingAccountUpdateRequest(Model): _attribute_map = { 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'address': {'key': 'properties.address', 'type': 'Address'}, + 'address': {'key': 'properties.address', 'type': 'AddressDetails'}, 'agreement_type': {'key': 'properties.agreementType', 'type': 'str'}, 'customer_type': {'key': 'properties.customerType', 'type': 'str'}, 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py index f7f0e0178443..8b8100a4641c 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py @@ -29,7 +29,7 @@ class BillingProfile(Resource): :param po_number: Purchase order number. :type po_number: str :param address: Billing address. - :type address: ~azure.mgmt.billing.models.Address + :type address: ~azure.mgmt.billing.models.AddressDetails :ivar invoice_email_opt_in: If the billing profile is opted in to receive invoices via email. :vartype invoice_email_opt_in: bool @@ -59,7 +59,7 @@ class BillingProfile(Resource): 'type': {'key': 'type', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'po_number': {'key': 'properties.poNumber', 'type': 'str'}, - 'address': {'key': 'properties.address', 'type': 'Address'}, + 'address': {'key': 'properties.address', 'type': 'AddressDetails'}, 'invoice_email_opt_in': {'key': 'properties.invoiceEmailOptIn', 'type': 'bool'}, 'invoice_day': {'key': 'properties.invoiceDay', 'type': 'int'}, 'currency': {'key': 'properties.currency', 'type': 'str'}, diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request.py index a091c6b6d460..1da011a5243f 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request.py @@ -20,7 +20,7 @@ class BillingProfileCreationRequest(Model): :param po_number: Purchase order number. :type po_number: str :param address: Billing address. - :type address: ~azure.mgmt.billing.models.Address + :type address: ~azure.mgmt.billing.models.AddressDetails :param invoice_email_opt_in: If the billing profile is opted in to receive invoices via email. :type invoice_email_opt_in: bool @@ -31,7 +31,7 @@ class BillingProfileCreationRequest(Model): _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'po_number': {'key': 'poNumber', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'Address'}, + 'address': {'key': 'address', 'type': 'AddressDetails'}, 'invoice_email_opt_in': {'key': 'invoiceEmailOptIn', 'type': 'bool'}, 'enabled_azure_plans': {'key': 'enabledAzurePlans', 'type': '[AzurePlan]'}, } diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request_py3.py index 4ca235650906..b6e47446e5d5 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request_py3.py @@ -20,7 +20,7 @@ class BillingProfileCreationRequest(Model): :param po_number: Purchase order number. :type po_number: str :param address: Billing address. - :type address: ~azure.mgmt.billing.models.Address + :type address: ~azure.mgmt.billing.models.AddressDetails :param invoice_email_opt_in: If the billing profile is opted in to receive invoices via email. :type invoice_email_opt_in: bool @@ -31,7 +31,7 @@ class BillingProfileCreationRequest(Model): _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'po_number': {'key': 'poNumber', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'Address'}, + 'address': {'key': 'address', 'type': 'AddressDetails'}, 'invoice_email_opt_in': {'key': 'invoiceEmailOptIn', 'type': 'bool'}, 'enabled_azure_plans': {'key': 'enabledAzurePlans', 'type': '[AzurePlan]'}, } diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py index d5263e090b5a..4becac1c070e 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py @@ -29,7 +29,7 @@ class BillingProfile(Resource): :param po_number: Purchase order number. :type po_number: str :param address: Billing address. - :type address: ~azure.mgmt.billing.models.Address + :type address: ~azure.mgmt.billing.models.AddressDetails :ivar invoice_email_opt_in: If the billing profile is opted in to receive invoices via email. :vartype invoice_email_opt_in: bool @@ -59,7 +59,7 @@ class BillingProfile(Resource): 'type': {'key': 'type', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'po_number': {'key': 'properties.poNumber', 'type': 'str'}, - 'address': {'key': 'properties.address', 'type': 'Address'}, + 'address': {'key': 'properties.address', 'type': 'AddressDetails'}, 'invoice_email_opt_in': {'key': 'properties.invoiceEmailOptIn', 'type': 'bool'}, 'invoice_day': {'key': 'properties.invoiceDay', 'type': 'int'}, 'currency': {'key': 'properties.currency', 'type': 'str'}, 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 index 387605d5e931..2ec17fe1e0c6 100644 --- 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 @@ -19,14 +19,14 @@ class ValidateAddressResponse(Model): '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] + :type suggested_addresses: list[~azure.mgmt.billing.models.AddressDetails] :param validation_message: Validation error message. :type validation_message: str """ _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, - 'suggested_addresses': {'key': 'suggestedAddresses', 'type': '[Address]'}, + 'suggested_addresses': {'key': 'suggestedAddresses', 'type': '[AddressDetails]'}, 'validation_message': {'key': 'validationMessage', 'type': 'str'}, } 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 index 9e01d7871ec4..8fb0a294a607 100644 --- 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 @@ -19,14 +19,14 @@ class ValidateAddressResponse(Model): '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] + :type suggested_addresses: list[~azure.mgmt.billing.models.AddressDetails] :param validation_message: Validation error message. :type validation_message: str """ _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, - 'suggested_addresses': {'key': 'suggestedAddresses', 'type': '[Address]'}, + 'suggested_addresses': {'key': 'suggestedAddresses', 'type': '[AddressDetails]'}, 'validation_message': {'key': 'validationMessage', 'type': 'str'}, } diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/address_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/address_operations.py index 26944451d4c5..8406fa17e200 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/address_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/address_operations.py @@ -41,7 +41,7 @@ def validate( """Validates the address. :param address: - :type address: ~azure.mgmt.billing.models.Address + :type address: ~azure.mgmt.billing.models.AddressDetails :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -72,7 +72,7 @@ def validate( 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') + body_content = self._serialize.body(address, 'AddressDetails') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) From 5e385bbfbeab8149075c9536282961191614ab11 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 3 Aug 2019 00:47:11 +0000 Subject: [PATCH 15/18] Generated from a30934cc61a460b5f57b8b63e27de5eda2471b81 Updated BillingRoleAssignments actions Updated BillingRoleAssignments actions --- .../operations/billing_role_assignments_operations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py index 7deb7df6ced3..9268b1bdd766 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py @@ -539,7 +539,7 @@ def add_by_billing_account_name( return client_raw_response return deserialized - add_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments'} + add_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/createBillingRoleAssignment'} def list_by_invoice_section_name( self, billing_account_name, billing_profile_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): @@ -678,7 +678,7 @@ def add_by_invoice_section_name( return client_raw_response return deserialized - add_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments'} + add_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/createBillingRoleAssignment'} def list_by_billing_profile_name( self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): @@ -811,4 +811,4 @@ def add_by_billing_profile_name( return client_raw_response return deserialized - add_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments'} + add_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/createBillingRoleAssignment'} From c8aa83c3cec9eb2654bcaca3a51f999f16c9b8e8 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 3 Aug 2019 02:45:56 +0000 Subject: [PATCH 16/18] Generated from 09cbd07fe21dc46ceeca0ebd07deb6138f72d74d Added Transfer apis for partner led Added Transfer apis for partner led --- .../mgmt/billing/billing_management_client.py | 10 + .../models/initiate_transfer_request.py | 4 + .../models/initiate_transfer_request_py3.py | 6 +- .../models/recipient_transfer_details.py | 15 ++ .../models/recipient_transfer_details_py3.py | 15 ++ .../mgmt/billing/models/transfer_details.py | 15 ++ .../billing/models/transfer_details_py3.py | 15 ++ .../azure/mgmt/billing/operations/__init__.py | 4 + .../partner_transfers_operations.py | 237 ++++++++++++++++++ .../partner_transfers_transfers_operations.py | 105 ++++++++ .../operations/transfers_operations.py | 6 +- 11 files changed, 429 insertions(+), 3 deletions(-) create mode 100644 sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/partner_transfers_operations.py create mode 100644 sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/partner_transfers_transfers_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 4506fcba2412..846f1ba24dce 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 @@ -29,6 +29,8 @@ from .operations.policies_operations import PoliciesOperations from .operations.billing_property_operations import BillingPropertyOperations from .operations.transfers_operations import TransfersOperations +from .operations.partner_transfers_operations import PartnerTransfersOperations +from .operations.partner_transfers_transfers_operations import PartnerTransfersTransfersOperations from .operations.recipient_transfers_operations import RecipientTransfersOperations from .operations.operations import Operations from .operations.billing_permissions_operations import BillingPermissionsOperations @@ -109,6 +111,10 @@ class BillingManagementClient(SDKClient): :vartype billing_property: azure.mgmt.billing.operations.BillingPropertyOperations :ivar transfers: Transfers operations :vartype transfers: azure.mgmt.billing.operations.TransfersOperations + :ivar partner_transfers: PartnerTransfers operations + :vartype partner_transfers: azure.mgmt.billing.operations.PartnerTransfersOperations + :ivar partner_transfers_transfers: PartnerTransfersTransfers operations + :vartype partner_transfers_transfers: azure.mgmt.billing.operations.PartnerTransfersTransfersOperations :ivar recipient_transfers: RecipientTransfers operations :vartype recipient_transfers: azure.mgmt.billing.operations.RecipientTransfersOperations :ivar operations: Operations operations @@ -175,6 +181,10 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.transfers = TransfersOperations( self._client, self.config, self._serialize, self._deserialize) + self.partner_transfers = PartnerTransfersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.partner_transfers_transfers = PartnerTransfersTransfersOperations( + self._client, self.config, self._serialize, self._deserialize) self.recipient_transfers = RecipientTransfersOperations( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py index 251289645390..f973636f1bed 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py @@ -17,12 +17,16 @@ class InitiateTransferRequest(Model): :param recipient_email_id: Email Id of recipient for transfer. :type recipient_email_id: str + :param reseller_id: Optional reseller Id for transfer. + :type reseller_id: str """ _attribute_map = { 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, + 'reseller_id': {'key': 'properties.resellerId', 'type': 'str'}, } def __init__(self, **kwargs): super(InitiateTransferRequest, self).__init__(**kwargs) self.recipient_email_id = kwargs.get('recipient_email_id', None) + self.reseller_id = kwargs.get('reseller_id', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py index 9547d5971a5c..9e66f618c29e 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py @@ -17,12 +17,16 @@ class InitiateTransferRequest(Model): :param recipient_email_id: Email Id of recipient for transfer. :type recipient_email_id: str + :param reseller_id: Optional reseller Id for transfer. + :type reseller_id: str """ _attribute_map = { 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, + 'reseller_id': {'key': 'properties.resellerId', 'type': 'str'}, } - def __init__(self, *, recipient_email_id: str=None, **kwargs) -> None: + def __init__(self, *, recipient_email_id: str=None, reseller_id: str=None, **kwargs) -> None: super(InitiateTransferRequest, self).__init__(**kwargs) self.recipient_email_id = recipient_email_id + self.reseller_id = reseller_id diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py index d354dbc6a36a..294905389363 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py @@ -33,6 +33,12 @@ class RecipientTransferDetails(Model): :vartype recipient_email_id: str :ivar initiator_email_id: Email Id of initiator of transfer. :vartype initiator_email_id: str + :ivar reseller_id: Reseller Id for transfer. + :vartype reseller_id: str + :ivar reseller_name: Reseller name for transfer. + :vartype reseller_name: str + :ivar initiator_customer_type: Customer type of the initiator. + :vartype initiator_customer_type: str :ivar canceled_by: Email Id who user canceled the transfer. :vartype canceled_by: str :ivar last_modified_time: Transfer last modification time. @@ -49,6 +55,9 @@ class RecipientTransferDetails(Model): 'transfer_status': {'readonly': True}, 'recipient_email_id': {'readonly': True}, 'initiator_email_id': {'readonly': True}, + 'reseller_id': {'readonly': True}, + 'reseller_name': {'readonly': True}, + 'initiator_customer_type': {'readonly': True}, 'canceled_by': {'readonly': True}, 'last_modified_time': {'readonly': True}, 'detailed_transfer_status': {'readonly': True}, @@ -61,6 +70,9 @@ class RecipientTransferDetails(Model): 'transfer_status': {'key': 'properties.transferStatus', 'type': 'str'}, 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, 'initiator_email_id': {'key': 'properties.initiatorEmailId', 'type': 'str'}, + 'reseller_id': {'key': 'properties.resellerId', 'type': 'str'}, + 'reseller_name': {'key': 'properties.resellerName', 'type': 'str'}, + 'initiator_customer_type': {'key': 'properties.initiatorCustomerType', 'type': 'str'}, 'canceled_by': {'key': 'properties.canceledBy', 'type': 'str'}, 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, 'detailed_transfer_status': {'key': 'properties.detailedTransferStatus', 'type': '[DetailedTransferStatus]'}, @@ -74,6 +86,9 @@ def __init__(self, **kwargs): self.transfer_status = None self.recipient_email_id = None self.initiator_email_id = None + self.reseller_id = None + self.reseller_name = None + self.initiator_customer_type = None self.canceled_by = None self.last_modified_time = None self.detailed_transfer_status = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py index 90fcfe2ab2fc..189d600f1e12 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py @@ -33,6 +33,12 @@ class RecipientTransferDetails(Model): :vartype recipient_email_id: str :ivar initiator_email_id: Email Id of initiator of transfer. :vartype initiator_email_id: str + :ivar reseller_id: Reseller Id for transfer. + :vartype reseller_id: str + :ivar reseller_name: Reseller name for transfer. + :vartype reseller_name: str + :ivar initiator_customer_type: Customer type of the initiator. + :vartype initiator_customer_type: str :ivar canceled_by: Email Id who user canceled the transfer. :vartype canceled_by: str :ivar last_modified_time: Transfer last modification time. @@ -49,6 +55,9 @@ class RecipientTransferDetails(Model): 'transfer_status': {'readonly': True}, 'recipient_email_id': {'readonly': True}, 'initiator_email_id': {'readonly': True}, + 'reseller_id': {'readonly': True}, + 'reseller_name': {'readonly': True}, + 'initiator_customer_type': {'readonly': True}, 'canceled_by': {'readonly': True}, 'last_modified_time': {'readonly': True}, 'detailed_transfer_status': {'readonly': True}, @@ -61,6 +70,9 @@ class RecipientTransferDetails(Model): 'transfer_status': {'key': 'properties.transferStatus', 'type': 'str'}, 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, 'initiator_email_id': {'key': 'properties.initiatorEmailId', 'type': 'str'}, + 'reseller_id': {'key': 'properties.resellerId', 'type': 'str'}, + 'reseller_name': {'key': 'properties.resellerName', 'type': 'str'}, + 'initiator_customer_type': {'key': 'properties.initiatorCustomerType', 'type': 'str'}, 'canceled_by': {'key': 'properties.canceledBy', 'type': 'str'}, 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, 'detailed_transfer_status': {'key': 'properties.detailedTransferStatus', 'type': '[DetailedTransferStatus]'}, @@ -74,6 +86,9 @@ def __init__(self, **kwargs) -> None: self.transfer_status = None self.recipient_email_id = None self.initiator_email_id = None + self.reseller_id = None + self.reseller_name = None + self.initiator_customer_type = None self.canceled_by = None self.last_modified_time = None self.detailed_transfer_status = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py index 8d60c4cfa092..736d836b3b48 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py @@ -26,6 +26,12 @@ class TransferDetails(Model): :vartype invoice_section_id: str :ivar billing_account_id: Target billing account Id. :vartype billing_account_id: str + :ivar reseller_id: Reseller Id for transfer. + :vartype reseller_id: str + :ivar reseller_name: Reseller name for transfer. + :vartype reseller_name: str + :ivar initiator_customer_type: Customer type of the initiator. + :vartype initiator_customer_type: str :ivar billing_profile_id: Target billing profile Id. :vartype billing_profile_id: str :ivar transfer_status: Overall transfer status. Possible values include: @@ -50,6 +56,9 @@ class TransferDetails(Model): 'expiration_time': {'readonly': True}, 'invoice_section_id': {'readonly': True}, 'billing_account_id': {'readonly': True}, + 'reseller_id': {'readonly': True}, + 'reseller_name': {'readonly': True}, + 'initiator_customer_type': {'readonly': True}, 'billing_profile_id': {'readonly': True}, 'transfer_status': {'readonly': True}, 'recipient_email_id': {'readonly': True}, @@ -64,6 +73,9 @@ class TransferDetails(Model): 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, + 'reseller_id': {'key': 'properties.resellerId', 'type': 'str'}, + 'reseller_name': {'key': 'properties.resellerName', 'type': 'str'}, + 'initiator_customer_type': {'key': 'properties.initiatorCustomerType', 'type': 'str'}, 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, 'transfer_status': {'key': 'properties.transferStatus', 'type': 'str'}, 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, @@ -79,6 +91,9 @@ def __init__(self, **kwargs): self.expiration_time = None self.invoice_section_id = None self.billing_account_id = None + self.reseller_id = None + self.reseller_name = None + self.initiator_customer_type = None self.billing_profile_id = None self.transfer_status = None self.recipient_email_id = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py index 5231d9d916e8..c2f092c861c0 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py @@ -26,6 +26,12 @@ class TransferDetails(Model): :vartype invoice_section_id: str :ivar billing_account_id: Target billing account Id. :vartype billing_account_id: str + :ivar reseller_id: Reseller Id for transfer. + :vartype reseller_id: str + :ivar reseller_name: Reseller name for transfer. + :vartype reseller_name: str + :ivar initiator_customer_type: Customer type of the initiator. + :vartype initiator_customer_type: str :ivar billing_profile_id: Target billing profile Id. :vartype billing_profile_id: str :ivar transfer_status: Overall transfer status. Possible values include: @@ -50,6 +56,9 @@ class TransferDetails(Model): 'expiration_time': {'readonly': True}, 'invoice_section_id': {'readonly': True}, 'billing_account_id': {'readonly': True}, + 'reseller_id': {'readonly': True}, + 'reseller_name': {'readonly': True}, + 'initiator_customer_type': {'readonly': True}, 'billing_profile_id': {'readonly': True}, 'transfer_status': {'readonly': True}, 'recipient_email_id': {'readonly': True}, @@ -64,6 +73,9 @@ class TransferDetails(Model): 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, + 'reseller_id': {'key': 'properties.resellerId', 'type': 'str'}, + 'reseller_name': {'key': 'properties.resellerName', 'type': 'str'}, + 'initiator_customer_type': {'key': 'properties.initiatorCustomerType', 'type': 'str'}, 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, 'transfer_status': {'key': 'properties.transferStatus', 'type': 'str'}, 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, @@ -79,6 +91,9 @@ def __init__(self, **kwargs) -> None: self.expiration_time = None self.invoice_section_id = None self.billing_account_id = None + self.reseller_id = None + self.reseller_name = None + self.initiator_customer_type = None self.billing_profile_id = None self.transfer_status = None self.recipient_email_id = 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 da39667d8041..c95b14cbb6a4 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 @@ -25,6 +25,8 @@ from .policies_operations import PoliciesOperations from .billing_property_operations import BillingPropertyOperations from .transfers_operations import TransfersOperations +from .partner_transfers_operations import PartnerTransfersOperations +from .partner_transfers_transfers_operations import PartnerTransfersTransfersOperations from .recipient_transfers_operations import RecipientTransfersOperations from .operations import Operations from .billing_permissions_operations import BillingPermissionsOperations @@ -50,6 +52,8 @@ 'PoliciesOperations', 'BillingPropertyOperations', 'TransfersOperations', + 'PartnerTransfersOperations', + 'PartnerTransfersTransfersOperations', 'RecipientTransfersOperations', 'Operations', 'BillingPermissionsOperations', diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/partner_transfers_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/partner_transfers_operations.py new file mode 100644 index 000000000000..9d1bbc10f077 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/partner_transfers_operations.py @@ -0,0 +1,237 @@ +# 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 PartnerTransfersOperations(object): + """PartnerTransfersOperations 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. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def initiate( + self, billing_account_name, billing_profile_name, customer_name, recipient_email_id=None, reseller_id=None, custom_headers=None, raw=False, **operation_config): + """Initiates the request to transfer the legacy subscriptions or RIs. + + :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 customer_name: Customer name. + :type customer_name: str + :param recipient_email_id: Email Id of recipient for transfer. + :type recipient_email_id: str + :param reseller_id: Optional reseller Id for transfer. + :type reseller_id: 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: TransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.InitiateTransferRequest(recipient_email_id=recipient_email_id, reseller_id=reseller_id) + + # Construct URL + url = self.initiate.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'), + 'customerName': self._serialize.url("customer_name", customer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # 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(parameters, 'InitiateTransferRequest') + + # 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('TransferDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + initiate.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/initiateTransfer'} + + def get( + self, billing_account_name, billing_profile_name, customer_name, transfer_name, custom_headers=None, raw=False, **operation_config): + """Gets the transfer details for given transfer Id. + + :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 customer_name: Customer name. + :type customer_name: str + :param transfer_name: Transfer Name. + :type transfer_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`. + :return: TransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.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'), + 'customerName': self._serialize.url("customer_name", customer_name, 'str'), + 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + 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) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransferDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/transfers/{transferName}'} + + def cancel( + self, billing_account_name, billing_profile_name, customer_name, transfer_name, custom_headers=None, raw=False, **operation_config): + """Cancels the transfer for given transfer Id. + + :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 customer_name: Customer name. + :type customer_name: str + :param transfer_name: Transfer Name. + :type transfer_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`. + :return: TransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.cancel.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'), + 'customerName': self._serialize.url("customer_name", customer_name, 'str'), + 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + 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.delete(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('TransferDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + cancel.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/transfers/{transferName}'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/partner_transfers_transfers_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/partner_transfers_transfers_operations.py new file mode 100644 index 000000000000..98cd89aa354d --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/partner_transfers_transfers_operations.py @@ -0,0 +1,105 @@ +# 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 PartnerTransfersTransfersOperations(object): + """PartnerTransfersTransfersOperations 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. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def list( + self, billing_account_name, billing_profile_name, customer_name, custom_headers=None, raw=False, **operation_config): + """Lists all transfer's details initiated from given invoice section. + + :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 customer_name: Customer name. + :type customer_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`. + :return: An iterator like instance of TransferDetails + :rtype: + ~azure.mgmt.billing.models.TransferDetailsPaged[~azure.mgmt.billing.models.TransferDetails] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # 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'), + 'customerName': self._serialize.url("customer_name", customer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + 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.TransferDetailsPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TransferDetailsPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/transfers'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py index 8bcf950440ff..d9d1ac6c0c87 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def initiate( - self, billing_account_name, billing_profile_name, invoice_section_name, recipient_email_id=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, recipient_email_id=None, reseller_id=None, custom_headers=None, raw=False, **operation_config): """Initiates the request to transfer the legacy subscriptions or RIs. :param billing_account_name: billing Account Id. @@ -46,6 +46,8 @@ def initiate( :type invoice_section_name: str :param recipient_email_id: Email Id of recipient for transfer. :type recipient_email_id: str + :param reseller_id: Optional reseller Id for transfer. + :type reseller_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -57,7 +59,7 @@ def initiate( :raises: :class:`ErrorResponseException` """ - parameters = models.InitiateTransferRequest(recipient_email_id=recipient_email_id) + parameters = models.InitiateTransferRequest(recipient_email_id=recipient_email_id, reseller_id=reseller_id) # Construct URL url = self.initiate.metadata['url'] From e9bcb28ae6371127da17a985a066f1ba50c3bc29 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 3 Aug 2019 11:53:19 +0000 Subject: [PATCH 17/18] Generated from be18185f872a258d97270fa97a93e77e9da6478f Removing listInvoiceSectionsWithCreateSubscriptionPermission Removing listInvoiceSectionsWithCreateSubscriptionPermission --- .../operations/invoice_sections_operations.py | 61 ------------------- 1 file changed, 61 deletions(-) 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 575ec3c9c1ff..f3778c2be022 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 @@ -98,67 +98,6 @@ def list_by_billing_profile_name( return deserialized list_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections'} - def list_by_create_subscription_permission( - self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): - """Lists all invoiceSections with create subscription permission for a - user. - - :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 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: InvoiceSectionListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.InvoiceSectionListResult or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_by_create_subscription_permission.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') - - # 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.post(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('InvoiceSectionListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_by_create_subscription_permission.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/listInvoiceSectionsWithCreateSubscriptionPermission'} - def get( self, billing_account_name, billing_profile_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): """Get the InvoiceSection by id. From 8f7ca6c9a208586ee8f6c4d32fdc27f3e13f927a Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 5 Aug 2019 06:54:24 +0000 Subject: [PATCH 18/18] Generated from 1527d6f586844418db402545d7c692cbe0e06c7d Removed unused property, billing profile id is not required in the request body --- .../billing/models/invoice_section_creation_request.py | 4 ---- .../models/invoice_section_creation_request_py3.py | 6 +----- .../billing/operations/invoice_sections_operations.py | 9 +++------ 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_creation_request.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_creation_request.py index d6426a0c567d..e7339f87d4aa 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_creation_request.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_creation_request.py @@ -17,16 +17,12 @@ class InvoiceSectionCreationRequest(Model): :param display_name: The name of the InvoiceSection. :type display_name: str - :param billing_profile_id: The billing profile id. - :type billing_profile_id: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, - 'billing_profile_id': {'key': 'billingProfileId', 'type': 'str'}, } def __init__(self, **kwargs): super(InvoiceSectionCreationRequest, self).__init__(**kwargs) self.display_name = kwargs.get('display_name', None) - self.billing_profile_id = kwargs.get('billing_profile_id', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_creation_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_creation_request_py3.py index 913815f31cc0..b355141f09b0 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_creation_request_py3.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_creation_request_py3.py @@ -17,16 +17,12 @@ class InvoiceSectionCreationRequest(Model): :param display_name: The name of the InvoiceSection. :type display_name: str - :param billing_profile_id: The billing profile id. - :type billing_profile_id: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, - 'billing_profile_id': {'key': 'billingProfileId', 'type': 'str'}, } - def __init__(self, *, display_name: str=None, billing_profile_id: str=None, **kwargs) -> None: + def __init__(self, *, display_name: str=None, **kwargs) -> None: super(InvoiceSectionCreationRequest, self).__init__(**kwargs) self.display_name = display_name - self.billing_profile_id = billing_profile_id 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 f3778c2be022..b2ce85ebd58c 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 @@ -163,8 +163,8 @@ def get( def _create_initial( - self, billing_account_name, billing_profile_name, invoice_section_name, display_name=None, billing_profile_id=None, custom_headers=None, raw=False, **operation_config): - parameters = models.InvoiceSectionCreationRequest(display_name=display_name, billing_profile_id=billing_profile_id) + self, billing_account_name, billing_profile_name, invoice_section_name, display_name=None, custom_headers=None, raw=False, **operation_config): + parameters = models.InvoiceSectionCreationRequest(display_name=display_name) # Construct URL url = self.create.metadata['url'] @@ -218,7 +218,7 @@ def _create_initial( return deserialized def create( - self, billing_account_name, billing_profile_name, invoice_section_name, display_name=None, billing_profile_id=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, billing_account_name, billing_profile_name, invoice_section_name, display_name=None, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to create an invoice section. :param billing_account_name: billing Account Id. @@ -229,8 +229,6 @@ def create( :type invoice_section_name: str :param display_name: The name of the InvoiceSection. :type display_name: str - :param billing_profile_id: The billing profile id. - :type billing_profile_id: str :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 @@ -250,7 +248,6 @@ def create( billing_profile_name=billing_profile_name, invoice_section_name=invoice_section_name, display_name=display_name, - billing_profile_id=billing_profile_id, custom_headers=custom_headers, raw=True, **operation_config