From 985979ce359cc14ec5d06ab484512b6e9d36184f Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 19 Mar 2019 20:34:56 +0000 Subject: [PATCH 1/8] Generated from 8745db772f6c09718c39873dd39f84cb96266c28 Separate StatusType enums. --- .../mgmt/billing/billing_management_client.py | 354 +++++++++++++++++- .../azure/mgmt/billing/models/__init__.py | 150 +++++++- .../azure/mgmt/billing/models/address.py | 64 ++++ .../azure/mgmt/billing/models/address_py3.py | 64 ++++ .../azure/mgmt/billing/models/amount.py | 40 ++ .../azure/mgmt/billing/models/amount_py3.py | 40 ++ .../mgmt/billing/models/billing_account.py | 93 +++++ .../models/billing_account_list_result.py | 40 ++ .../models/billing_account_list_result_py3.py | 40 ++ .../billing/models/billing_account_py3.py | 93 +++++ .../models/billing_management_client_enums.py | 64 ++++ .../mgmt/billing/models/billing_period_py3.py | 59 --- .../mgmt/billing/models/billing_profile.py | 85 +++++ .../models/billing_profile_list_result.py | 40 ++ .../models/billing_profile_list_result_py3.py | 40 ++ .../billing/models/billing_profile_py3.py | 85 +++++ .../mgmt/billing/models/billing_property.py | 80 ++++ .../billing/models/billing_property_py3.py | 80 ++++ .../models/billing_subscription_summary.py | 95 +++++ ... => billing_subscription_summary_paged.py} | 8 +- .../billing_subscription_summary_py3.py | 95 +++++ .../billing_subscriptions_list_result.py | 41 ++ .../billing_subscriptions_list_result_py3.py | 41 ++ .../azure/mgmt/billing/models/department.py | 60 +++ .../billing/models/department_list_result.py | 40 ++ .../models/department_list_result_py3.py | 40 ++ .../mgmt/billing/models/department_py3.py | 60 +++ .../billing/models/download_properties.py | 41 ++ .../billing/models/download_properties_py3.py | 41 ++ .../azure/mgmt/billing/models/download_url.py | 2 +- .../mgmt/billing/models/download_url_py3.py | 2 +- .../billing/models/enabled_azure_sk_us.py | 39 ++ .../billing/models/enabled_azure_sk_us_py3.py | 39 ++ .../azure/mgmt/billing/models/enrollment.py | 73 ++++ .../mgmt/billing/models/enrollment_account.py | 36 +- .../models/enrollment_account_context.py | 40 ++ .../models/enrollment_account_context_py3.py | 40 ++ .../models/enrollment_account_list_result.py | 40 ++ .../enrollment_account_list_result_py3.py | 40 ++ .../billing/models/enrollment_account_py3.py | 38 +- .../billing/models/enrollment_policies.py | 53 +++ .../billing/models/enrollment_policies_py3.py | 53 +++ .../mgmt/billing/models/enrollment_py3.py | 73 ++++ .../azure/mgmt/billing/models/invoice.py | 65 ---- .../billing/models/invoice_list_result.py | 40 ++ .../billing/models/invoice_list_result_py3.py | 40 ++ .../azure/mgmt/billing/models/invoice_py3.py | 65 ---- .../{billing_period.py => invoice_section.py} | 32 +- .../models/invoice_section_list_result.py | 40 ++ .../models/invoice_section_list_result_py3.py | 40 ++ .../models/invoice_section_properties.py | 33 ++ .../models/invoice_section_properties_py3.py | 33 ++ .../billing/models/invoice_section_py3.py | 51 +++ .../mgmt/billing/models/invoice_summary.py | 105 ++++++ .../billing/models/invoice_summary_py3.py | 105 ++++++ .../mgmt/billing/models/operation_status.py | 43 +++ .../billing/models/operation_status_py3.py | 43 +++ .../mgmt/billing/models/payment_method.py | 62 +++ ...voice_paged.py => payment_method_paged.py} | 8 +- .../mgmt/billing/models/payment_method_py3.py | 62 +++ .../mgmt/billing/models/payment_properties.py | 45 +++ .../billing/models/payment_properties_py3.py | 45 +++ .../azure/mgmt/billing/models/policy.py | 52 +++ .../azure/mgmt/billing/models/policy_py3.py | 52 +++ .../mgmt/billing/models/product_summary.py | 138 +++++++ ...ount_paged.py => product_summary_paged.py} | 8 +- .../billing/models/product_summary_py3.py | 138 +++++++ .../billing/models/products_list_result.py | 41 ++ .../models/products_list_result_py3.py | 41 ++ .../models/transactions_list_result.py | 40 ++ .../models/transactions_list_result_py3.py | 40 ++ .../billing/models/transactions_summary.py | 131 +++++++ .../models/transactions_summary_paged.py | 27 ++ .../models/transactions_summary_py3.py | 131 +++++++ .../transfer_billing_subscription_request.py | 28 ++ ...billing_subscription_request_properties.py | 28 ++ ...ing_subscription_request_properties_py3.py | 28 ++ ...ansfer_billing_subscription_request_py3.py | 28 ++ .../transfer_billing_subscription_result.py | 28 ++ ...ransfer_billing_subscription_result_py3.py | 28 ++ .../transfer_product_request_properties.py | 28 ++ ...transfer_product_request_properties_py3.py | 28 ++ .../update_auto_renew_operation_summary.py | 28 ++ ...update_auto_renew_operation_summary_py3.py | 28 ++ .../models/update_auto_renew_request.py | 29 ++ .../models/update_auto_renew_request_py3.py | 29 ++ .../azure/mgmt/billing/operations/__init__.py | 54 ++- .../operations/billing_accounts_operations.py | 155 ++++++++ ...e_invoice_section_permission_operations.py | 94 +++++ .../operations/billing_periods_operations.py | 183 --------- ...ofiles_by_billing_account_id_operations.py | 98 +++++ .../operations/billing_profiles_operations.py | 213 +++++++++++ .../operations/billing_property_operations.py | 92 +++++ .../billing_subscription_operations.py | 218 +++++++++++ ...criptions_by_billing_profile_operations.py | 98 +++++ ...criptions_by_invoice_section_operations.py | 98 +++++ ...tments_by_billing_account_id_operations.py | 105 ++++++ .../operations/departments_operations.py | 108 ++++++ ...counts_by_billing_account_id_operations.py | 105 ++++++ .../enrollment_accounts_operations.py | 95 ++--- .../billing/operations/invoice_operations.py | 100 +++++ .../invoice_pricesheet_operations.py | 145 +++++++ ...ctions_by_billing_account_id_operations.py | 104 +++++ .../operations/invoice_sections_operations.py | 333 ++++++++++++++++ ...eate_subscription_permission_operations.py | 105 ++++++ .../invoices_by_billing_account_operations.py | 100 +++++ .../invoices_by_billing_profile_operations.py | 103 +++++ .../billing/operations/invoices_operations.py | 252 ------------- .../mgmt/billing/operations/operations.py | 4 +- ...t_methods_by_billing_profile_operations.py | 105 ++++++ .../billing/operations/policy_operations.py | 169 +++++++++ .../products_by_billing_account_operations.py | 109 ++++++ ...cts_by_billing_subscriptions_operations.py | 102 +++++ .../products_by_invoice_section_operations.py | 104 +++++ .../billing/operations/products_operations.py | 178 +++++++++ ...nsactions_by_billing_account_operations.py | 116 ++++++ 116 files changed, 7849 insertions(+), 771 deletions(-) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/address.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/address_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/amount.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/amount_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_period_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py rename azure-mgmt-billing/azure/mgmt/billing/models/{billing_period_paged.py => billing_subscription_summary_paged.py} (71%) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/department.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/department_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/department_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/department_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/download_properties.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/download_properties_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enrollment.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/enrollment_py3.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result_py3.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py rename azure-mgmt-billing/azure/mgmt/billing/models/{billing_period.py => invoice_section.py} (51%) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/operation_status.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py rename azure-mgmt-billing/azure/mgmt/billing/models/{invoice_paged.py => payment_method_paged.py} (69%) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/payment_properties.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/payment_properties_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/policy.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/product_summary.py rename azure-mgmt-billing/azure/mgmt/billing/models/{enrollment_account_paged.py => product_summary_paged.py} (67%) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/product_summary_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/products_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/products_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_paged.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_with_create_invoice_section_permission_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_periods_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_by_billing_account_id_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_property_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_invoice_section_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/departments_by_billing_account_id_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_by_billing_account_id_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_pricesheet_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_id_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_account_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_profile_operations.py delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_by_billing_profile_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_account_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_subscriptions_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/products_by_invoice_section_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_account_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index 528867b0d1ce..6d4b53654aef 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -13,9 +13,36 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling +import uuid +from .operations.billing_accounts_operations import BillingAccountsOperations +from .operations.billing_accounts_with_create_invoice_section_permission_operations import BillingAccountsWithCreateInvoiceSectionPermissionOperations +from .operations.payment_methods_by_billing_profile_operations import PaymentMethodsByBillingProfileOperations +from .operations.billing_profiles_by_billing_account_id_operations import BillingProfilesByBillingAccountIdOperations +from .operations.billing_profiles_operations import BillingProfilesOperations +from .operations.invoice_sections_by_billing_account_id_operations import InvoiceSectionsByBillingAccountIdOperations +from .operations.invoice_sections_operations import InvoiceSectionsOperations +from .operations.invoice_sections_with_create_subscription_permission_operations import InvoiceSectionsWithCreateSubscriptionPermissionOperations +from .operations.departments_by_billing_account_id_operations import DepartmentsByBillingAccountIdOperations +from .operations.departments_operations import DepartmentsOperations +from .operations.enrollment_accounts_by_billing_account_id_operations import EnrollmentAccountsByBillingAccountIdOperations from .operations.enrollment_accounts_operations import EnrollmentAccountsOperations -from .operations.billing_periods_operations import BillingPeriodsOperations -from .operations.invoices_operations import InvoicesOperations +from .operations.invoices_by_billing_account_operations import InvoicesByBillingAccountOperations +from .operations.invoice_pricesheet_operations import InvoicePricesheetOperations +from .operations.invoices_by_billing_profile_operations import InvoicesByBillingProfileOperations +from .operations.invoice_operations import InvoiceOperations +from .operations.products_by_billing_subscriptions_operations import ProductsByBillingSubscriptionsOperations +from .operations.billing_subscriptions_by_billing_profile_operations import BillingSubscriptionsByBillingProfileOperations +from .operations.billing_subscriptions_by_invoice_section_operations import BillingSubscriptionsByInvoiceSectionOperations +from .operations.billing_subscription_operations import BillingSubscriptionOperations +from .operations.products_by_billing_account_operations import ProductsByBillingAccountOperations +from .operations.products_by_invoice_section_operations import ProductsByInvoiceSectionOperations +from .operations.products_operations import ProductsOperations +from .operations.transactions_by_billing_account_operations import TransactionsByBillingAccountOperations +from .operations.policy_operations import PolicyOperations +from .operations.billing_property_operations import BillingPropertyOperations from .operations.operations import Operations from . import models @@ -58,12 +85,58 @@ class BillingManagementClient(SDKClient): :ivar config: Configuration for client. :vartype config: BillingManagementClientConfiguration + :ivar billing_accounts: BillingAccounts operations + :vartype billing_accounts: azure.mgmt.billing.operations.BillingAccountsOperations + :ivar billing_accounts_with_create_invoice_section_permission: BillingAccountsWithCreateInvoiceSectionPermission operations + :vartype billing_accounts_with_create_invoice_section_permission: azure.mgmt.billing.operations.BillingAccountsWithCreateInvoiceSectionPermissionOperations + :ivar payment_methods_by_billing_profile: PaymentMethodsByBillingProfile operations + :vartype payment_methods_by_billing_profile: azure.mgmt.billing.operations.PaymentMethodsByBillingProfileOperations + :ivar billing_profiles_by_billing_account_id: BillingProfilesByBillingAccountId operations + :vartype billing_profiles_by_billing_account_id: azure.mgmt.billing.operations.BillingProfilesByBillingAccountIdOperations + :ivar billing_profiles: BillingProfiles operations + :vartype billing_profiles: azure.mgmt.billing.operations.BillingProfilesOperations + :ivar invoice_sections_by_billing_account_id: InvoiceSectionsByBillingAccountId operations + :vartype invoice_sections_by_billing_account_id: azure.mgmt.billing.operations.InvoiceSectionsByBillingAccountIdOperations + :ivar invoice_sections: InvoiceSections operations + :vartype invoice_sections: azure.mgmt.billing.operations.InvoiceSectionsOperations + :ivar invoice_sections_with_create_subscription_permission: InvoiceSectionsWithCreateSubscriptionPermission operations + :vartype invoice_sections_with_create_subscription_permission: azure.mgmt.billing.operations.InvoiceSectionsWithCreateSubscriptionPermissionOperations + :ivar departments_by_billing_account_id: DepartmentsByBillingAccountId operations + :vartype departments_by_billing_account_id: azure.mgmt.billing.operations.DepartmentsByBillingAccountIdOperations + :ivar departments: Departments operations + :vartype departments: azure.mgmt.billing.operations.DepartmentsOperations + :ivar enrollment_accounts_by_billing_account_id: EnrollmentAccountsByBillingAccountId operations + :vartype enrollment_accounts_by_billing_account_id: azure.mgmt.billing.operations.EnrollmentAccountsByBillingAccountIdOperations :ivar enrollment_accounts: EnrollmentAccounts operations :vartype enrollment_accounts: azure.mgmt.billing.operations.EnrollmentAccountsOperations - :ivar billing_periods: BillingPeriods operations - :vartype billing_periods: azure.mgmt.billing.operations.BillingPeriodsOperations - :ivar invoices: Invoices operations - :vartype invoices: azure.mgmt.billing.operations.InvoicesOperations + :ivar invoices_by_billing_account: InvoicesByBillingAccount operations + :vartype invoices_by_billing_account: azure.mgmt.billing.operations.InvoicesByBillingAccountOperations + :ivar invoice_pricesheet: InvoicePricesheet operations + :vartype invoice_pricesheet: azure.mgmt.billing.operations.InvoicePricesheetOperations + :ivar invoices_by_billing_profile: InvoicesByBillingProfile operations + :vartype invoices_by_billing_profile: azure.mgmt.billing.operations.InvoicesByBillingProfileOperations + :ivar invoice: Invoice operations + :vartype invoice: azure.mgmt.billing.operations.InvoiceOperations + :ivar products_by_billing_subscriptions: ProductsByBillingSubscriptions operations + :vartype products_by_billing_subscriptions: azure.mgmt.billing.operations.ProductsByBillingSubscriptionsOperations + :ivar billing_subscriptions_by_billing_profile: BillingSubscriptionsByBillingProfile operations + :vartype billing_subscriptions_by_billing_profile: azure.mgmt.billing.operations.BillingSubscriptionsByBillingProfileOperations + :ivar billing_subscriptions_by_invoice_section: BillingSubscriptionsByInvoiceSection operations + :vartype billing_subscriptions_by_invoice_section: azure.mgmt.billing.operations.BillingSubscriptionsByInvoiceSectionOperations + :ivar billing_subscription: BillingSubscription operations + :vartype billing_subscription: azure.mgmt.billing.operations.BillingSubscriptionOperations + :ivar products_by_billing_account: ProductsByBillingAccount operations + :vartype products_by_billing_account: azure.mgmt.billing.operations.ProductsByBillingAccountOperations + :ivar products_by_invoice_section: ProductsByInvoiceSection operations + :vartype products_by_invoice_section: azure.mgmt.billing.operations.ProductsByInvoiceSectionOperations + :ivar products: Products operations + :vartype products: azure.mgmt.billing.operations.ProductsOperations + :ivar transactions_by_billing_account: TransactionsByBillingAccount operations + :vartype transactions_by_billing_account: azure.mgmt.billing.operations.TransactionsByBillingAccountOperations + :ivar policy: Policy operations + :vartype policy: azure.mgmt.billing.operations.PolicyOperations + :ivar billing_property: BillingProperty operations + :vartype billing_property: azure.mgmt.billing.operations.BillingPropertyOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.billing.operations.Operations @@ -82,15 +155,278 @@ 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-03-01-preview' + self.api_version = '2018-11-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.billing_accounts = BillingAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_accounts_with_create_invoice_section_permission = BillingAccountsWithCreateInvoiceSectionPermissionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.payment_methods_by_billing_profile = PaymentMethodsByBillingProfileOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_profiles_by_billing_account_id = BillingProfilesByBillingAccountIdOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_profiles = BillingProfilesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoice_sections_by_billing_account_id = InvoiceSectionsByBillingAccountIdOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoice_sections = InvoiceSectionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoice_sections_with_create_subscription_permission = InvoiceSectionsWithCreateSubscriptionPermissionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.departments_by_billing_account_id = DepartmentsByBillingAccountIdOperations( + self._client, self.config, self._serialize, self._deserialize) + self.departments = DepartmentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.enrollment_accounts_by_billing_account_id = EnrollmentAccountsByBillingAccountIdOperations( + self._client, self.config, self._serialize, self._deserialize) self.enrollment_accounts = EnrollmentAccountsOperations( self._client, self.config, self._serialize, self._deserialize) - self.billing_periods = BillingPeriodsOperations( + self.invoices_by_billing_account = InvoicesByBillingAccountOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoice_pricesheet = InvoicePricesheetOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoices_by_billing_profile = InvoicesByBillingProfileOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoice = InvoiceOperations( + self._client, self.config, self._serialize, self._deserialize) + self.products_by_billing_subscriptions = ProductsByBillingSubscriptionsOperations( self._client, self.config, self._serialize, self._deserialize) - self.invoices = InvoicesOperations( + self.billing_subscriptions_by_billing_profile = BillingSubscriptionsByBillingProfileOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_subscriptions_by_invoice_section = BillingSubscriptionsByInvoiceSectionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_subscription = BillingSubscriptionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.products_by_billing_account = ProductsByBillingAccountOperations( + self._client, self.config, self._serialize, self._deserialize) + self.products_by_invoice_section = ProductsByInvoiceSectionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.products = ProductsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.transactions_by_billing_account = TransactionsByBillingAccountOperations( + self._client, self.config, self._serialize, self._deserialize) + self.policy = PolicyOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_property = BillingPropertyOperations( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) + + def transactions_by_billing_profile( + self, billing_account_id, billing_profile_id, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the transactions by billingProfileId for given start date and end + date. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param billing_profile_id: Billing Profile Id. + :type billing_profile_id: str + :param start_date: Start date + :type start_date: str + :param end_date: End date + :type end_date: str + :param filter: May be used to filter by transaction kind. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TransactionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransactionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.transactions_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransactionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + transactions_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/transactions'} + + def update_auto_renew_for_billing_account( + self, billing_account_id, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): + """Cancel product by product id. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param product_name: Invoide Id. + :type product_name: str + :param auto_renew: Request parameters to update auto renew policy a + product. Possible values include: 'true', 'false' + :type auto_renew: str or ~azure.mgmt.billing.models.UpdateAutoRenew + :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: UpdateAutoRenewOperationSummary or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.UpdateAutoRenewOperationSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + body = models.UpdateAutoRenewRequest(auto_renew=auto_renew) + + # Construct URL + url = self.update_auto_renew_for_billing_account.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'productName': self._serialize.url("product_name", product_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(body, 'UpdateAutoRenewRequest') + + # 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('UpdateAutoRenewOperationSummary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_auto_renew_for_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/products/{productName}/updateAutoRenew'} + + def update_auto_renew_for_invoice_section( + self, billing_account_id, invoice_section_id, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): + """Cancel auto renew for product by product id. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param invoice_section_id: InvoiceSection Id. + :type invoice_section_id: str + :param product_name: Invoide Id. + :type product_name: str + :param auto_renew: Request parameters to update auto renew policy a + product. Possible values include: 'true', 'false' + :type auto_renew: str or ~azure.mgmt.billing.models.UpdateAutoRenew + :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: UpdateAutoRenewOperationSummary or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.UpdateAutoRenewOperationSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + body = models.UpdateAutoRenewRequest(auto_renew=auto_renew) + + # Construct URL + url = self.update_auto_renew_for_invoice_section.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'invoiceSectionId': self._serialize.url("invoice_section_id", invoice_section_id, 'str'), + 'productName': self._serialize.url("product_name", product_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(body, 'UpdateAutoRenewRequest') + + # 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('UpdateAutoRenewOperationSummary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_auto_renew_for_invoice_section.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}/products/{productName}/updateAutoRenew'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py index 4e5a8bfe9975..05849198014f 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py @@ -10,42 +10,162 @@ # -------------------------------------------------------------------------- try: + from .transfer_product_request_properties_py3 import TransferProductRequestProperties + from .transfer_billing_subscription_result_py3 import TransferBillingSubscriptionResult + from .transfer_billing_subscription_request_properties_py3 import TransferBillingSubscriptionRequestProperties + from .transfer_billing_subscription_request_py3 import TransferBillingSubscriptionRequest + from .update_auto_renew_operation_summary_py3 import UpdateAutoRenewOperationSummary + from .address_py3 import Address + from .enabled_azure_sk_us_py3 import EnabledAzureSKUs + from .billing_profile_py3 import BillingProfile + from .invoice_section_properties_py3 import InvoiceSectionProperties + from .invoice_section_py3 import InvoiceSection + from .enrollment_policies_py3 import EnrollmentPolicies + from .enrollment_py3 import Enrollment from .enrollment_account_py3 import EnrollmentAccount - from .billing_period_py3 import BillingPeriod + from .department_py3 import Department + from .billing_account_py3 import BillingAccount + from .billing_account_list_result_py3 import BillingAccountListResult + 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 .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 .invoice_py3 import Invoice + from .resource_py3 import Resource + from .amount_py3 import Amount + from .download_properties_py3 import DownloadProperties + from .payment_properties_py3 import PaymentProperties + from .invoice_summary_py3 import InvoiceSummary + from .invoice_list_result_py3 import InvoiceListResult + from .product_summary_py3 import ProductSummary + from .products_list_result_py3 import ProductsListResult + from .enrollment_account_context_py3 import EnrollmentAccountContext + from .billing_subscription_summary_py3 import BillingSubscriptionSummary + from .billing_subscriptions_list_result_py3 import BillingSubscriptionsListResult + from .transactions_summary_py3 import TransactionsSummary + from .transactions_list_result_py3 import TransactionsListResult + from .policy_py3 import Policy + from .payment_method_py3 import PaymentMethod + from .update_auto_renew_request_py3 import UpdateAutoRenewRequest from .operation_display_py3 import OperationDisplay from .operation_py3 import Operation - from .resource_py3 import Resource except (SyntaxError, ImportError): + from .transfer_product_request_properties import TransferProductRequestProperties + from .transfer_billing_subscription_result import TransferBillingSubscriptionResult + from .transfer_billing_subscription_request_properties import TransferBillingSubscriptionRequestProperties + from .transfer_billing_subscription_request import TransferBillingSubscriptionRequest + from .update_auto_renew_operation_summary import UpdateAutoRenewOperationSummary + from .address import Address + from .enabled_azure_sk_us import EnabledAzureSKUs + from .billing_profile import BillingProfile + from .invoice_section_properties import InvoiceSectionProperties + from .invoice_section import InvoiceSection + from .enrollment_policies import EnrollmentPolicies + from .enrollment import Enrollment from .enrollment_account import EnrollmentAccount - from .billing_period import BillingPeriod + from .department import Department + from .billing_account import BillingAccount + from .billing_account_list_result import BillingAccountListResult + 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 .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 .invoice import Invoice + from .resource import Resource + from .amount import Amount + from .download_properties import DownloadProperties + from .payment_properties import PaymentProperties + from .invoice_summary import InvoiceSummary + from .invoice_list_result import InvoiceListResult + from .product_summary import ProductSummary + from .products_list_result import ProductsListResult + from .enrollment_account_context import EnrollmentAccountContext + from .billing_subscription_summary import BillingSubscriptionSummary + from .billing_subscriptions_list_result import BillingSubscriptionsListResult + from .transactions_summary import TransactionsSummary + from .transactions_list_result import TransactionsListResult + from .policy import Policy + from .payment_method import PaymentMethod + from .update_auto_renew_request import UpdateAutoRenewRequest from .operation_display import OperationDisplay from .operation import Operation - from .resource import Resource -from .enrollment_account_paged import EnrollmentAccountPaged -from .billing_period_paged import BillingPeriodPaged -from .invoice_paged import InvoicePaged +from .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 .operation_paged import OperationPaged +from .billing_management_client_enums import ( + ProductStatusType, + BillingFrequency, + BillingSubscriptionStatusType, + TransactionTypeKind, + ReservationType, + PaymentMethodType, + UpdateAutoRenew, +) __all__ = [ + 'TransferProductRequestProperties', + 'TransferBillingSubscriptionResult', + 'TransferBillingSubscriptionRequestProperties', + 'TransferBillingSubscriptionRequest', + 'UpdateAutoRenewOperationSummary', + 'Address', + 'EnabledAzureSKUs', + 'BillingProfile', + 'InvoiceSectionProperties', + 'InvoiceSection', + 'EnrollmentPolicies', + 'Enrollment', 'EnrollmentAccount', - 'BillingPeriod', + 'Department', + 'BillingAccount', + 'BillingAccountListResult', + 'BillingProperty', + 'DepartmentListResult', + 'EnrollmentAccountListResult', + 'BillingProfileListResult', + 'InvoiceSectionListResult', + 'OperationStatus', 'DownloadUrl', 'ErrorDetails', 'ErrorResponse', 'ErrorResponseException', - 'Invoice', + 'Resource', + 'Amount', + 'DownloadProperties', + 'PaymentProperties', + 'InvoiceSummary', + 'InvoiceListResult', + 'ProductSummary', + 'ProductsListResult', + 'EnrollmentAccountContext', + 'BillingSubscriptionSummary', + 'BillingSubscriptionsListResult', + 'TransactionsSummary', + 'TransactionsListResult', + 'Policy', + 'PaymentMethod', + 'UpdateAutoRenewRequest', 'OperationDisplay', 'Operation', - 'Resource', - 'EnrollmentAccountPaged', - 'BillingPeriodPaged', - 'InvoicePaged', + 'PaymentMethodPaged', + 'BillingSubscriptionSummaryPaged', + 'ProductSummaryPaged', + 'TransactionsSummaryPaged', 'OperationPaged', + 'ProductStatusType', + 'BillingFrequency', + 'BillingSubscriptionStatusType', + 'TransactionTypeKind', + 'ReservationType', + 'PaymentMethodType', + 'UpdateAutoRenew', ] diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/address.py b/azure-mgmt-billing/azure/mgmt/billing/models/address.py new file mode 100644 index 000000000000..062465328263 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/address.py @@ -0,0 +1,64 @@ +# 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 Address(Model): + """Address details. + + :param first_name: First Name. + :type first_name: str + :param last_name: Last Name. + :type last_name: str + :param company_name: Company Name. + :type company_name: str + :param address_line1: Address Line1. + :type address_line1: str + :param address_line2: Address Line2. + :type address_line2: str + :param address_line3: Address Line3. + :type address_line3: str + :param city: Address City. + :type city: str + :param region: Address Region. + :type region: str + :param country: Country code uses ISO2, 2-digit format. + :type country: str + :param postal_code: Address Postal Code. + :type postal_code: str + """ + + _attribute_map = { + 'first_name': {'key': 'firstName', 'type': 'str'}, + 'last_name': {'key': 'lastName', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'address_line1': {'key': 'addressLine1', 'type': 'str'}, + 'address_line2': {'key': 'addressLine2', 'type': 'str'}, + 'address_line3': {'key': 'addressLine3', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Address, 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) + self.address_line1 = kwargs.get('address_line1', None) + self.address_line2 = kwargs.get('address_line2', None) + self.address_line3 = kwargs.get('address_line3', None) + self.city = kwargs.get('city', None) + self.region = kwargs.get('region', None) + self.country = kwargs.get('country', None) + self.postal_code = kwargs.get('postal_code', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/address_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/address_py3.py new file mode 100644 index 000000000000..df46f07863f2 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/address_py3.py @@ -0,0 +1,64 @@ +# 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 Address(Model): + """Address details. + + :param first_name: First Name. + :type first_name: str + :param last_name: Last Name. + :type last_name: str + :param company_name: Company Name. + :type company_name: str + :param address_line1: Address Line1. + :type address_line1: str + :param address_line2: Address Line2. + :type address_line2: str + :param address_line3: Address Line3. + :type address_line3: str + :param city: Address City. + :type city: str + :param region: Address Region. + :type region: str + :param country: Country code uses ISO2, 2-digit format. + :type country: str + :param postal_code: Address Postal Code. + :type postal_code: str + """ + + _attribute_map = { + 'first_name': {'key': 'firstName', 'type': 'str'}, + 'last_name': {'key': 'lastName', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'address_line1': {'key': 'addressLine1', 'type': 'str'}, + 'address_line2': {'key': 'addressLine2', 'type': 'str'}, + 'address_line3': {'key': 'addressLine3', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + } + + 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) + self.first_name = first_name + self.last_name = last_name + self.company_name = company_name + self.address_line1 = address_line1 + self.address_line2 = address_line2 + self.address_line3 = address_line3 + self.city = city + self.region = region + self.country = country + self.postal_code = postal_code diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/amount.py b/azure-mgmt-billing/azure/mgmt/billing/models/amount.py new file mode 100644 index 000000000000..2707d55dcac7 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/amount.py @@ -0,0 +1,40 @@ +# 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 Amount(Model): + """The Amount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar currency: The currency for the amount value. + :vartype currency: str + :ivar value: Amount value. + :vartype value: float + """ + + _validation = { + 'currency': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'currency': {'key': 'currency', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(Amount, self).__init__(**kwargs) + self.currency = None + self.value = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/amount_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/amount_py3.py new file mode 100644 index 000000000000..2f992f1c63c5 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/amount_py3.py @@ -0,0 +1,40 @@ +# 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 Amount(Model): + """The Amount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar currency: The currency for the amount value. + :vartype currency: str + :ivar value: Amount value. + :vartype value: float + """ + + _validation = { + 'currency': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'currency': {'key': 'currency', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(Amount, self).__init__(**kwargs) + self.currency = None + self.value = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py new file mode 100644 index 000000000000..4769f51c9457 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BillingAccount(Resource): + """A billing account resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: The billing account name. + :vartype display_name: str + :ivar company: The Company this billing account belongs to. + :vartype company: 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 country: The country associated with billing account.. + :vartype country: str + :param invoice_sections: The invoice sections associated to the billing + account. + :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] + :param billing_profiles: The billing profiles associated to the billing + account. + :type billing_profiles: list[~azure.mgmt.billing.models.BillingProfile] + :ivar enrollment_details: The details about the associated legacy + enrollment. By default this is not populated, unless it's specified in + $expand. + :vartype enrollment_details: ~azure.mgmt.billing.models.Enrollment + :param departments: The departments associated to the enrollment. + :type departments: list[~azure.mgmt.billing.models.Department] + :param enrollment_accounts: The accounts associated to the enrollment. + :type enrollment_accounts: + list[~azure.mgmt.billing.models.EnrollmentAccount] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'company': {'readonly': True}, + 'account_type': {'readonly': True}, + 'country': {'readonly': True}, + 'enrollment_details': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'company': {'key': 'properties.company', 'type': 'str'}, + 'account_type': {'key': 'properties.accountType', 'type': 'str'}, + 'address': {'key': 'properties.address', 'type': 'Address'}, + 'country': {'key': 'properties.country', 'type': 'str'}, + 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, + '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]'}, + } + + def __init__(self, **kwargs): + super(BillingAccount, self).__init__(**kwargs) + self.display_name = None + self.company = None + self.account_type = None + self.address = kwargs.get('address', None) + self.country = None + self.invoice_sections = kwargs.get('invoice_sections', 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) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result.py new file mode 100644 index 000000000000..311bed43f801 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result.py @@ -0,0 +1,40 @@ +# 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 BillingAccountListResult(Model): + """Result of listing billing accounts. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of billing accounts. + :vartype value: list[~azure.mgmt.billing.models.BillingAccount] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingAccountListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result_py3.py new file mode 100644 index 000000000000..fa94c0d30857 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result_py3.py @@ -0,0 +1,40 @@ +# 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 BillingAccountListResult(Model): + """Result of listing billing accounts. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of billing accounts. + :vartype value: list[~azure.mgmt.billing.models.BillingAccount] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingAccountListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py new file mode 100644 index 000000000000..06f2f04535b0 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class BillingAccount(Resource): + """A billing account resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: The billing account name. + :vartype display_name: str + :ivar company: The Company this billing account belongs to. + :vartype company: 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 country: The country associated with billing account.. + :vartype country: str + :param invoice_sections: The invoice sections associated to the billing + account. + :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] + :param billing_profiles: The billing profiles associated to the billing + account. + :type billing_profiles: list[~azure.mgmt.billing.models.BillingProfile] + :ivar enrollment_details: The details about the associated legacy + enrollment. By default this is not populated, unless it's specified in + $expand. + :vartype enrollment_details: ~azure.mgmt.billing.models.Enrollment + :param departments: The departments associated to the enrollment. + :type departments: list[~azure.mgmt.billing.models.Department] + :param enrollment_accounts: The accounts associated to the enrollment. + :type enrollment_accounts: + list[~azure.mgmt.billing.models.EnrollmentAccount] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'company': {'readonly': True}, + 'account_type': {'readonly': True}, + 'country': {'readonly': True}, + 'enrollment_details': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'company': {'key': 'properties.company', 'type': 'str'}, + 'account_type': {'key': 'properties.accountType', 'type': 'str'}, + 'address': {'key': 'properties.address', 'type': 'Address'}, + 'country': {'key': 'properties.country', 'type': 'str'}, + 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, + '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]'}, + } + + def __init__(self, *, address=None, invoice_sections=None, billing_profiles=None, departments=None, enrollment_accounts=None, **kwargs) -> None: + super(BillingAccount, self).__init__(**kwargs) + self.display_name = None + self.company = None + self.account_type = None + self.address = address + self.country = None + self.invoice_sections = invoice_sections + self.billing_profiles = billing_profiles + self.enrollment_details = None + self.departments = departments + self.enrollment_accounts = enrollment_accounts diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py new file mode 100644 index 000000000000..f677df06b38b --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py @@ -0,0 +1,64 @@ +# 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 enum import Enum + + +class ProductStatusType(str, Enum): + + active = "Active" + inactive = "Inactive" + past_due = "PastDue" + expiring = "Expiring" + expired = "Expired" + disabled = "Disabled" + cancelled = "Cancelled" + auto_renew = "AutoRenew" + + +class BillingFrequency(str, Enum): + + one_time = "OneTime" + monthly = "Monthly" + usage_based = "UsageBased" + + +class BillingSubscriptionStatusType(str, Enum): + + active = "Active" + inactive = "Inactive" + abandoned = "Abandoned" + deleted = "Deleted" + warning = "Warning" + + +class TransactionTypeKind(str, Enum): + + all = "all" + reservation = "reservation" + + +class ReservationType(str, Enum): + + purchase = "Purchase" + usage_charge = "Usage Charge" + + +class PaymentMethodType(str, Enum): + + credits = "Credits" + cheque_wire = "ChequeWire" + + +class UpdateAutoRenew(str, Enum): + + true = "true" + false = "false" diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_period_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_period_py3.py deleted file mode 100644 index 7d5ecbe3a0a8..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_period_py3.py +++ /dev/null @@ -1,59 +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 .resource_py3 import Resource - - -class BillingPeriod(Resource): - """A billing period resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar billing_period_start_date: The start of the date range covered by - the billing period. - :vartype billing_period_start_date: date - :ivar billing_period_end_date: The end of the date range covered by the - billing period. - :vartype billing_period_end_date: date - :ivar invoice_ids: Array of invoice ids that associated with. - :vartype invoice_ids: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'billing_period_start_date': {'readonly': True}, - 'billing_period_end_date': {'readonly': True}, - 'invoice_ids': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'billing_period_start_date': {'key': 'properties.billingPeriodStartDate', 'type': 'date'}, - 'billing_period_end_date': {'key': 'properties.billingPeriodEndDate', 'type': 'date'}, - 'invoice_ids': {'key': 'properties.invoiceIds', 'type': '[str]'}, - } - - def __init__(self, **kwargs) -> None: - super(BillingPeriod, self).__init__(**kwargs) - self.billing_period_start_date = None - self.billing_period_end_date = None - self.invoice_ids = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py new file mode 100644 index 000000000000..8a7dc1f878eb --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py @@ -0,0 +1,85 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BillingProfile(Resource): + """A billing profile resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: The billing profile name. + :type display_name: str + :param po_number: Purchase order number. + :type po_number: str + :param billing_address: Billing address. + :type billing_address: ~azure.mgmt.billing.models.Address + :ivar invoice_email_opt_in: If the billing profile is opted in to recieve + 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 invoice_sections: The invoice sections associated to the billing + profile. + :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'invoice_email_opt_in': {'readonly': True}, + 'is_classic': {'readonly': True}, + 'invoice_day': {'readonly': True}, + 'currency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'po_number': {'key': 'properties.poNumber', 'type': 'str'}, + 'billing_address': {'key': 'properties.billingAddress', '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]'}, + 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, + } + + def __init__(self, **kwargs): + super(BillingProfile, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.po_number = kwargs.get('po_number', None) + self.billing_address = kwargs.get('billing_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.invoice_sections = kwargs.get('invoice_sections', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result.py new file mode 100644 index 000000000000..3a117e471cab --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result.py @@ -0,0 +1,40 @@ +# 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 BillingProfileListResult(Model): + """Result of listing billing profiles. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of billing profiles. + :vartype value: list[~azure.mgmt.billing.models.BillingProfile] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingProfile]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingProfileListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result_py3.py new file mode 100644 index 000000000000..470cb7f349c8 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result_py3.py @@ -0,0 +1,40 @@ +# 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 BillingProfileListResult(Model): + """Result of listing billing profiles. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of billing profiles. + :vartype value: list[~azure.mgmt.billing.models.BillingProfile] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingProfile]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingProfileListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py new file mode 100644 index 000000000000..7acb8b5cf7dc --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py @@ -0,0 +1,85 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class BillingProfile(Resource): + """A billing profile resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: The billing profile name. + :type display_name: str + :param po_number: Purchase order number. + :type po_number: str + :param billing_address: Billing address. + :type billing_address: ~azure.mgmt.billing.models.Address + :ivar invoice_email_opt_in: If the billing profile is opted in to recieve + 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 invoice_sections: The invoice sections associated to the billing + profile. + :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'invoice_email_opt_in': {'readonly': True}, + 'is_classic': {'readonly': True}, + 'invoice_day': {'readonly': True}, + 'currency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'po_number': {'key': 'properties.poNumber', 'type': 'str'}, + 'billing_address': {'key': 'properties.billingAddress', '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]'}, + 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, + } + + def __init__(self, *, display_name: str=None, po_number: str=None, billing_address=None, enabled_azure_sk_us=None, invoice_sections=None, **kwargs) -> None: + super(BillingProfile, self).__init__(**kwargs) + self.display_name = display_name + self.po_number = po_number + self.billing_address = billing_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.invoice_sections = invoice_sections diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py new file mode 100644 index 000000000000..81004ae28a87 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py @@ -0,0 +1,80 @@ +# 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 BillingProperty(Model): + """The billing property. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar product_id: Product Id. + :vartype product_id: str + :ivar billing_tenant_id: Billing tenant Id. + :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_profile_id: Billing profile Id. + :vartype billing_profile_id: str + :ivar billing_proflie_name: Billing profile name. + :vartype billing_proflie_name: 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 sku_id: SKU Id. + :vartype sku_id: str + :ivar sku_description: SKU description. + :vartype sku_description: str + """ + + _validation = { + 'product_id': {'readonly': True}, + 'billing_tenant_id': {'readonly': True}, + 'billing_account_id': {'readonly': True}, + 'billing_account_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_proflie_name': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'sku_id': {'readonly': True}, + 'sku_description': {'readonly': True}, + } + + _attribute_map = { + 'product_id': {'key': 'productId', 'type': 'str'}, + 'billing_tenant_id': {'key': 'billingTenantId', 'type': 'str'}, + 'billing_account_id': {'key': 'billingAccountId', 'type': 'str'}, + 'billing_account_name': {'key': 'billingAccountName', 'type': 'str'}, + 'billing_profile_id': {'key': 'billingProfileId', 'type': 'str'}, + 'billing_proflie_name': {'key': 'billingProflieName', 'type': 'str'}, + 'invoice_section_id': {'key': 'invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'invoiceSectionName', 'type': 'str'}, + 'sku_id': {'key': 'skuId', 'type': 'str'}, + 'sku_description': {'key': 'skuDescription', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingProperty, self).__init__(**kwargs) + self.product_id = None + self.billing_tenant_id = None + self.billing_account_id = None + self.billing_account_name = None + self.billing_profile_id = None + self.billing_proflie_name = None + self.invoice_section_id = None + self.invoice_section_name = None + self.sku_id = None + self.sku_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py new file mode 100644 index 000000000000..3db37fa4626c --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py @@ -0,0 +1,80 @@ +# 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 BillingProperty(Model): + """The billing property. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar product_id: Product Id. + :vartype product_id: str + :ivar billing_tenant_id: Billing tenant Id. + :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_profile_id: Billing profile Id. + :vartype billing_profile_id: str + :ivar billing_proflie_name: Billing profile name. + :vartype billing_proflie_name: 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 sku_id: SKU Id. + :vartype sku_id: str + :ivar sku_description: SKU description. + :vartype sku_description: str + """ + + _validation = { + 'product_id': {'readonly': True}, + 'billing_tenant_id': {'readonly': True}, + 'billing_account_id': {'readonly': True}, + 'billing_account_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_proflie_name': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'sku_id': {'readonly': True}, + 'sku_description': {'readonly': True}, + } + + _attribute_map = { + 'product_id': {'key': 'productId', 'type': 'str'}, + 'billing_tenant_id': {'key': 'billingTenantId', 'type': 'str'}, + 'billing_account_id': {'key': 'billingAccountId', 'type': 'str'}, + 'billing_account_name': {'key': 'billingAccountName', 'type': 'str'}, + 'billing_profile_id': {'key': 'billingProfileId', 'type': 'str'}, + 'billing_proflie_name': {'key': 'billingProflieName', 'type': 'str'}, + 'invoice_section_id': {'key': 'invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'invoiceSectionName', 'type': 'str'}, + 'sku_id': {'key': 'skuId', 'type': 'str'}, + 'sku_description': {'key': 'skuDescription', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingProperty, self).__init__(**kwargs) + self.product_id = None + self.billing_tenant_id = None + self.billing_account_id = None + self.billing_account_name = None + self.billing_profile_id = None + self.billing_proflie_name = None + self.invoice_section_id = None + self.invoice_section_name = None + self.sku_id = None + self.sku_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py new file mode 100644 index 000000000000..3aaab43349f8 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py @@ -0,0 +1,95 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BillingSubscriptionSummary(Resource): + """A billing Subscription summary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: display name. + :vartype display_name: str + :ivar subscription_id: Subscription Id. + :vartype subscription_id: str + :param subscription_billing_status: Subscription billing status. Possible + values include: 'Active', 'Inactive', 'Abandoned', 'Deleted', 'Warning' + :type subscription_billing_status: str or + ~azure.mgmt.billing.models.BillingSubscriptionStatusType + :ivar last_month_charges: Last month charges. + :vartype last_month_charges: ~azure.mgmt.billing.models.Amount + :ivar month_to_date_charges: Month to date charges. + :vartype month_to_date_charges: ~azure.mgmt.billing.models.Amount + :ivar enrollment_account_context: The enrollment account context. + :vartype enrollment_account_context: + ~azure.mgmt.billing.models.EnrollmentAccountContext + :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 + :param sku_id: The sku id. + :type sku_id: str + :ivar sku_description: The sku description. + :vartype sku_description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_month_charges': {'readonly': True}, + 'month_to_date_charges': {'readonly': True}, + 'enrollment_account_context': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'sku_description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'subscription_billing_status': {'key': 'properties.subscriptionBillingStatus', 'type': 'str'}, + 'last_month_charges': {'key': 'properties.lastMonthCharges', 'type': 'Amount'}, + 'month_to_date_charges': {'key': 'properties.monthToDateCharges', 'type': 'Amount'}, + 'enrollment_account_context': {'key': 'properties.enrollmentAccountContext', 'type': 'EnrollmentAccountContext'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', '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) + 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.enrollment_account_context = None + self.billing_profile_id = None + self.billing_profile_name = None + self.sku_id = kwargs.get('sku_id', None) + self.sku_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_period_paged.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_paged.py similarity index 71% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_period_paged.py rename to azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_paged.py index 54fd2546182b..9c32206b6654 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_period_paged.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class BillingPeriodPaged(Paged): +class BillingSubscriptionSummaryPaged(Paged): """ - A paging container for iterating over a list of :class:`BillingPeriod ` object + A paging container for iterating over a list of :class:`BillingSubscriptionSummary ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[BillingPeriod]'} + 'current_page': {'key': 'value', 'type': '[BillingSubscriptionSummary]'} } def __init__(self, *args, **kwargs): - super(BillingPeriodPaged, self).__init__(*args, **kwargs) + super(BillingSubscriptionSummaryPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py new file mode 100644 index 000000000000..38234f197df2 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py @@ -0,0 +1,95 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class BillingSubscriptionSummary(Resource): + """A billing Subscription summary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: display name. + :vartype display_name: str + :ivar subscription_id: Subscription Id. + :vartype subscription_id: str + :param subscription_billing_status: Subscription billing status. Possible + values include: 'Active', 'Inactive', 'Abandoned', 'Deleted', 'Warning' + :type subscription_billing_status: str or + ~azure.mgmt.billing.models.BillingSubscriptionStatusType + :ivar last_month_charges: Last month charges. + :vartype last_month_charges: ~azure.mgmt.billing.models.Amount + :ivar month_to_date_charges: Month to date charges. + :vartype month_to_date_charges: ~azure.mgmt.billing.models.Amount + :ivar enrollment_account_context: The enrollment account context. + :vartype enrollment_account_context: + ~azure.mgmt.billing.models.EnrollmentAccountContext + :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 + :param sku_id: The sku id. + :type sku_id: str + :ivar sku_description: The sku description. + :vartype sku_description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'last_month_charges': {'readonly': True}, + 'month_to_date_charges': {'readonly': True}, + 'enrollment_account_context': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'sku_description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'subscription_billing_status': {'key': 'properties.subscriptionBillingStatus', 'type': 'str'}, + 'last_month_charges': {'key': 'properties.lastMonthCharges', 'type': 'Amount'}, + 'month_to_date_charges': {'key': 'properties.monthToDateCharges', 'type': 'Amount'}, + 'enrollment_account_context': {'key': 'properties.enrollmentAccountContext', 'type': 'EnrollmentAccountContext'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', '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) + 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.enrollment_account_context = None + self.billing_profile_id = None + self.billing_profile_name = None + self.sku_id = sku_id + self.sku_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py new file mode 100644 index 000000000000..e6f539a0c3de --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py @@ -0,0 +1,41 @@ +# 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 BillingSubscriptionsListResult(Model): + """Result of listing billing subscriptions summary. + + 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 next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingSubscriptionSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingSubscriptionsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py new file mode 100644 index 000000000000..b5b5de332d98 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py @@ -0,0 +1,41 @@ +# 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 BillingSubscriptionsListResult(Model): + """Result of listing billing subscriptions summary. + + 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 next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingSubscriptionSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingSubscriptionsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/department.py b/azure-mgmt-billing/azure/mgmt/billing/models/department.py new file mode 100644 index 000000000000..dce10c23e9ab --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/department.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Department(Resource): + """A department resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param department_name: The name for department. + :type department_name: str + :param cost_center: The cost center name. + :type cost_center: str + :param status: The status for department. + :type status: str + :param enrollment_accounts: Associated enrollment accounts. By default + this is not populated, unless it's specified in $expand. + :type enrollment_accounts: + list[~azure.mgmt.billing.models.EnrollmentAccount] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'department_name': {'key': 'properties.departmentName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, + } + + def __init__(self, **kwargs): + super(Department, self).__init__(**kwargs) + self.department_name = kwargs.get('department_name', None) + self.cost_center = kwargs.get('cost_center', None) + self.status = kwargs.get('status', None) + self.enrollment_accounts = kwargs.get('enrollment_accounts', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result.py new file mode 100644 index 000000000000..0ddf8650748c --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result.py @@ -0,0 +1,40 @@ +# 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 DepartmentListResult(Model): + """Result of listing departments. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of departments. + :vartype value: list[~azure.mgmt.billing.models.Department] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Department]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DepartmentListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result_py3.py new file mode 100644 index 000000000000..13d02e2a6581 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result_py3.py @@ -0,0 +1,40 @@ +# 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 DepartmentListResult(Model): + """Result of listing departments. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of departments. + :vartype value: list[~azure.mgmt.billing.models.Department] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Department]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DepartmentListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/department_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/department_py3.py new file mode 100644 index 000000000000..e794a716e58d --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/department_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class Department(Resource): + """A department resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param department_name: The name for department. + :type department_name: str + :param cost_center: The cost center name. + :type cost_center: str + :param status: The status for department. + :type status: str + :param enrollment_accounts: Associated enrollment accounts. By default + this is not populated, unless it's specified in $expand. + :type enrollment_accounts: + list[~azure.mgmt.billing.models.EnrollmentAccount] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'department_name': {'key': 'properties.departmentName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, + } + + def __init__(self, *, department_name: str=None, cost_center: str=None, status: str=None, enrollment_accounts=None, **kwargs) -> None: + super(Department, self).__init__(**kwargs) + self.department_name = department_name + self.cost_center = cost_center + self.status = status + self.enrollment_accounts = enrollment_accounts diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/download_properties.py b/azure-mgmt-billing/azure/mgmt/billing/models/download_properties.py new file mode 100644 index 000000000000..f6b17398e035 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/download_properties.py @@ -0,0 +1,41 @@ +# 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 DownloadProperties(Model): + """The properties of the invoice download. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar kind: Document type. Possible values include: 'Invoice', 'VoidNote', + 'Receipt', 'CreditNote' + :vartype kind: str or ~azure.mgmt.billing.models.enum + :ivar url: Document URL. + :vartype url: str + """ + + _validation = { + 'kind': {'readonly': True}, + 'url': {'readonly': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DownloadProperties, self).__init__(**kwargs) + self.kind = None + self.url = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/download_properties_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/download_properties_py3.py new file mode 100644 index 000000000000..b10a00755b25 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/download_properties_py3.py @@ -0,0 +1,41 @@ +# 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 DownloadProperties(Model): + """The properties of the invoice download. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar kind: Document type. Possible values include: 'Invoice', 'VoidNote', + 'Receipt', 'CreditNote' + :vartype kind: str or ~azure.mgmt.billing.models.enum + :ivar url: Document URL. + :vartype url: str + """ + + _validation = { + 'kind': {'readonly': True}, + 'url': {'readonly': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DownloadProperties, self).__init__(**kwargs) + self.kind = None + self.url = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/download_url.py b/azure-mgmt-billing/azure/mgmt/billing/models/download_url.py index ddc0f2214803..ffddaf71dfca 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/download_url.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/download_url.py @@ -13,7 +13,7 @@ class DownloadUrl(Model): - """A secure URL that can be used to download a PDF invoice until the URL + """A secure URL that can be used to download a an entity until the URL expires. Variables are only populated by the server, and will be ignored when diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/download_url_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/download_url_py3.py index 8d6cbc611329..a5dd985ca819 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/download_url_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/download_url_py3.py @@ -13,7 +13,7 @@ class DownloadUrl(Model): - """A secure URL that can be used to download a PDF invoice until the URL + """A secure URL that can be used to download a an entity until the URL expires. Variables are only populated by the server, and will be ignored when diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py b/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py new file mode 100644 index 000000000000..234bc54178a6 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py @@ -0,0 +1,39 @@ +# 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 EnabledAzureSKUs(Model): + """Details about the product. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param sku_id: The sku id. + :type sku_id: str + :ivar sku_description: The sku description. + :vartype sku_description: str + """ + + _validation = { + 'sku_description': {'readonly': True}, + } + + _attribute_map = { + 'sku_id': {'key': 'skuId', 'type': 'str'}, + 'sku_description': {'key': 'skuDescription', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EnabledAzureSKUs, self).__init__(**kwargs) + self.sku_id = kwargs.get('sku_id', None) + self.sku_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py new file mode 100644 index 000000000000..9fca814fe284 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py @@ -0,0 +1,39 @@ +# 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 EnabledAzureSKUs(Model): + """Details about the product. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param sku_id: The sku id. + :type sku_id: str + :ivar sku_description: The sku description. + :vartype sku_description: str + """ + + _validation = { + 'sku_description': {'readonly': True}, + } + + _attribute_map = { + 'sku_id': {'key': 'skuId', 'type': 'str'}, + 'sku_description': {'key': 'skuDescription', 'type': 'str'}, + } + + def __init__(self, *, sku_id: str=None, **kwargs) -> None: + super(EnabledAzureSKUs, self).__init__(**kwargs) + self.sku_id = sku_id + self.sku_description = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment.py new file mode 100644 index 000000000000..ac79d74d2408 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment.py @@ -0,0 +1,73 @@ +# 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 Enrollment(Model): + """Current entity level details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param start_date: Enrollment Start Date + :type start_date: datetime + :param end_date: Enrollment End Date + :type end_date: datetime + :ivar currency: The currency associated with enrollment + :vartype currency: str + :ivar channel: The channel for Enrollment + :vartype channel: str + :ivar policies: The attributes associated with legacy enrollment. + :vartype policies: ~azure.mgmt.billing.models.EnrollmentPolicies + :ivar language: The language for Enrollment + :vartype language: str + :ivar country_code: The countryCode for Enrollment + :vartype country_code: str + :ivar status: Enrollment status + :vartype status: str + :ivar billing_cylce: Enrollment billing cycle + :vartype billing_cylce: str + """ + + _validation = { + 'currency': {'readonly': True}, + 'channel': {'readonly': True}, + 'policies': {'readonly': True}, + 'language': {'readonly': True}, + 'country_code': {'readonly': True}, + 'status': {'readonly': True}, + 'billing_cylce': {'readonly': True}, + } + + _attribute_map = { + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + 'currency': {'key': 'currency', 'type': 'str'}, + 'channel': {'key': 'channel', 'type': 'str'}, + 'policies': {'key': 'policies', 'type': 'EnrollmentPolicies'}, + 'language': {'key': 'language', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'billing_cylce': {'key': 'billingCylce', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Enrollment, self).__init__(**kwargs) + self.start_date = kwargs.get('start_date', None) + self.end_date = kwargs.get('end_date', None) + self.currency = None + self.channel = None + self.policies = None + self.language = None + self.country_code = None + self.status = None + self.billing_cylce = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py index 0936208a7cd9..abfb121b9551 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py @@ -13,7 +13,7 @@ class EnrollmentAccount(Resource): - """An enrollment account resource. + """An account resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -24,24 +24,48 @@ class EnrollmentAccount(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar principal_name: The account owner's principal name. - :vartype principal_name: str + :param account_name: The account name. + :type account_name: str + :param cost_center: The cost center name. + :type cost_center: str + :param account_owner: The account owner + :type account_owner: str + :param status: The status for account. + :type status: str + :param start_date: Account Start Date + :type start_date: datetime + :param end_date: Account End Date + :type end_date: datetime + :param department: Associated department. By default this is not + populated, unless it's specified in $expand. + :type department: ~azure.mgmt.billing.models.Department """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'principal_name': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'principal_name': {'key': 'properties.principalName', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'account_owner': {'key': 'properties.accountOwner', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'start_date': {'key': 'properties.startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, + 'department': {'key': 'properties.department', 'type': 'Department'}, } def __init__(self, **kwargs): super(EnrollmentAccount, self).__init__(**kwargs) - self.principal_name = None + self.account_name = kwargs.get('account_name', None) + self.cost_center = kwargs.get('cost_center', None) + self.account_owner = kwargs.get('account_owner', None) + self.status = kwargs.get('status', None) + self.start_date = kwargs.get('start_date', None) + self.end_date = kwargs.get('end_date', None) + self.department = kwargs.get('department', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context.py new file mode 100644 index 000000000000..00a7ab12f173 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context.py @@ -0,0 +1,40 @@ +# 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 EnrollmentAccountContext(Model): + """The rating context. + + :param cost_center: The cost center name. + :type cost_center: str + :param start_date: Account Start Date + :type start_date: datetime + :param end_date: Account End Date + :type end_date: datetime + :param enrollment_account_id: The enrollment account id. + :type enrollment_account_id: str + """ + + _attribute_map = { + 'cost_center': {'key': 'costCenter', 'type': 'str'}, + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + 'enrollment_account_id': {'key': 'enrollmentAccountId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EnrollmentAccountContext, self).__init__(**kwargs) + self.cost_center = kwargs.get('cost_center', None) + self.start_date = kwargs.get('start_date', None) + self.end_date = kwargs.get('end_date', None) + self.enrollment_account_id = kwargs.get('enrollment_account_id', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context_py3.py new file mode 100644 index 000000000000..24c70723c07b --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context_py3.py @@ -0,0 +1,40 @@ +# 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 EnrollmentAccountContext(Model): + """The rating context. + + :param cost_center: The cost center name. + :type cost_center: str + :param start_date: Account Start Date + :type start_date: datetime + :param end_date: Account End Date + :type end_date: datetime + :param enrollment_account_id: The enrollment account id. + :type enrollment_account_id: str + """ + + _attribute_map = { + 'cost_center': {'key': 'costCenter', 'type': 'str'}, + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + 'enrollment_account_id': {'key': 'enrollmentAccountId', 'type': 'str'}, + } + + def __init__(self, *, cost_center: str=None, start_date=None, end_date=None, enrollment_account_id: str=None, **kwargs) -> None: + super(EnrollmentAccountContext, self).__init__(**kwargs) + self.cost_center = cost_center + self.start_date = start_date + self.end_date = end_date + self.enrollment_account_id = enrollment_account_id diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result.py new file mode 100644 index 000000000000..54c13d580c59 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result.py @@ -0,0 +1,40 @@ +# 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 EnrollmentAccountListResult(Model): + """Result of listing enrollment accounts. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of enrollment accounts. + :vartype value: list[~azure.mgmt.billing.models.EnrollmentAccount] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EnrollmentAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EnrollmentAccountListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result_py3.py new file mode 100644 index 000000000000..1108506a24f3 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result_py3.py @@ -0,0 +1,40 @@ +# 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 EnrollmentAccountListResult(Model): + """Result of listing enrollment accounts. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of enrollment accounts. + :vartype value: list[~azure.mgmt.billing.models.EnrollmentAccount] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EnrollmentAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(EnrollmentAccountListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py index 0d1d9bc36553..69e19f8db3c2 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py @@ -13,7 +13,7 @@ class EnrollmentAccount(Resource): - """An enrollment account resource. + """An account resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -24,24 +24,48 @@ class EnrollmentAccount(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar principal_name: The account owner's principal name. - :vartype principal_name: str + :param account_name: The account name. + :type account_name: str + :param cost_center: The cost center name. + :type cost_center: str + :param account_owner: The account owner + :type account_owner: str + :param status: The status for account. + :type status: str + :param start_date: Account Start Date + :type start_date: datetime + :param end_date: Account End Date + :type end_date: datetime + :param department: Associated department. By default this is not + populated, unless it's specified in $expand. + :type department: ~azure.mgmt.billing.models.Department """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'principal_name': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'principal_name': {'key': 'properties.principalName', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'account_owner': {'key': 'properties.accountOwner', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'start_date': {'key': 'properties.startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, + 'department': {'key': 'properties.department', 'type': 'Department'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, account_name: str=None, cost_center: str=None, account_owner: str=None, status: str=None, start_date=None, end_date=None, department=None, **kwargs) -> None: super(EnrollmentAccount, self).__init__(**kwargs) - self.principal_name = None + self.account_name = account_name + self.cost_center = cost_center + self.account_owner = account_owner + self.status = status + self.start_date = start_date + self.end_date = end_date + self.department = department diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies.py new file mode 100644 index 000000000000..1d85db932e8f --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies.py @@ -0,0 +1,53 @@ +# 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 EnrollmentPolicies(Model): + """The attributes associated with legacy enrollment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_owner_view_charges: The accountOwnerViewCharges flag for + Enrollment + :vartype account_owner_view_charges: bool + :ivar department_admin_view_charges: The departmentAdminViewCharges flag + for Enrollment + :vartype department_admin_view_charges: bool + :ivar marketplaces_enabled: The marketplaces flag for Enrollment + :vartype marketplaces_enabled: bool + :ivar reserved_instances_enabled: The reserved instances flag for + Enrollment + :vartype reserved_instances_enabled: bool + """ + + _validation = { + 'account_owner_view_charges': {'readonly': True}, + 'department_admin_view_charges': {'readonly': True}, + 'marketplaces_enabled': {'readonly': True}, + 'reserved_instances_enabled': {'readonly': True}, + } + + _attribute_map = { + 'account_owner_view_charges': {'key': 'accountOwnerViewCharges', 'type': 'bool'}, + 'department_admin_view_charges': {'key': 'departmentAdminViewCharges', 'type': 'bool'}, + 'marketplaces_enabled': {'key': 'marketplacesEnabled', 'type': 'bool'}, + 'reserved_instances_enabled': {'key': 'reservedInstancesEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(EnrollmentPolicies, self).__init__(**kwargs) + self.account_owner_view_charges = None + self.department_admin_view_charges = None + self.marketplaces_enabled = None + self.reserved_instances_enabled = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies_py3.py new file mode 100644 index 000000000000..171c895e3374 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies_py3.py @@ -0,0 +1,53 @@ +# 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 EnrollmentPolicies(Model): + """The attributes associated with legacy enrollment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_owner_view_charges: The accountOwnerViewCharges flag for + Enrollment + :vartype account_owner_view_charges: bool + :ivar department_admin_view_charges: The departmentAdminViewCharges flag + for Enrollment + :vartype department_admin_view_charges: bool + :ivar marketplaces_enabled: The marketplaces flag for Enrollment + :vartype marketplaces_enabled: bool + :ivar reserved_instances_enabled: The reserved instances flag for + Enrollment + :vartype reserved_instances_enabled: bool + """ + + _validation = { + 'account_owner_view_charges': {'readonly': True}, + 'department_admin_view_charges': {'readonly': True}, + 'marketplaces_enabled': {'readonly': True}, + 'reserved_instances_enabled': {'readonly': True}, + } + + _attribute_map = { + 'account_owner_view_charges': {'key': 'accountOwnerViewCharges', 'type': 'bool'}, + 'department_admin_view_charges': {'key': 'departmentAdminViewCharges', 'type': 'bool'}, + 'marketplaces_enabled': {'key': 'marketplacesEnabled', 'type': 'bool'}, + 'reserved_instances_enabled': {'key': 'reservedInstancesEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs) -> None: + super(EnrollmentPolicies, self).__init__(**kwargs) + self.account_owner_view_charges = None + self.department_admin_view_charges = None + self.marketplaces_enabled = None + self.reserved_instances_enabled = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_py3.py new file mode 100644 index 000000000000..ebe9261ebf6e --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_py3.py @@ -0,0 +1,73 @@ +# 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 Enrollment(Model): + """Current entity level details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param start_date: Enrollment Start Date + :type start_date: datetime + :param end_date: Enrollment End Date + :type end_date: datetime + :ivar currency: The currency associated with enrollment + :vartype currency: str + :ivar channel: The channel for Enrollment + :vartype channel: str + :ivar policies: The attributes associated with legacy enrollment. + :vartype policies: ~azure.mgmt.billing.models.EnrollmentPolicies + :ivar language: The language for Enrollment + :vartype language: str + :ivar country_code: The countryCode for Enrollment + :vartype country_code: str + :ivar status: Enrollment status + :vartype status: str + :ivar billing_cylce: Enrollment billing cycle + :vartype billing_cylce: str + """ + + _validation = { + 'currency': {'readonly': True}, + 'channel': {'readonly': True}, + 'policies': {'readonly': True}, + 'language': {'readonly': True}, + 'country_code': {'readonly': True}, + 'status': {'readonly': True}, + 'billing_cylce': {'readonly': True}, + } + + _attribute_map = { + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + 'currency': {'key': 'currency', 'type': 'str'}, + 'channel': {'key': 'channel', 'type': 'str'}, + 'policies': {'key': 'policies', 'type': 'EnrollmentPolicies'}, + 'language': {'key': 'language', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'billing_cylce': {'key': 'billingCylce', 'type': 'str'}, + } + + def __init__(self, *, start_date=None, end_date=None, **kwargs) -> None: + super(Enrollment, self).__init__(**kwargs) + self.start_date = start_date + self.end_date = end_date + self.currency = None + self.channel = None + self.policies = None + self.language = None + self.country_code = None + self.status = None + self.billing_cylce = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py deleted file mode 100644 index 25e3930f0ce3..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py +++ /dev/null @@ -1,65 +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 .resource import Resource - - -class Invoice(Resource): - """An invoice resource can be used download a PDF version of an invoice. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param download_url: A secure link to download the PDF version of an - invoice. The link will cease to work after its expiry time is reached. - :type download_url: ~azure.mgmt.billing.models.DownloadUrl - :ivar invoice_period_start_date: The start of the date range covered by - the invoice. - :vartype invoice_period_start_date: date - :ivar invoice_period_end_date: The end of the date range covered by the - invoice. - :vartype invoice_period_end_date: date - :ivar billing_period_ids: Array of billing period ids that the invoice is - attributed to. - :vartype billing_period_ids: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'invoice_period_start_date': {'readonly': True}, - 'invoice_period_end_date': {'readonly': True}, - 'billing_period_ids': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'download_url': {'key': 'properties.downloadUrl', 'type': 'DownloadUrl'}, - 'invoice_period_start_date': {'key': 'properties.invoicePeriodStartDate', 'type': 'date'}, - 'invoice_period_end_date': {'key': 'properties.invoicePeriodEndDate', 'type': 'date'}, - 'billing_period_ids': {'key': 'properties.billingPeriodIds', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(Invoice, self).__init__(**kwargs) - self.download_url = kwargs.get('download_url', None) - self.invoice_period_start_date = None - self.invoice_period_end_date = None - self.billing_period_ids = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result.py new file mode 100644 index 000000000000..0e0156b4eaa6 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result.py @@ -0,0 +1,40 @@ +# 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 InvoiceListResult(Model): + """Result of listing invoices. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of invoices. + :vartype value: list[~azure.mgmt.billing.models.InvoiceSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InvoiceSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(InvoiceListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result_py3.py new file mode 100644 index 000000000000..cc7db9c465d8 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result_py3.py @@ -0,0 +1,40 @@ +# 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 InvoiceListResult(Model): + """Result of listing invoices. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of invoices. + :vartype value: list[~azure.mgmt.billing.models.InvoiceSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InvoiceSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(InvoiceListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py deleted file mode 100644 index 9afed4eac660..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py +++ /dev/null @@ -1,65 +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 .resource_py3 import Resource - - -class Invoice(Resource): - """An invoice resource can be used download a PDF version of an invoice. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param download_url: A secure link to download the PDF version of an - invoice. The link will cease to work after its expiry time is reached. - :type download_url: ~azure.mgmt.billing.models.DownloadUrl - :ivar invoice_period_start_date: The start of the date range covered by - the invoice. - :vartype invoice_period_start_date: date - :ivar invoice_period_end_date: The end of the date range covered by the - invoice. - :vartype invoice_period_end_date: date - :ivar billing_period_ids: Array of billing period ids that the invoice is - attributed to. - :vartype billing_period_ids: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'invoice_period_start_date': {'readonly': True}, - 'invoice_period_end_date': {'readonly': True}, - 'billing_period_ids': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'download_url': {'key': 'properties.downloadUrl', 'type': 'DownloadUrl'}, - 'invoice_period_start_date': {'key': 'properties.invoicePeriodStartDate', 'type': 'date'}, - 'invoice_period_end_date': {'key': 'properties.invoicePeriodEndDate', 'type': 'date'}, - 'billing_period_ids': {'key': 'properties.billingPeriodIds', 'type': '[str]'}, - } - - def __init__(self, *, download_url=None, **kwargs) -> None: - super(Invoice, self).__init__(**kwargs) - self.download_url = download_url - self.invoice_period_start_date = None - self.invoice_period_end_date = None - self.billing_period_ids = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_period.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py similarity index 51% rename from azure-mgmt-billing/azure/mgmt/billing/models/billing_period.py rename to azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py index ec1f2039ea1d..00342ac237f9 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_period.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py @@ -12,8 +12,8 @@ from .resource import Resource -class BillingPeriod(Resource): - """A billing period resource. +class InvoiceSection(Resource): + """An InvoiceSection resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -24,36 +24,28 @@ class BillingPeriod(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar billing_period_start_date: The start of the date range covered by - the billing period. - :vartype billing_period_start_date: date - :ivar billing_period_end_date: The end of the date range covered by the - billing period. - :vartype billing_period_end_date: date - :ivar invoice_ids: Array of invoice ids that associated with. - :vartype invoice_ids: list[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 = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'billing_period_start_date': {'readonly': True}, - 'billing_period_end_date': {'readonly': True}, - 'invoice_ids': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'billing_period_start_date': {'key': 'properties.billingPeriodStartDate', 'type': 'date'}, - 'billing_period_end_date': {'key': 'properties.billingPeriodEndDate', 'type': 'date'}, - 'invoice_ids': {'key': 'properties.invoiceIds', 'type': '[str]'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, } def __init__(self, **kwargs): - super(BillingPeriod, self).__init__(**kwargs) - self.billing_period_start_date = None - self.billing_period_end_date = None - self.invoice_ids = None + super(InvoiceSection, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.billing_profiles = kwargs.get('billing_profiles', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result.py new file mode 100644 index 000000000000..cf43e8aede6a --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result.py @@ -0,0 +1,40 @@ +# 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 InvoiceSectionListResult(Model): + """Result of listing invoice sections. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of invoice sections. + :vartype value: list[~azure.mgmt.billing.models.InvoiceSection] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InvoiceSection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(InvoiceSectionListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result_py3.py new file mode 100644 index 000000000000..91d43ba0544d --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result_py3.py @@ -0,0 +1,40 @@ +# 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 InvoiceSectionListResult(Model): + """Result of listing invoice sections. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of invoice sections. + :vartype value: list[~azure.mgmt.billing.models.InvoiceSection] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InvoiceSection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(InvoiceSectionListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties.py new file mode 100644 index 000000000000..0699364eac65 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties.py @@ -0,0 +1,33 @@ +# 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 InvoiceSectionProperties(Model): + """The properties of an InvoiceSection. + + :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] + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'billing_profiles': {'key': 'billingProfiles', 'type': '[BillingProfile]'}, + } + + def __init__(self, **kwargs): + super(InvoiceSectionProperties, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.billing_profiles = kwargs.get('billing_profiles', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties_py3.py new file mode 100644 index 000000000000..27b07396070f --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties_py3.py @@ -0,0 +1,33 @@ +# 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 InvoiceSectionProperties(Model): + """The properties of an InvoiceSection. + + :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] + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'billing_profiles': {'key': 'billingProfiles', 'type': '[BillingProfile]'}, + } + + def __init__(self, *, display_name: str=None, billing_profiles=None, **kwargs) -> None: + super(InvoiceSectionProperties, self).__init__(**kwargs) + self.display_name = display_name + self.billing_profiles = billing_profiles diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py new file mode 100644 index 000000000000..16420f33e703 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class InvoiceSection(Resource): + """An InvoiceSection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :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 = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + '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: + super(InvoiceSection, self).__init__(**kwargs) + self.display_name = display_name + self.billing_profiles = billing_profiles diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py new file mode 100644 index 000000000000..3698b45764ea --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.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. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class InvoiceSummary(Resource): + """An invoice resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar due_date: The due date for invoice. + :vartype due_date: datetime + :ivar invoice_date: The date when invoice was created. + :vartype invoice_date: datetime + :ivar status: Invoice status. Possible values include: 'PastDue', 'Due', + 'Paid', 'Void' + :vartype status: str or ~azure.mgmt.billing.models.enum + :ivar amount_due: Amount due. + :vartype amount_due: ~azure.mgmt.billing.models.Amount + :ivar billed_amount: Amount billed. + :vartype billed_amount: ~azure.mgmt.billing.models.Amount + :ivar invoice_period_start_date: The start date of the billing period. + :vartype invoice_period_start_date: datetime + :ivar invoice_period_end_date: The end date of the billing period. + :vartype invoice_period_end_date: datetime + :ivar billing_profile: The profile id which invoice belongs to. + :vartype billing_profile: str + :ivar billing_profile_name: The profile name which invoice belongs to. + :vartype billing_profile_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 payments: List of payments. + :vartype payments: list[~azure.mgmt.billing.models.PaymentProperties] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'due_date': {'readonly': True}, + 'invoice_date': {'readonly': True}, + 'status': {'readonly': True}, + 'amount_due': {'readonly': True}, + 'billed_amount': {'readonly': True}, + 'invoice_period_start_date': {'readonly': True}, + 'invoice_period_end_date': {'readonly': True}, + 'billing_profile': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'purchase_order_number': {'readonly': True}, + 'document_urls': {'readonly': True}, + 'payments': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'due_date': {'key': 'properties.dueDate', 'type': 'iso-8601'}, + 'invoice_date': {'key': 'properties.invoiceDate', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'amount_due': {'key': 'properties.amountDue', 'type': 'Amount'}, + 'billed_amount': {'key': 'properties.billedAmount', 'type': 'Amount'}, + 'invoice_period_start_date': {'key': 'properties.invoicePeriodStartDate', 'type': 'iso-8601'}, + 'invoice_period_end_date': {'key': 'properties.invoicePeriodEndDate', 'type': 'iso-8601'}, + 'billing_profile': {'key': 'properties.billingProfile', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'purchase_order_number': {'key': 'properties.purchaseOrderNumber', 'type': 'str'}, + 'document_urls': {'key': 'properties.documentUrls', 'type': '[DownloadProperties]'}, + 'payments': {'key': 'properties.payments', 'type': '[PaymentProperties]'}, + } + + def __init__(self, **kwargs): + super(InvoiceSummary, self).__init__(**kwargs) + self.due_date = None + self.invoice_date = None + self.status = None + self.amount_due = None + self.billed_amount = None + self.invoice_period_start_date = None + self.invoice_period_end_date = None + self.billing_profile = None + self.billing_profile_name = None + self.purchase_order_number = None + self.document_urls = None + self.payments = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py new file mode 100644 index 000000000000..0d2a6b98f978 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.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. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class InvoiceSummary(Resource): + """An invoice resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar due_date: The due date for invoice. + :vartype due_date: datetime + :ivar invoice_date: The date when invoice was created. + :vartype invoice_date: datetime + :ivar status: Invoice status. Possible values include: 'PastDue', 'Due', + 'Paid', 'Void' + :vartype status: str or ~azure.mgmt.billing.models.enum + :ivar amount_due: Amount due. + :vartype amount_due: ~azure.mgmt.billing.models.Amount + :ivar billed_amount: Amount billed. + :vartype billed_amount: ~azure.mgmt.billing.models.Amount + :ivar invoice_period_start_date: The start date of the billing period. + :vartype invoice_period_start_date: datetime + :ivar invoice_period_end_date: The end date of the billing period. + :vartype invoice_period_end_date: datetime + :ivar billing_profile: The profile id which invoice belongs to. + :vartype billing_profile: str + :ivar billing_profile_name: The profile name which invoice belongs to. + :vartype billing_profile_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 payments: List of payments. + :vartype payments: list[~azure.mgmt.billing.models.PaymentProperties] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'due_date': {'readonly': True}, + 'invoice_date': {'readonly': True}, + 'status': {'readonly': True}, + 'amount_due': {'readonly': True}, + 'billed_amount': {'readonly': True}, + 'invoice_period_start_date': {'readonly': True}, + 'invoice_period_end_date': {'readonly': True}, + 'billing_profile': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'purchase_order_number': {'readonly': True}, + 'document_urls': {'readonly': True}, + 'payments': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'due_date': {'key': 'properties.dueDate', 'type': 'iso-8601'}, + 'invoice_date': {'key': 'properties.invoiceDate', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'amount_due': {'key': 'properties.amountDue', 'type': 'Amount'}, + 'billed_amount': {'key': 'properties.billedAmount', 'type': 'Amount'}, + 'invoice_period_start_date': {'key': 'properties.invoicePeriodStartDate', 'type': 'iso-8601'}, + 'invoice_period_end_date': {'key': 'properties.invoicePeriodEndDate', 'type': 'iso-8601'}, + 'billing_profile': {'key': 'properties.billingProfile', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'purchase_order_number': {'key': 'properties.purchaseOrderNumber', 'type': 'str'}, + 'document_urls': {'key': 'properties.documentUrls', 'type': '[DownloadProperties]'}, + 'payments': {'key': 'properties.payments', 'type': '[PaymentProperties]'}, + } + + def __init__(self, **kwargs) -> None: + super(InvoiceSummary, self).__init__(**kwargs) + self.due_date = None + self.invoice_date = None + self.status = None + self.amount_due = None + self.billed_amount = None + self.invoice_period_start_date = None + self.invoice_period_end_date = None + self.billing_profile = None + self.billing_profile_name = None + self.purchase_order_number = None + self.document_urls = None + self.payments = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/operation_status.py b/azure-mgmt-billing/azure/mgmt/billing/models/operation_status.py new file mode 100644 index 000000000000..b4bd9e976219 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/operation_status.py @@ -0,0 +1,43 @@ +# 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/azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py new file mode 100644 index 000000000000..325cee1d2b7e --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py @@ -0,0 +1,43 @@ +# 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/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py b/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py new file mode 100644 index 000000000000..a9cd09cf9799 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class PaymentMethod(Resource): + """A payment method resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param method_type: Payment method type. Possible values include: + 'Credits', 'ChequeWire' + :type method_type: str or ~azure.mgmt.billing.models.PaymentMethodType + :ivar details: Details about the payment method. + :vartype details: str + :ivar expiration: Expiration date. + :vartype expiration: datetime + :ivar currency: The currency associated with the payment method. + :vartype currency: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'details': {'readonly': True}, + 'expiration': {'readonly': True}, + 'currency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'method_type': {'key': 'properties.methodType', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + 'expiration': {'key': 'properties.expiration', 'type': 'iso-8601'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PaymentMethod, self).__init__(**kwargs) + self.method_type = kwargs.get('method_type', None) + self.details = None + self.expiration = None + self.currency = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_paged.py b/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_paged.py similarity index 69% rename from azure-mgmt-billing/azure/mgmt/billing/models/invoice_paged.py rename to azure-mgmt-billing/azure/mgmt/billing/models/payment_method_paged.py index 500bcafab923..ff52f6b8b2b7 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/invoice_paged.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class InvoicePaged(Paged): +class PaymentMethodPaged(Paged): """ - A paging container for iterating over a list of :class:`Invoice ` object + A paging container for iterating over a list of :class:`PaymentMethod ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Invoice]'} + 'current_page': {'key': 'value', 'type': '[PaymentMethod]'} } def __init__(self, *args, **kwargs): - super(InvoicePaged, self).__init__(*args, **kwargs) + super(PaymentMethodPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py new file mode 100644 index 000000000000..6a2e1b485c99 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class PaymentMethod(Resource): + """A payment method resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param method_type: Payment method type. Possible values include: + 'Credits', 'ChequeWire' + :type method_type: str or ~azure.mgmt.billing.models.PaymentMethodType + :ivar details: Details about the payment method. + :vartype details: str + :ivar expiration: Expiration date. + :vartype expiration: datetime + :ivar currency: The currency associated with the payment method. + :vartype currency: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'details': {'readonly': True}, + 'expiration': {'readonly': True}, + 'currency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'method_type': {'key': 'properties.methodType', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + 'expiration': {'key': 'properties.expiration', 'type': 'iso-8601'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + } + + def __init__(self, *, method_type=None, **kwargs) -> None: + super(PaymentMethod, self).__init__(**kwargs) + self.method_type = method_type + self.details = None + self.expiration = None + self.currency = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties.py b/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties.py new file mode 100644 index 000000000000..8b5251d71703 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties.py @@ -0,0 +1,45 @@ +# 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 PaymentProperties(Model): + """The properties of the payment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar payment_type: The type of payment. + :vartype payment_type: str + :ivar amount: The paid amount. + :vartype amount: ~azure.mgmt.billing.models.Amount + :ivar date_property: The date of the payment. + :vartype date_property: datetime + """ + + _validation = { + 'payment_type': {'readonly': True}, + 'amount': {'readonly': True}, + 'date_property': {'readonly': True}, + } + + _attribute_map = { + 'payment_type': {'key': 'paymentType', 'type': 'str'}, + 'amount': {'key': 'amount', 'type': 'Amount'}, + 'date_property': {'key': 'date', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(PaymentProperties, self).__init__(**kwargs) + self.payment_type = None + self.amount = None + self.date_property = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties_py3.py new file mode 100644 index 000000000000..76ebc09376af --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties_py3.py @@ -0,0 +1,45 @@ +# 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 PaymentProperties(Model): + """The properties of the payment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar payment_type: The type of payment. + :vartype payment_type: str + :ivar amount: The paid amount. + :vartype amount: ~azure.mgmt.billing.models.Amount + :ivar date_property: The date of the payment. + :vartype date_property: datetime + """ + + _validation = { + 'payment_type': {'readonly': True}, + 'amount': {'readonly': True}, + 'date_property': {'readonly': True}, + } + + _attribute_map = { + 'payment_type': {'key': 'paymentType', 'type': 'str'}, + 'amount': {'key': 'amount', 'type': 'Amount'}, + 'date_property': {'key': 'date', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(PaymentProperties, self).__init__(**kwargs) + self.payment_type = None + self.amount = None + self.date_property = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/policy.py b/azure-mgmt-billing/azure/mgmt/billing/models/policy.py new file mode 100644 index 000000000000..3f4d47ed064d --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/policy.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Policy(Resource): + """The Policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param reservation_purchases_allowed: The reservationPurchasesAllowed + flag. + :type reservation_purchases_allowed: bool + :param marketplace_purchases_allowed: The marketplacePurchasesAllowed + flag. + :type marketplace_purchases_allowed: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'reservation_purchases_allowed': {'key': 'properties.reservationPurchasesAllowed', 'type': 'bool'}, + 'marketplace_purchases_allowed': {'key': 'properties.marketplacePurchasesAllowed', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(Policy, self).__init__(**kwargs) + self.reservation_purchases_allowed = kwargs.get('reservation_purchases_allowed', None) + self.marketplace_purchases_allowed = kwargs.get('marketplace_purchases_allowed', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py new file mode 100644 index 000000000000..aef3034f2654 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class Policy(Resource): + """The Policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param reservation_purchases_allowed: The reservationPurchasesAllowed + flag. + :type reservation_purchases_allowed: bool + :param marketplace_purchases_allowed: The marketplacePurchasesAllowed + flag. + :type marketplace_purchases_allowed: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'reservation_purchases_allowed': {'key': 'properties.reservationPurchasesAllowed', 'type': 'bool'}, + 'marketplace_purchases_allowed': {'key': 'properties.marketplacePurchasesAllowed', 'type': 'bool'}, + } + + def __init__(self, *, reservation_purchases_allowed: bool=None, marketplace_purchases_allowed: bool=None, **kwargs) -> None: + super(Policy, self).__init__(**kwargs) + self.reservation_purchases_allowed = reservation_purchases_allowed + self.marketplace_purchases_allowed = marketplace_purchases_allowed diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/product_summary.py b/azure-mgmt-billing/azure/mgmt/billing/models/product_summary.py new file mode 100644 index 000000000000..8ff4b299b84c --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/product_summary.py @@ -0,0 +1,138 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ProductSummary(Resource): + """A product summary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: The display name of the product. + :vartype display_name: str + :ivar purchase_date: The date of purchase. + :vartype purchase_date: datetime + :ivar product_type_id: The product type id. + :vartype product_type_id: str + :ivar product_type: The type of product. + :vartype product_type: str + :param status: Product status. Possible values include: 'Active', + 'Inactive', 'PastDue', 'Expiring', 'Expired', 'Disabled', 'Cancelled', + 'AutoRenew' + :type status: str or ~azure.mgmt.billing.models.ProductStatusType + :ivar end_date: end date. + :vartype end_date: datetime + :param billing_frequency: Billing frequency. Possible values include: + 'OneTime', 'Monthly', 'UsageBased' + :type billing_frequency: str or + ~azure.mgmt.billing.models.BillingFrequency + :ivar last_charge: Last month charges. + :vartype last_charge: ~azure.mgmt.billing.models.Amount + :ivar last_charge_date: The date of the last charge. + :vartype last_charge_date: datetime + :ivar quantity: The purchased product quantity. + :vartype quantity: float + :ivar sku_id: Sku Id. + :vartype sku_id: str + :ivar sku_description: Sku description. + :vartype sku_description: str + :ivar availability_id: Availability Id. + :vartype availability_id: str + :ivar parent_product_id: Parent Product Id. + :vartype parent_product_id: 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 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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'purchase_date': {'readonly': True}, + 'product_type_id': {'readonly': True}, + 'product_type': {'readonly': True}, + 'end_date': {'readonly': True}, + 'last_charge': {'readonly': True}, + 'last_charge_date': {'readonly': True}, + 'quantity': {'readonly': True}, + 'sku_id': {'readonly': True}, + 'sku_description': {'readonly': True}, + 'availability_id': {'readonly': True}, + 'parent_product_id': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'purchase_date': {'key': 'properties.purchaseDate', 'type': 'iso-8601'}, + 'product_type_id': {'key': 'properties.productTypeId', 'type': 'str'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, + 'billing_frequency': {'key': 'properties.billingFrequency', 'type': 'str'}, + 'last_charge': {'key': 'properties.lastCharge', 'type': 'Amount'}, + 'last_charge_date': {'key': 'properties.lastChargeDate', 'type': 'iso-8601'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, + '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'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProductSummary, self).__init__(**kwargs) + self.display_name = None + self.purchase_date = None + self.product_type_id = None + self.product_type = None + self.status = kwargs.get('status', None) + self.end_date = None + self.billing_frequency = kwargs.get('billing_frequency', None) + self.last_charge = None + self.last_charge_date = None + self.quantity = None + self.sku_id = None + self.sku_description = None + self.availability_id = None + self.parent_product_id = None + self.invoice_section_id = None + self.invoice_section_name = None + self.billing_profile_id = None + self.billing_profile_name = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_paged.py b/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_paged.py similarity index 67% rename from azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_paged.py rename to azure-mgmt-billing/azure/mgmt/billing/models/product_summary_paged.py index bf852a37e1b1..d34d96d175af 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_paged.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class EnrollmentAccountPaged(Paged): +class ProductSummaryPaged(Paged): """ - A paging container for iterating over a list of :class:`EnrollmentAccount ` object + A paging container for iterating over a list of :class:`ProductSummary ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[EnrollmentAccount]'} + 'current_page': {'key': 'value', 'type': '[ProductSummary]'} } def __init__(self, *args, **kwargs): - super(EnrollmentAccountPaged, self).__init__(*args, **kwargs) + super(ProductSummaryPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_py3.py new file mode 100644 index 000000000000..182b96e9526f --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_py3.py @@ -0,0 +1,138 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class ProductSummary(Resource): + """A product summary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: The display name of the product. + :vartype display_name: str + :ivar purchase_date: The date of purchase. + :vartype purchase_date: datetime + :ivar product_type_id: The product type id. + :vartype product_type_id: str + :ivar product_type: The type of product. + :vartype product_type: str + :param status: Product status. Possible values include: 'Active', + 'Inactive', 'PastDue', 'Expiring', 'Expired', 'Disabled', 'Cancelled', + 'AutoRenew' + :type status: str or ~azure.mgmt.billing.models.ProductStatusType + :ivar end_date: end date. + :vartype end_date: datetime + :param billing_frequency: Billing frequency. Possible values include: + 'OneTime', 'Monthly', 'UsageBased' + :type billing_frequency: str or + ~azure.mgmt.billing.models.BillingFrequency + :ivar last_charge: Last month charges. + :vartype last_charge: ~azure.mgmt.billing.models.Amount + :ivar last_charge_date: The date of the last charge. + :vartype last_charge_date: datetime + :ivar quantity: The purchased product quantity. + :vartype quantity: float + :ivar sku_id: Sku Id. + :vartype sku_id: str + :ivar sku_description: Sku description. + :vartype sku_description: str + :ivar availability_id: Availability Id. + :vartype availability_id: str + :ivar parent_product_id: Parent Product Id. + :vartype parent_product_id: 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 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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'purchase_date': {'readonly': True}, + 'product_type_id': {'readonly': True}, + 'product_type': {'readonly': True}, + 'end_date': {'readonly': True}, + 'last_charge': {'readonly': True}, + 'last_charge_date': {'readonly': True}, + 'quantity': {'readonly': True}, + 'sku_id': {'readonly': True}, + 'sku_description': {'readonly': True}, + 'availability_id': {'readonly': True}, + 'parent_product_id': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'purchase_date': {'key': 'properties.purchaseDate', 'type': 'iso-8601'}, + 'product_type_id': {'key': 'properties.productTypeId', 'type': 'str'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, + 'billing_frequency': {'key': 'properties.billingFrequency', 'type': 'str'}, + 'last_charge': {'key': 'properties.lastCharge', 'type': 'Amount'}, + 'last_charge_date': {'key': 'properties.lastChargeDate', 'type': 'iso-8601'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, + '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'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + } + + def __init__(self, *, status=None, billing_frequency=None, **kwargs) -> None: + super(ProductSummary, self).__init__(**kwargs) + self.display_name = None + self.purchase_date = None + self.product_type_id = None + self.product_type = None + self.status = status + self.end_date = None + self.billing_frequency = billing_frequency + self.last_charge = None + self.last_charge_date = None + self.quantity = None + self.sku_id = None + self.sku_description = None + self.availability_id = None + self.parent_product_id = None + self.invoice_section_id = None + self.invoice_section_name = None + self.billing_profile_id = None + self.billing_profile_name = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result.py new file mode 100644 index 000000000000..3bafba7449aa --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result.py @@ -0,0 +1,41 @@ +# 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 ProductsListResult(Model): + """Result of listing products summary. 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 next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProductSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProductsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result_py3.py new file mode 100644 index 000000000000..d8afea8a7d89 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result_py3.py @@ -0,0 +1,41 @@ +# 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 ProductsListResult(Model): + """Result of listing products summary. 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 next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProductSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProductsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result.py new file mode 100644 index 000000000000..156d834158bf --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result.py @@ -0,0 +1,40 @@ +# 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 TransactionsListResult(Model): + """Result of listing reservation transactions summary. + + 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 next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TransactionsSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TransactionsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result_py3.py new file mode 100644 index 000000000000..621cb39dc478 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result_py3.py @@ -0,0 +1,40 @@ +# 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 TransactionsListResult(Model): + """Result of listing reservation transactions summary. + + 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 next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TransactionsSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TransactionsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py new file mode 100644 index 000000000000..9dd286bb63bb --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py @@ -0,0 +1,131 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class TransactionsSummary(Resource): + """A reservation transaction summary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param kind: The kind of transaction. Choices are all and reservation. + Possible values include: 'all', 'reservation' + :type kind: str or ~azure.mgmt.billing.models.TransactionTypeKind + :ivar date_property: The date of reservation transaction. + :vartype date_property: datetime + :ivar invoice: Invoice number or 'pending' if not invoiced. + :vartype invoice: str + :ivar order_id: The reservation order id. + :vartype order_id: str + :ivar order_name: The reservation order name. + :vartype order_name: str + :ivar product_type_id: The product type id. + :vartype product_type_id: str + :ivar product_type: The type of product. + :vartype product_type: str + :ivar product_description: Product description. + :vartype product_description: str + :param transaction_type: Transaction types. Possible values include: + 'Purchase', 'Usage Charge' + :type transaction_type: str or ~azure.mgmt.billing.models.ReservationType + :ivar transaction_amount: Last charge associated with the purchase. + :vartype transaction_amount: ~azure.mgmt.billing.models.Amount + :ivar quantity: Purchase quantity. + :vartype quantity: int + :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 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 subscription_id: The subscription id. + :vartype subscription_id: str + :ivar subscription_name: The subscription name. + :vartype subscription_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'date_property': {'readonly': True}, + 'invoice': {'readonly': True}, + 'order_id': {'readonly': True}, + 'order_name': {'readonly': True}, + 'product_type_id': {'readonly': True}, + 'product_type': {'readonly': True}, + 'product_description': {'readonly': True}, + 'transaction_amount': {'readonly': True}, + 'quantity': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'subscription_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'properties.kind', 'type': 'str'}, + 'date_property': {'key': 'properties.date', 'type': 'iso-8601'}, + 'invoice': {'key': 'properties.invoice', 'type': 'str'}, + 'order_id': {'key': 'properties.orderId', 'type': 'str'}, + 'order_name': {'key': 'properties.orderName', 'type': 'str'}, + 'product_type_id': {'key': 'properties.productTypeId', 'type': 'str'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'product_description': {'key': 'properties.productDescription', 'type': 'str'}, + 'transaction_type': {'key': 'properties.transactionType', 'type': 'str'}, + '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'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', '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) + self.kind = kwargs.get('kind', None) + self.date_property = None + self.invoice = None + self.order_id = None + self.order_name = None + self.product_type_id = None + self.product_type = None + self.product_description = None + self.transaction_type = kwargs.get('transaction_type', None) + self.transaction_amount = None + self.quantity = None + self.invoice_section_id = None + self.invoice_section_name = None + self.billing_profile_id = None + self.billing_profile_name = None + self.subscription_id = None + self.subscription_name = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_paged.py b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_paged.py new file mode 100644 index 000000000000..f1626e6b12ab --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class TransactionsSummaryPaged(Paged): + """ + A paging container for iterating over a list of :class:`TransactionsSummary ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TransactionsSummary]'} + } + + def __init__(self, *args, **kwargs): + + super(TransactionsSummaryPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py new file mode 100644 index 000000000000..7d51ec8bec74 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py @@ -0,0 +1,131 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class TransactionsSummary(Resource): + """A reservation transaction summary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param kind: The kind of transaction. Choices are all and reservation. + Possible values include: 'all', 'reservation' + :type kind: str or ~azure.mgmt.billing.models.TransactionTypeKind + :ivar date_property: The date of reservation transaction. + :vartype date_property: datetime + :ivar invoice: Invoice number or 'pending' if not invoiced. + :vartype invoice: str + :ivar order_id: The reservation order id. + :vartype order_id: str + :ivar order_name: The reservation order name. + :vartype order_name: str + :ivar product_type_id: The product type id. + :vartype product_type_id: str + :ivar product_type: The type of product. + :vartype product_type: str + :ivar product_description: Product description. + :vartype product_description: str + :param transaction_type: Transaction types. Possible values include: + 'Purchase', 'Usage Charge' + :type transaction_type: str or ~azure.mgmt.billing.models.ReservationType + :ivar transaction_amount: Last charge associated with the purchase. + :vartype transaction_amount: ~azure.mgmt.billing.models.Amount + :ivar quantity: Purchase quantity. + :vartype quantity: int + :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 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 subscription_id: The subscription id. + :vartype subscription_id: str + :ivar subscription_name: The subscription name. + :vartype subscription_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'date_property': {'readonly': True}, + 'invoice': {'readonly': True}, + 'order_id': {'readonly': True}, + 'order_name': {'readonly': True}, + 'product_type_id': {'readonly': True}, + 'product_type': {'readonly': True}, + 'product_description': {'readonly': True}, + 'transaction_amount': {'readonly': True}, + 'quantity': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'subscription_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'properties.kind', 'type': 'str'}, + 'date_property': {'key': 'properties.date', 'type': 'iso-8601'}, + 'invoice': {'key': 'properties.invoice', 'type': 'str'}, + 'order_id': {'key': 'properties.orderId', 'type': 'str'}, + 'order_name': {'key': 'properties.orderName', 'type': 'str'}, + 'product_type_id': {'key': 'properties.productTypeId', 'type': 'str'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'product_description': {'key': 'properties.productDescription', 'type': 'str'}, + 'transaction_type': {'key': 'properties.transactionType', 'type': 'str'}, + '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'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', '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) + self.kind = kind + self.date_property = None + self.invoice = None + self.order_id = None + self.order_name = None + self.product_type_id = None + self.product_type = None + self.product_description = None + self.transaction_type = transaction_type + self.transaction_amount = None + self.quantity = None + self.invoice_section_id = None + self.invoice_section_name = None + self.billing_profile_id = None + self.billing_profile_name = None + self.subscription_id = None + self.subscription_name = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py new file mode 100644 index 000000000000..644eb4e804f8 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TransferBillingSubscriptionRequest(Model): + """Request parameters to transfer billing subscription. + + :param destination_invoice_section_id: The destination invoiceSectionId. + :type destination_invoice_section_id: str + """ + + _attribute_map = { + 'destination_invoice_section_id': {'key': 'properties.destinationInvoiceSectionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TransferBillingSubscriptionRequest, self).__init__(**kwargs) + self.destination_invoice_section_id = kwargs.get('destination_invoice_section_id', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py new file mode 100644 index 000000000000..c72ba7021efb --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TransferBillingSubscriptionRequestProperties(Model): + """Request parameters to transfer billing subscription. + + :param destination_invoice_section_id: The destination invoiceSectionId. + :type destination_invoice_section_id: str + """ + + _attribute_map = { + 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TransferBillingSubscriptionRequestProperties, self).__init__(**kwargs) + self.destination_invoice_section_id = kwargs.get('destination_invoice_section_id', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py new file mode 100644 index 000000000000..2aad5ad5cce0 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TransferBillingSubscriptionRequestProperties(Model): + """Request parameters to transfer billing subscription. + + :param destination_invoice_section_id: The destination invoiceSectionId. + :type destination_invoice_section_id: str + """ + + _attribute_map = { + 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, + } + + def __init__(self, *, destination_invoice_section_id: str=None, **kwargs) -> None: + super(TransferBillingSubscriptionRequestProperties, self).__init__(**kwargs) + self.destination_invoice_section_id = destination_invoice_section_id diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py new file mode 100644 index 000000000000..1256de722471 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TransferBillingSubscriptionRequest(Model): + """Request parameters to transfer billing subscription. + + :param destination_invoice_section_id: The destination invoiceSectionId. + :type destination_invoice_section_id: str + """ + + _attribute_map = { + 'destination_invoice_section_id': {'key': 'properties.destinationInvoiceSectionId', 'type': 'str'}, + } + + def __init__(self, *, destination_invoice_section_id: str=None, **kwargs) -> None: + super(TransferBillingSubscriptionRequest, self).__init__(**kwargs) + self.destination_invoice_section_id = destination_invoice_section_id diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result.py new file mode 100644 index 000000000000..a3a4b5c4e5c9 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TransferBillingSubscriptionResult(Model): + """Request parameters to transfer billing subscription. + + :param billing_subscription_id: The destination billing subscription id. + :type billing_subscription_id: str + """ + + _attribute_map = { + 'billing_subscription_id': {'key': 'properties.billingSubscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TransferBillingSubscriptionResult, self).__init__(**kwargs) + self.billing_subscription_id = kwargs.get('billing_subscription_id', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result_py3.py new file mode 100644 index 000000000000..7fe20ee4ea05 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TransferBillingSubscriptionResult(Model): + """Request parameters to transfer billing subscription. + + :param billing_subscription_id: The destination billing subscription id. + :type billing_subscription_id: str + """ + + _attribute_map = { + 'billing_subscription_id': {'key': 'properties.billingSubscriptionId', 'type': 'str'}, + } + + def __init__(self, *, billing_subscription_id: str=None, **kwargs) -> None: + super(TransferBillingSubscriptionResult, self).__init__(**kwargs) + self.billing_subscription_id = billing_subscription_id diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py new file mode 100644 index 000000000000..9feaa795f8f8 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TransferProductRequestProperties(Model): + """The properties of the product to initiate a transfer. + + :param destination_invoice_section_id: Destination invoice section id. + :type destination_invoice_section_id: str + """ + + _attribute_map = { + 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TransferProductRequestProperties, self).__init__(**kwargs) + self.destination_invoice_section_id = kwargs.get('destination_invoice_section_id', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py new file mode 100644 index 000000000000..029af2856f0e --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TransferProductRequestProperties(Model): + """The properties of the product to initiate a transfer. + + :param destination_invoice_section_id: Destination invoice section id. + :type destination_invoice_section_id: str + """ + + _attribute_map = { + 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, + } + + def __init__(self, *, destination_invoice_section_id: str=None, **kwargs) -> None: + super(TransferProductRequestProperties, self).__init__(**kwargs) + self.destination_invoice_section_id = destination_invoice_section_id diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary.py b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary.py new file mode 100644 index 000000000000..58c13360fb33 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UpdateAutoRenewOperationSummary(Model): + """Summary of cancel product operation. + + :param end_date: The end date of this asset + :type end_date: datetime + """ + + _attribute_map = { + 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(UpdateAutoRenewOperationSummary, self).__init__(**kwargs) + self.end_date = kwargs.get('end_date', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary_py3.py new file mode 100644 index 000000000000..df7e37b21cd6 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UpdateAutoRenewOperationSummary(Model): + """Summary of cancel product operation. + + :param end_date: The end date of this asset + :type end_date: datetime + """ + + _attribute_map = { + 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, + } + + def __init__(self, *, end_date=None, **kwargs) -> None: + super(UpdateAutoRenewOperationSummary, self).__init__(**kwargs) + self.end_date = end_date diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request.py b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request.py new file mode 100644 index 000000000000..0fc17045c814 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request.py @@ -0,0 +1,29 @@ +# 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 UpdateAutoRenewRequest(Model): + """Request parameters to update auto renew for support prouct. + + :param auto_renew: Request parameters to update auto renew policy a + product. Possible values include: 'true', 'false' + :type auto_renew: str or ~azure.mgmt.billing.models.UpdateAutoRenew + """ + + _attribute_map = { + 'auto_renew': {'key': 'autoRenew', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateAutoRenewRequest, self).__init__(**kwargs) + self.auto_renew = kwargs.get('auto_renew', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request_py3.py new file mode 100644 index 000000000000..f2b5638c9370 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request_py3.py @@ -0,0 +1,29 @@ +# 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 UpdateAutoRenewRequest(Model): + """Request parameters to update auto renew for support prouct. + + :param auto_renew: Request parameters to update auto renew policy a + product. Possible values include: 'true', 'false' + :type auto_renew: str or ~azure.mgmt.billing.models.UpdateAutoRenew + """ + + _attribute_map = { + 'auto_renew': {'key': 'autoRenew', 'type': 'str'}, + } + + def __init__(self, *, auto_renew=None, **kwargs) -> None: + super(UpdateAutoRenewRequest, self).__init__(**kwargs) + self.auto_renew = auto_renew diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index c3d1d198514e..3a4aaf28ed66 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -9,14 +9,60 @@ # regenerated. # -------------------------------------------------------------------------- +from .billing_accounts_operations import BillingAccountsOperations +from .billing_accounts_with_create_invoice_section_permission_operations import BillingAccountsWithCreateInvoiceSectionPermissionOperations +from .payment_methods_by_billing_profile_operations import PaymentMethodsByBillingProfileOperations +from .billing_profiles_by_billing_account_id_operations import BillingProfilesByBillingAccountIdOperations +from .billing_profiles_operations import BillingProfilesOperations +from .invoice_sections_by_billing_account_id_operations import InvoiceSectionsByBillingAccountIdOperations +from .invoice_sections_operations import InvoiceSectionsOperations +from .invoice_sections_with_create_subscription_permission_operations import InvoiceSectionsWithCreateSubscriptionPermissionOperations +from .departments_by_billing_account_id_operations import DepartmentsByBillingAccountIdOperations +from .departments_operations import DepartmentsOperations +from .enrollment_accounts_by_billing_account_id_operations import EnrollmentAccountsByBillingAccountIdOperations from .enrollment_accounts_operations import EnrollmentAccountsOperations -from .billing_periods_operations import BillingPeriodsOperations -from .invoices_operations import InvoicesOperations +from .invoices_by_billing_account_operations import InvoicesByBillingAccountOperations +from .invoice_pricesheet_operations import InvoicePricesheetOperations +from .invoices_by_billing_profile_operations import InvoicesByBillingProfileOperations +from .invoice_operations import InvoiceOperations +from .products_by_billing_subscriptions_operations import ProductsByBillingSubscriptionsOperations +from .billing_subscriptions_by_billing_profile_operations import BillingSubscriptionsByBillingProfileOperations +from .billing_subscriptions_by_invoice_section_operations import BillingSubscriptionsByInvoiceSectionOperations +from .billing_subscription_operations import BillingSubscriptionOperations +from .products_by_billing_account_operations import ProductsByBillingAccountOperations +from .products_by_invoice_section_operations import ProductsByInvoiceSectionOperations +from .products_operations import ProductsOperations +from .transactions_by_billing_account_operations import TransactionsByBillingAccountOperations +from .policy_operations import PolicyOperations +from .billing_property_operations import BillingPropertyOperations from .operations import Operations __all__ = [ + 'BillingAccountsOperations', + 'BillingAccountsWithCreateInvoiceSectionPermissionOperations', + 'PaymentMethodsByBillingProfileOperations', + 'BillingProfilesByBillingAccountIdOperations', + 'BillingProfilesOperations', + 'InvoiceSectionsByBillingAccountIdOperations', + 'InvoiceSectionsOperations', + 'InvoiceSectionsWithCreateSubscriptionPermissionOperations', + 'DepartmentsByBillingAccountIdOperations', + 'DepartmentsOperations', + 'EnrollmentAccountsByBillingAccountIdOperations', 'EnrollmentAccountsOperations', - 'BillingPeriodsOperations', - 'InvoicesOperations', + 'InvoicesByBillingAccountOperations', + 'InvoicePricesheetOperations', + 'InvoicesByBillingProfileOperations', + 'InvoiceOperations', + 'ProductsByBillingSubscriptionsOperations', + 'BillingSubscriptionsByBillingProfileOperations', + 'BillingSubscriptionsByInvoiceSectionOperations', + 'BillingSubscriptionOperations', + 'ProductsByBillingAccountOperations', + 'ProductsByInvoiceSectionOperations', + 'ProductsOperations', + 'TransactionsByBillingAccountOperations', + 'PolicyOperations', + 'BillingPropertyOperations', 'Operations', ] diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py new file mode 100644 index 000000000000..1bc83a3badf0 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py @@ -0,0 +1,155 @@ +# 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 BillingAccountsOperations(object): + """BillingAccountsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, 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 + 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: BillingAccountListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingAccountListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + + # 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('BillingAccountListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts'} + + def get( + self, billing_account_id, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the billing account by id. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param expand: May be used to expand the invoiceSections and + 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: BillingAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingAccount or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + 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('BillingAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_with_create_invoice_section_permission_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_with_create_invoice_section_permission_operations.py new file mode 100644 index 000000000000..fe37879251b8 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_with_create_invoice_section_permission_operations.py @@ -0,0 +1,94 @@ +# 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 BillingAccountsWithCreateInvoiceSectionPermissionOperations(object): + """BillingAccountsWithCreateInvoiceSectionPermissionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all billing accounts with create invoiceSection permission for a + user. + + :param expand: May be used to expand the invoiceSections and + 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: BillingAccountListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingAccountListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + + # 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('BillingAccountListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/listBillingAccountsWithCreateInvoiceSectionPermission'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_periods_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_periods_operations.py deleted file mode 100644 index 337a3d705411..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_periods_operations.py +++ /dev/null @@ -1,183 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class BillingPeriodsOperations(object): - """BillingPeriodsOperations 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-03-01-preview. Constant value: "2018-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-03-01-preview" - - self.config = config - - def list( - self, filter=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the available billing periods for a subscription in reverse - chronological order. This is only supported for Azure Web-Direct - subscriptions. Other subscription types which were not purchased - directly through the Azure web portal are not supported through this - preview API. - - :param filter: May be used to filter billing periods by - billingPeriodEndDate. The filter supports 'eq', 'lt', 'gt', 'le', - 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - :type filter: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N billing periods. - :type top: int - :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 BillingPeriod - :rtype: - ~azure.mgmt.billing.models.BillingPeriodPaged[~azure.mgmt.billing.models.BillingPeriod] - :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 = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=100, minimum=1) - - 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.BillingPeriodPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.BillingPeriodPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods'} - - def get( - self, billing_period_name, custom_headers=None, raw=False, **operation_config): - """Gets a named billing period. This is only supported for Azure - Web-Direct subscriptions. Other subscription types which were not - purchased directly through the Azure web portal are not supported - through this preview API. - - :param billing_period_name: The name of a BillingPeriod resource. - :type billing_period_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: BillingPeriod or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.BillingPeriod or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'billingPeriodName': self._serialize.url("billing_period_name", billing_period_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('BillingPeriod', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_by_billing_account_id_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_by_billing_account_id_operations.py new file mode 100644 index 000000000000..3ecd2dd6e428 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_by_billing_account_id_operations.py @@ -0,0 +1,98 @@ +# 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 BillingProfilesByBillingAccountIdOperations(object): + """BillingProfilesByBillingAccountIdOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_id, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all billing profiles for a user which that user has access to. + + :param billing_account_id: billing Account Id. + :type billing_account_id: 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: BillingProfileListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingProfileListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + 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('BillingProfileListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py new file mode 100644 index 000000000000..6c3a8f73d71f --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py @@ -0,0 +1,213 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class BillingProfilesOperations(object): + """BillingProfilesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_id, billing_profile_id, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the billing profile by id. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param billing_profile_id: Billing Profile Id. + :type billing_profile_id: 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 = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + 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/{billingAccountId}/billingProfiles/{billingProfileId}'} + + + def _update_initial( + self, billing_account_id, billing_profile_id, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 'BillingProfile') + + # Construct and send request + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('BillingProfile', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def update( + self, billing_account_id, billing_profile_id, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to update a billing profile. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param billing_profile_id: Billing Profile Id. + :type billing_profile_id: str + :param parameters: 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 + 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 BillingProfile or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.BillingProfile] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.BillingProfile]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._update_initial( + billing_account_id=billing_account_id, + billing_profile_id=billing_profile_id, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + deserialized = self._deserialize('BillingProfile', 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) + update.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_property_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_property_operations.py new file mode 100644 index 000000000000..38d4ca1f0ce3 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_property_operations.py @@ -0,0 +1,92 @@ +# 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 BillingPropertyOperations(object): + """BillingPropertyOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, custom_headers=None, raw=False, **operation_config): + """Get billing property by subscription Id. + + :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: BillingProperty or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingProperty or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingProperty', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingProperty'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py new file mode 100644 index 000000000000..35491decba02 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py @@ -0,0 +1,218 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class BillingSubscriptionOperations(object): + """BillingSubscriptionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_id, invoice_section_id, billing_subscription_id, custom_headers=None, raw=False, **operation_config): + """Get a single billing subscription by name. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param invoice_section_id: InvoiceSection Id. + :type invoice_section_id: str + :param billing_subscription_id: Billing Subscription Id. + :type billing_subscription_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: BillingSubscriptionSummary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingSubscriptionSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'invoiceSectionId': self._serialize.url("invoice_section_id", invoice_section_id, 'str'), + 'billingSubscriptionId': self._serialize.url("billing_subscription_id", billing_subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingSubscriptionSummary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}/billingSubscriptions/{billingSubscriptionId}'} + + + def _transfer_initial( + self, billing_account_id, invoice_section_id, destination_invoice_section_id=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TransferBillingSubscriptionRequestProperties(destination_invoice_section_id=destination_invoice_section_id) + + # Construct URL + url = self.transfer.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'invoiceSectionId': self._serialize.url("invoice_section_id", invoice_section_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # 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, 'TransferBillingSubscriptionRequestProperties') + + # 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('TransferBillingSubscriptionResult', 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 transfer( + self, billing_account_id, invoice_section_id, destination_invoice_section_id=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Transfers the GTM subscription from one invoice section to another + within a billing account. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param invoice_section_id: InvoiceSection Id. + :type invoice_section_id: str + :param destination_invoice_section_id: The destination + invoiceSectionId. + :type destination_invoice_section_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 + TransferBillingSubscriptionResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.TransferBillingSubscriptionResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.TransferBillingSubscriptionResult]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._transfer_initial( + billing_account_id=billing_account_id, + invoice_section_id=invoice_section_id, + destination_invoice_section_id=destination_invoice_section_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('TransferBillingSubscriptionResult', 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) + transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}/billingSubscriptions/{subscriptionId}/transfer'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py new file mode 100644 index 000000000000..cb7390b76069 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py @@ -0,0 +1,98 @@ +# 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 BillingSubscriptionsByBillingProfileOperations(object): + """BillingSubscriptionsByBillingProfileOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_id, billing_profile_id, custom_headers=None, raw=False, **operation_config): + """Lists billing subscriptions by billingProfileId. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param billing_profile_id: Billing Profile Id. + :type billing_profile_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: BillingSubscriptionsListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingSubscriptionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingSubscriptionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}/billingSubscriptions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_invoice_section_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_invoice_section_operations.py new file mode 100644 index 000000000000..a6a839312b1e --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_invoice_section_operations.py @@ -0,0 +1,98 @@ +# 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 BillingSubscriptionsByInvoiceSectionOperations(object): + """BillingSubscriptionsByInvoiceSectionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_id, invoice_section_id, custom_headers=None, raw=False, **operation_config): + """Lists billing subscription by invoiceSectionId. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param invoice_section_id: InvoiceSection Id. + :type invoice_section_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: BillingSubscriptionsListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingSubscriptionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'invoiceSectionId': self._serialize.url("invoice_section_id", invoice_section_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingSubscriptionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}/billingSubscriptions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/departments_by_billing_account_id_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/departments_by_billing_account_id_operations.py new file mode 100644 index 000000000000..adda34ba245b --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/departments_by_billing_account_id_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 DepartmentsByBillingAccountIdOperations(object): + """DepartmentsByBillingAccountIdOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_id, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists all departments for a user which he has access to. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param expand: May be used to expand the enrollmentAccounts. + :type expand: str + :param filter: The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and + 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter + is a key value pair string where key and value is separated by a colon + (:). + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DepartmentListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.DepartmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DepartmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py new file mode 100644 index 000000000000..209022fda2fc --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py @@ -0,0 +1,108 @@ +# 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 DepartmentsOperations(object): + """DepartmentsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_id, department_id, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Get the department by id. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param department_id: Department Id. + :type department_id: str + :param expand: May be used to expand the enrollmentAccounts. + :type expand: str + :param filter: The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and + 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter + is a key value pair string where key and value is separated by a colon + (:). + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Department or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.Department or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'departmentId': self._serialize.url("department_id", department_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Department', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_by_billing_account_id_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_by_billing_account_id_operations.py new file mode 100644 index 000000000000..3214a240686a --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_by_billing_account_id_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 EnrollmentAccountsByBillingAccountIdOperations(object): + """EnrollmentAccountsByBillingAccountIdOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_id, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists all Enrollment Accounts for a user which he has access to. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param expand: May be used to expand the department. + :type expand: str + :param filter: The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and + 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter + is a key value pair string where key and value is separated by a colon + (:). + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EnrollmentAccountListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.EnrollmentAccountListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('EnrollmentAccountListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py index 58199cd31644..f12258dae6ee 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py +++ b/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-03-01-preview. Constant value: "2018-03-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". """ models = models @@ -32,75 +32,25 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-03-01-preview" + self.api_version = "2018-11-01-preview" self.config = config - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists the enrollment accounts the caller has access to. - - :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 EnrollmentAccount - :rtype: - ~azure.mgmt.billing.models.EnrollmentAccountPaged[~azure.mgmt.billing.models.EnrollmentAccount] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.EnrollmentAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.EnrollmentAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/enrollmentAccounts'} - - def get( - self, name, custom_headers=None, raw=False, **operation_config): - """Gets a enrollment account by name. - - :param name: Enrollment Account name. - :type name: str + def get_by_enrollment_account_account_id( + self, billing_account_id, enrollment_account_id, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Get the enrollment account by id. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param enrollment_account_id: Enrollment Account Id. + :type enrollment_account_id: str + :param expand: May be used to expand the Department. + :type expand: str + :param filter: The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and + 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter + is a key value pair string where key and value is separated by a colon + (:). + :type filter: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -113,15 +63,20 @@ def get( :class:`ErrorResponseException` """ # Construct URL - url = self.get.metadata['url'] + url = self.get_by_enrollment_account_account_id.metadata['url'] path_format_arguments = { - 'name': self._serialize.url("name", name, 'str') + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'enrollmentAccountId': self._serialize.url("enrollment_account_id", enrollment_account_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') # Construct headers header_parameters = {} @@ -150,4 +105,4 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/enrollmentAccounts/{name}'} + get_by_enrollment_account_account_id.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py new file mode 100644 index 000000000000..1c3cbd30f5d1 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class InvoiceOperations(object): + """InvoiceOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_id, billing_profile_id, invoice_name, custom_headers=None, raw=False, **operation_config): + """Get the invoice by id. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param billing_profile_id: Billing Profile Id. + :type billing_profile_id: str + :param invoice_name: Invoide Id. + :type invoice_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: InvoiceSummary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str'), + 'invoiceName': self._serialize.url("invoice_name", invoice_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('InvoiceSummary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoices/{invoiceName}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_pricesheet_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_pricesheet_operations.py new file mode 100644 index 000000000000..c51f79dd3148 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_pricesheet_operations.py @@ -0,0 +1,145 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class InvoicePricesheetOperations(object): + """InvoicePricesheetOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + + def _download_initial( + self, billing_account_id, invoice_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.download.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'invoiceName': self._serialize.url("invoice_name", invoice_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', + 'Azure-AsyncOperation': '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( + self, billing_account_id, invoice_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Get pricesheet data for invoice id (invoiceName). + + :param billing_account_id: Azure Billing Account ID. + :type billing_account_id: str + :param invoice_name: The name of an invoice resource. + :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 + 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_initial( + billing_account_id=billing_account_id, + invoice_name=invoice_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + 'Azure-AsyncOperation': '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.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoices/{invoiceName}/pricesheet/default/download'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_id_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_id_operations.py new file mode 100644 index 000000000000..f1fb5fbafbe4 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_id_operations.py @@ -0,0 +1,104 @@ +# 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 InvoiceSectionsByBillingAccountIdOperations(object): + """InvoiceSectionsByBillingAccountIdOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_id, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all invoice sections for a user which he has access to. + + :param billing_account_id: billing Account Id. + :type billing_account_id: 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: InvoiceSectionListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceSectionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + 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, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceSectionListResult', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py new file mode 100644 index 000000000000..f132bb8d2a39 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py @@ -0,0 +1,333 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class InvoiceSectionsOperations(object): + """InvoiceSectionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + + def _create_initial( + self, billing_account_id, display_name=None, billing_profiles=None, custom_headers=None, raw=False, **operation_config): + parameters = models.InvoiceSectionProperties(display_name=display_name, billing_profiles=billing_profiles) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 'InvoiceSectionProperties') + + # 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_id, display_name=None, billing_profiles=None, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to create a InvoiceSection. + + :param billing_account_id: billing Account Id. + :type billing_account_id: 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 + :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_id=billing_account_id, + display_name=display_name, + billing_profiles=billing_profiles, + 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/{billingAccountId}/invoiceSections'} + + def get( + self, billing_account_id, invoice_section_id, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the InvoiceSection by id. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param invoice_section_id: InvoiceSection Id. + :type invoice_section_id: 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` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'invoiceSectionId': self._serialize.url("invoice_section_id", invoice_section_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + 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('InvoiceSection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'} + + + def _update_initial( + self, billing_account_id, invoice_section_id, display_name=None, billing_profiles=None, custom_headers=None, raw=False, **operation_config): + parameters = models.InvoiceSection(display_name=display_name, billing_profiles=billing_profiles) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'invoiceSectionId': self._serialize.url("invoice_section_id", invoice_section_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 'InvoiceSection') + + # Construct and send request + 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]: + 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': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def update( + self, billing_account_id, invoice_section_id, display_name=None, billing_profiles=None, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to update a InvoiceSection. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param invoice_section_id: InvoiceSection Id. + :type invoice_section_id: 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 + :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._update_initial( + billing_account_id=billing_account_id, + invoice_section_id=invoice_section_id, + display_name=display_name, + billing_profiles=billing_profiles, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': '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) + update.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py new file mode 100644 index 000000000000..e5eabe36f304 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_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 InvoiceSectionsWithCreateSubscriptionPermissionOperations(object): + """InvoiceSectionsWithCreateSubscriptionPermissionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_id, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all invoiceSections with create subscription permission for a + user. + + :param billing_account_id: billing Account Id. + :type billing_account_id: 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: InvoiceSectionListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceSectionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + 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, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceSectionListResult', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/listInvoiceSectionsWithCreateSubscriptionPermission'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_account_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_account_operations.py new file mode 100644 index 000000000000..98cf7397ccef --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_account_operations.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class InvoicesByBillingAccountOperations(object): + """InvoicesByBillingAccountOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_id, period_start_date, period_end_date, custom_headers=None, raw=False, **operation_config): + """List of invoices for a billing account. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param period_start_date: Invoice period start date. + :type period_start_date: str + :param period_end_date: Invoice period end date. + :type period_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: InvoiceListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['periodStartDate'] = self._serialize.query("period_start_date", period_start_date, 'str') + query_parameters['periodEndDate'] = self._serialize.query("period_end_date", period_end_date, '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('InvoiceListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoices'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_profile_operations.py new file mode 100644 index 000000000000..8a75998d8723 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_profile_operations.py @@ -0,0 +1,103 @@ +# 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 InvoicesByBillingProfileOperations(object): + """InvoicesByBillingProfileOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_id, billing_profile_id, period_start_date, period_end_date, custom_headers=None, raw=False, **operation_config): + """List of invoices for a billing profile. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param billing_profile_id: Billing Profile Id. + :type billing_profile_id: str + :param period_start_date: Invoice period start date. + :type period_start_date: str + :param period_end_date: Invoice period end date. + :type period_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: InvoiceListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['periodStartDate'] = self._serialize.query("period_start_date", period_start_date, 'str') + query_parameters['periodEndDate'] = self._serialize.query("period_end_date", period_end_date, '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('InvoiceListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoices'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py deleted file mode 100644 index e16ef92f5af0..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py +++ /dev/null @@ -1,252 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class InvoicesOperations(object): - """InvoicesOperations 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-03-01-preview. Constant value: "2018-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-03-01-preview" - - self.config = config - - def list( - self, expand=None, filter=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): - """Lists the available invoices for a subscription in reverse - chronological order beginning with the most recent invoice. In preview, - invoices are available via this API only for invoice periods which end - December 1, 2016 or later. This is only supported for Azure Web-Direct - subscriptions. Other subscription types which were not purchased - directly through the Azure web portal are not supported through this - preview API. - - :param expand: May be used to expand the downloadUrl property within a - list of invoices. This enables download links to be generated for - multiple invoices at once. By default, downloadURLs are not included - when listing invoices. - :type expand: str - :param filter: May be used to filter invoices by invoicePeriodEndDate. - The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does - not currently support 'ne', 'or', or 'not'. - :type filter: str - :param skiptoken: Skiptoken is only used if a previous operation - returned a partial result. If a previous response contains a nextLink - element, the value of the nextLink element will include a skiptoken - parameter that specifies a starting point to use for subsequent calls. - :type skiptoken: str - :param top: May be used to limit the number of results to the most - recent N invoices. - :type top: int - :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 Invoice - :rtype: - ~azure.mgmt.billing.models.InvoicePaged[~azure.mgmt.billing.models.Invoice] - :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 = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=100, minimum=1) - - 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.InvoicePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.InvoicePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/invoices'} - - def get( - self, invoice_name, custom_headers=None, raw=False, **operation_config): - """Gets a named invoice resource. When getting a single invoice, the - downloadUrl property is expanded automatically. This is only supported - for Azure Web-Direct subscriptions. Other subscription types which were - not purchased directly through the Azure web portal are not supported - through this preview API. - - :param invoice_name: The name of an invoice resource. - :type invoice_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: Invoice or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.Invoice or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'invoiceName': self._serialize.url("invoice_name", invoice_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('Invoice', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/invoices/{invoiceName}'} - - def get_latest( - self, custom_headers=None, raw=False, **operation_config): - """Gets the most recent invoice. When getting a single invoice, the - downloadUrl property is expanded automatically. This is only supported - for Azure Web-Direct subscriptions. Other subscription types which were - not purchased directly through the Azure web portal are not supported - through this preview API. - - :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: Invoice or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.Invoice or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get_latest.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Invoice', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_latest.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/invoices/latest'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py index 07621b06039f..09088dd24e9a 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py +++ b/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-03-01-preview. Constant value: "2018-03-01-preview". + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-03-01-preview" + self.api_version = "2018-11-01-preview" self.config = config diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_by_billing_profile_operations.py new file mode 100644 index 000000000000..1816d597fa1d --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_by_billing_profile_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 PaymentMethodsByBillingProfileOperations(object): + """PaymentMethodsByBillingProfileOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_id, billing_profile_id, custom_headers=None, raw=False, **operation_config): + """Lists the Payment Methods by billing profile Id. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param billing_profile_id: Billing Profile Id. + :type billing_profile_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: An iterator like instance of PaymentMethod + :rtype: + ~azure.mgmt.billing.models.PaymentMethodPaged[~azure.mgmt.billing.models.PaymentMethod] + :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 = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.PaymentMethodPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PaymentMethodPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/paymentMethods'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py new file mode 100644 index 000000000000..aa2249813cee --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py @@ -0,0 +1,169 @@ +# 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 PolicyOperations(object): + """PolicyOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get_by_billing_profile( + self, billing_account_id, billing_profile_id, custom_headers=None, raw=False, **operation_config): + """The policy for a given billingAccountId and billingProfileId. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param billing_profile_id: Billing Profile Id. + :type billing_profile_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: Policy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.Policy or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Policy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/policies/default'} + + def update( + self, billing_account_id, billing_profile_id, reservation_purchases_allowed=None, marketplace_purchases_allowed=None, custom_headers=None, raw=False, **operation_config): + """The operation to update a policy. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param billing_profile_id: Billing Profile Id. + :type billing_profile_id: str + :param reservation_purchases_allowed: The reservationPurchasesAllowed + flag. + :type reservation_purchases_allowed: bool + :param marketplace_purchases_allowed: The marketplacePurchasesAllowed + flag. + :type marketplace_purchases_allowed: bool + :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: Policy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.Policy or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.Policy(reservation_purchases_allowed=reservation_purchases_allowed, marketplace_purchases_allowed=marketplace_purchases_allowed) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 'Policy') + + # Construct and send request + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Policy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/policies/default'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_account_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_account_operations.py new file mode 100644 index 000000000000..d1c6f407719c --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_account_operations.py @@ -0,0 +1,109 @@ +# 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 ProductsByBillingAccountOperations(object): + """ProductsByBillingAccountOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_id, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists products by billingAccountId. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param filter: May be used to filter by product type. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ProductSummary + :rtype: + ~azure.mgmt.billing.models.ProductSummaryPaged[~azure.mgmt.billing.models.ProductSummary] + :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 = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ProductSummaryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ProductSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/products'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_subscriptions_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_subscriptions_operations.py new file mode 100644 index 000000000000..8854062e4043 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_subscriptions_operations.py @@ -0,0 +1,102 @@ +# 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 ProductsByBillingSubscriptionsOperations(object): + """ProductsByBillingSubscriptionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_id, custom_headers=None, raw=False, **operation_config): + """Lists billing subscriptions by billingAccountId. + + :param billing_account_id: billing Account Id. + :type billing_account_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: An iterator like instance of BillingSubscriptionSummary + :rtype: + ~azure.mgmt.billing.models.BillingSubscriptionSummaryPaged[~azure.mgmt.billing.models.BillingSubscriptionSummary] + :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 = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + 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.BillingSubscriptionSummaryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BillingSubscriptionSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingSubscriptions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_invoice_section_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_invoice_section_operations.py new file mode 100644 index 000000000000..202b420fd11c --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_invoice_section_operations.py @@ -0,0 +1,104 @@ +# 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 ProductsByInvoiceSectionOperations(object): + """ProductsByInvoiceSectionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_id, invoice_section_id, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists products by invoiceSectionId. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param invoice_section_id: InvoiceSection Id. + :type invoice_section_id: str + :param filter: May be used to filter by product type. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ProductsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.ProductsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'invoiceSectionId': self._serialize.url("invoice_section_id", invoice_section_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ProductsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}/products'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py new file mode 100644 index 000000000000..fa697517c28d --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py @@ -0,0 +1,178 @@ +# 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 ProductsOperations(object): + """ProductsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_id, invoice_section_id, product_name, custom_headers=None, raw=False, **operation_config): + """Get a single product by name. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param invoice_section_id: InvoiceSection Id. + :type invoice_section_id: str + :param product_name: Invoide Id. + :type product_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: ProductSummary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.ProductSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'invoiceSectionId': self._serialize.url("invoice_section_id", invoice_section_id, 'str'), + 'productName': self._serialize.url("product_name", product_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('ProductSummary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}/products/{productName}'} + + def transfer( + self, billing_account_id, invoice_section_id, product_name, destination_invoice_section_id=None, custom_headers=None, raw=False, **operation_config): + """The operation to transfer a Product to another InvoiceSection. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param invoice_section_id: InvoiceSection Id. + :type invoice_section_id: str + :param product_name: Invoide Id. + :type product_name: str + :param destination_invoice_section_id: Destination invoice section id. + :type destination_invoice_section_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: ProductSummary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.ProductSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.TransferProductRequestProperties(destination_invoice_section_id=destination_invoice_section_id) + + # Construct URL + url = self.transfer.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'invoiceSectionId': self._serialize.url("invoice_section_id", invoice_section_id, 'str'), + 'productName': self._serialize.url("product_name", product_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, 'TransferProductRequestProperties') + + # 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('ProductSummary', 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 + transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}/products/{productName}/transfer'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_account_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_account_operations.py new file mode 100644 index 000000000000..2e71b0f4fa9e --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_account_operations.py @@ -0,0 +1,116 @@ +# 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 TransactionsByBillingAccountOperations(object): + """TransactionsByBillingAccountOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_id, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the transactions by billingAccountId for given start and end + date. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param start_date: Start date + :type start_date: str + :param end_date: End date + :type end_date: str + :param filter: May be used to filter by transaction kind. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TransactionsSummary + :rtype: + ~azure.mgmt.billing.models.TransactionsSummaryPaged[~azure.mgmt.billing.models.TransactionsSummary] + :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 = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + 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.TransactionsSummaryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TransactionsSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/transactions'} From a038ff661f2c5dbe599cdc8a0beab1b05b0ce4dd Mon Sep 17 00:00:00 2001 From: azuresdkci Date: Tue, 19 Mar 2019 20:38:00 +0000 Subject: [PATCH 2/8] Packaging update of azure-mgmt-billing --- azure-mgmt-billing/MANIFEST.in | 1 + azure-mgmt-billing/README.rst | 22 +++------------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/azure-mgmt-billing/MANIFEST.in b/azure-mgmt-billing/MANIFEST.in index 6ceb27f7a96e..e4884efef41b 100644 --- a/azure-mgmt-billing/MANIFEST.in +++ b/azure-mgmt-billing/MANIFEST.in @@ -1,3 +1,4 @@ +recursive-include tests *.py *.yaml include *.rst include azure/__init__.py include azure/mgmt/__init__.py diff --git a/azure-mgmt-billing/README.rst b/azure-mgmt-billing/README.rst index 45de4e6b43dd..6b85fb2289e3 100644 --- a/azure-mgmt-billing/README.rst +++ b/azure-mgmt-billing/README.rst @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see For a more complete set of Azure libraries, see the `azure `__ bundle package. -Compatibility -============= - -**IMPORTANT**: If you have an earlier version of the azure package -(version < 1.0), you should uninstall it before installing this package. - -You can check the version using pip: - -.. code:: shell - - pip freeze - -If you see azure==0.11.0 (or any version below 1.0), uninstall it first: - -.. code:: shell - - pip uninstall azure - - Usage ===== @@ -47,3 +28,6 @@ Provide Feedback If you encounter any bugs or have suggestions, please file an issue in the `Issues `__ section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-billing%2FREADME.png From 4e424eef85a14e22b478981e1f594fd29b8ddc9c Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 19 Mar 2019 23:10:04 +0000 Subject: [PATCH 3/8] Generated from be56341bb4b65410ec13ba0af477c8a87179c7a5 Add back availableBalance/default. --- .../mgmt/billing/billing_management_client.py | 5 + .../azure/mgmt/billing/models/__init__.py | 3 + .../mgmt/billing/models/available_balance.py | 47 +++++++++ .../billing/models/available_balance_py3.py | 47 +++++++++ .../azure/mgmt/billing/operations/__init__.py | 2 + ...e_balance_by_billing_profile_operations.py | 98 +++++++++++++++++++ 6 files changed, 202 insertions(+) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/available_balance.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/available_balance_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/available_balance_by_billing_profile_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index 6d4b53654aef..1466db276bc6 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -19,6 +19,7 @@ import uuid from .operations.billing_accounts_operations import BillingAccountsOperations from .operations.billing_accounts_with_create_invoice_section_permission_operations import BillingAccountsWithCreateInvoiceSectionPermissionOperations +from .operations.available_balance_by_billing_profile_operations import AvailableBalanceByBillingProfileOperations from .operations.payment_methods_by_billing_profile_operations import PaymentMethodsByBillingProfileOperations from .operations.billing_profiles_by_billing_account_id_operations import BillingProfilesByBillingAccountIdOperations from .operations.billing_profiles_operations import BillingProfilesOperations @@ -89,6 +90,8 @@ class BillingManagementClient(SDKClient): :vartype billing_accounts: azure.mgmt.billing.operations.BillingAccountsOperations :ivar billing_accounts_with_create_invoice_section_permission: BillingAccountsWithCreateInvoiceSectionPermission operations :vartype billing_accounts_with_create_invoice_section_permission: azure.mgmt.billing.operations.BillingAccountsWithCreateInvoiceSectionPermissionOperations + :ivar available_balance_by_billing_profile: AvailableBalanceByBillingProfile operations + :vartype available_balance_by_billing_profile: azure.mgmt.billing.operations.AvailableBalanceByBillingProfileOperations :ivar payment_methods_by_billing_profile: PaymentMethodsByBillingProfile operations :vartype payment_methods_by_billing_profile: azure.mgmt.billing.operations.PaymentMethodsByBillingProfileOperations :ivar billing_profiles_by_billing_account_id: BillingProfilesByBillingAccountId operations @@ -163,6 +166,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.billing_accounts_with_create_invoice_section_permission = BillingAccountsWithCreateInvoiceSectionPermissionOperations( self._client, self.config, self._serialize, self._deserialize) + self.available_balance_by_billing_profile = AvailableBalanceByBillingProfileOperations( + self._client, self.config, self._serialize, self._deserialize) self.payment_methods_by_billing_profile = PaymentMethodsByBillingProfileOperations( self._client, self.config, self._serialize, self._deserialize) self.billing_profiles_by_billing_account_id = BillingProfilesByBillingAccountIdOperations( diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py index 05849198014f..98b0eb5cdaf6 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py @@ -49,6 +49,7 @@ from .transactions_summary_py3 import TransactionsSummary from .transactions_list_result_py3 import TransactionsListResult from .policy_py3 import Policy + from .available_balance_py3 import AvailableBalance from .payment_method_py3 import PaymentMethod from .update_auto_renew_request_py3 import UpdateAutoRenewRequest from .operation_display_py3 import OperationDisplay @@ -93,6 +94,7 @@ from .transactions_summary import TransactionsSummary from .transactions_list_result import TransactionsListResult from .policy import Policy + from .available_balance import AvailableBalance from .payment_method import PaymentMethod from .update_auto_renew_request import UpdateAutoRenewRequest from .operation_display import OperationDisplay @@ -152,6 +154,7 @@ 'TransactionsSummary', 'TransactionsListResult', 'Policy', + 'AvailableBalance', 'PaymentMethod', 'UpdateAutoRenewRequest', 'OperationDisplay', diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/available_balance.py b/azure-mgmt-billing/azure/mgmt/billing/models/available_balance.py new file mode 100644 index 000000000000..61b66201e156 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/available_balance.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class AvailableBalance(Resource): + """Latest available balance on Monetary Credit PI. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar amount: Balance Amount. + :vartype amount: ~azure.mgmt.billing.models.Amount + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'amount': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'amount': {'key': 'properties.amount', 'type': 'Amount'}, + } + + def __init__(self, **kwargs): + super(AvailableBalance, self).__init__(**kwargs) + self.amount = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/available_balance_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/available_balance_py3.py new file mode 100644 index 000000000000..e4c17832fbee --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/available_balance_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class AvailableBalance(Resource): + """Latest available balance on Monetary Credit PI. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar amount: Balance Amount. + :vartype amount: ~azure.mgmt.billing.models.Amount + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'amount': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'amount': {'key': 'properties.amount', 'type': 'Amount'}, + } + + def __init__(self, **kwargs) -> None: + super(AvailableBalance, self).__init__(**kwargs) + self.amount = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index 3a4aaf28ed66..870264027c11 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -11,6 +11,7 @@ from .billing_accounts_operations import BillingAccountsOperations from .billing_accounts_with_create_invoice_section_permission_operations import BillingAccountsWithCreateInvoiceSectionPermissionOperations +from .available_balance_by_billing_profile_operations import AvailableBalanceByBillingProfileOperations from .payment_methods_by_billing_profile_operations import PaymentMethodsByBillingProfileOperations from .billing_profiles_by_billing_account_id_operations import BillingProfilesByBillingAccountIdOperations from .billing_profiles_operations import BillingProfilesOperations @@ -40,6 +41,7 @@ __all__ = [ 'BillingAccountsOperations', 'BillingAccountsWithCreateInvoiceSectionPermissionOperations', + 'AvailableBalanceByBillingProfileOperations', 'PaymentMethodsByBillingProfileOperations', 'BillingProfilesByBillingAccountIdOperations', 'BillingProfilesOperations', diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/available_balance_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/available_balance_by_billing_profile_operations.py new file mode 100644 index 000000000000..1d75c0a7e2fa --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/available_balance_by_billing_profile_operations.py @@ -0,0 +1,98 @@ +# 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 AvailableBalanceByBillingProfileOperations(object): + """AvailableBalanceByBillingProfileOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_id, billing_profile_id, custom_headers=None, raw=False, **operation_config): + """The latest available credit balance for a given billingAccountId and + billingProfileId. + + :param billing_account_id: billing Account Id. + :type billing_account_id: str + :param billing_profile_id: Billing Profile Id. + :type billing_profile_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: AvailableBalance or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.AvailableBalance or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AvailableBalance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/availableBalance/default'} From 860d62b0d6bba64b22ab861d6b51e6477c03f199 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 20 Mar 2019 03:12:46 +0000 Subject: [PATCH 4/8] Generated from e51d10380f487b7a3703deae13d9f9824d56fd0a typo --- .../mgmt/billing/billing_management_client.py | 125 +++++--- .../azure/mgmt/billing/models/__init__.py | 21 ++ .../billing/models/billing_permissions.py | 41 +++ .../models/billing_permissions_list_result.py | 36 +++ .../billing_permissions_list_result_py3.py | 36 +++ .../billing/models/billing_permissions_py3.py | 41 +++ .../billing/models/billing_role_assignment.py | 77 +++++ .../billing_role_assignment_list_result.py | 35 +++ ...billing_role_assignment_list_result_py3.py | 35 +++ .../models/billing_role_assignment_payload.py | 40 +++ .../billing_role_assignment_payload_py3.py | 40 +++ .../models/billing_role_assignment_py3.py | 77 +++++ .../billing/models/billing_role_definition.py | 58 ++++ .../billing_role_definition_list_result.py | 35 +++ ...billing_role_definition_list_result_py3.py | 35 +++ .../models/billing_role_definition_py3.py | 58 ++++ .../models/enrollment_account_context.py | 8 +- .../models/enrollment_account_context_py3.py | 10 +- .../transfer_billing_subscription_request.py | 9 +- ...billing_subscription_request_properties.py | 9 +- ...ing_subscription_request_properties_py3.py | 11 +- ...ansfer_billing_subscription_request_py3.py | 11 +- .../transfer_billing_subscription_result.py | 8 +- ...ransfer_billing_subscription_result_py3.py | 10 +- .../transfer_product_request_properties.py | 8 +- ...transfer_product_request_properties_py3.py | 10 +- .../azure/mgmt/billing/operations/__init__.py | 34 +- ...e_balance_by_billing_profile_operations.py | 22 +- ...g_accountbilling_permissions_operations.py | 94 ++++++ ...countbilling_role_assignment_operations.py | 279 +++++++++++++++++ ...countbilling_role_definition_operations.py | 155 ++++++++++ .../operations/billing_accounts_operations.py | 10 +- ...g_profilebilling_permissions_operations.py | 97 ++++++ ...ofilebilling_role_assignment_operations.py | 291 ++++++++++++++++++ ...ofilebilling_role_definition_operations.py | 161 ++++++++++ ...les_by_billing_account_name_operations.py} | 14 +- .../operations/billing_profiles_operations.py | 38 +-- .../billing_subscription_operations.py | 59 ++-- ...criptions_by_billing_profile_operations.py | 18 +- ...criptions_by_invoice_section_operations.py | 18 +- ...nts_by_billing_account_name_operations.py} | 14 +- .../operations/departments_operations.py | 16 +- ...nts_by_billing_account_name_operations.py} | 14 +- .../enrollment_accounts_operations.py | 16 +- .../billing/operations/invoice_operations.py | 16 +- .../invoice_pricesheet_operations.py | 14 +- ...ctionbilling_role_assignment_operations.py | 291 ++++++++++++++++++ ...ctionbilling_role_definition_operations.py | 161 ++++++++++ ...ons_by_billing_account_name_operations.py} | 14 +- .../operations/invoice_sections_operations.py | 52 ++-- ...eate_subscription_permission_operations.py | 10 +- ..._sectionsbilling_permissions_operations.py | 97 ++++++ .../invoices_by_billing_account_operations.py | 10 +- .../invoices_by_billing_profile_operations.py | 16 +- ...t_methods_by_billing_profile_operations.py | 16 +- .../billing/operations/policy_operations.py | 34 +- .../products_by_billing_account_operations.py | 12 +- ...cts_by_billing_subscriptions_operations.py | 12 +- .../products_by_invoice_section_operations.py | 18 +- .../billing/operations/products_operations.py | 39 +-- ...nsactions_by_billing_account_operations.py | 12 +- 61 files changed, 2710 insertions(+), 348 deletions(-) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_permissions_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_role_assignment_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_role_definition_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_permissions_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_role_assignment_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_role_definition_operations.py rename azure-mgmt-billing/azure/mgmt/billing/operations/{billing_profiles_by_billing_account_id_operations.py => billing_profiles_by_billing_account_name_operations.py} (88%) rename azure-mgmt-billing/azure/mgmt/billing/operations/{departments_by_billing_account_id_operations.py => departments_by_billing_account_name_operations.py} (89%) rename azure-mgmt-billing/azure/mgmt/billing/operations/{enrollment_accounts_by_billing_account_id_operations.py => enrollment_accounts_by_billing_account_name_operations.py} (88%) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionbilling_role_assignment_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionbilling_role_definition_operations.py rename azure-mgmt-billing/azure/mgmt/billing/operations/{invoice_sections_by_billing_account_id_operations.py => invoice_sections_by_billing_account_name_operations.py} (88%) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionsbilling_permissions_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index 1466db276bc6..8af06a0bf660 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -21,14 +21,14 @@ from .operations.billing_accounts_with_create_invoice_section_permission_operations import BillingAccountsWithCreateInvoiceSectionPermissionOperations from .operations.available_balance_by_billing_profile_operations import AvailableBalanceByBillingProfileOperations from .operations.payment_methods_by_billing_profile_operations import PaymentMethodsByBillingProfileOperations -from .operations.billing_profiles_by_billing_account_id_operations import BillingProfilesByBillingAccountIdOperations +from .operations.billing_profiles_by_billing_account_name_operations import BillingProfilesByBillingAccountNameOperations from .operations.billing_profiles_operations import BillingProfilesOperations -from .operations.invoice_sections_by_billing_account_id_operations import InvoiceSectionsByBillingAccountIdOperations +from .operations.invoice_sections_by_billing_account_name_operations import InvoiceSectionsByBillingAccountNameOperations from .operations.invoice_sections_operations import InvoiceSectionsOperations from .operations.invoice_sections_with_create_subscription_permission_operations import InvoiceSectionsWithCreateSubscriptionPermissionOperations -from .operations.departments_by_billing_account_id_operations import DepartmentsByBillingAccountIdOperations +from .operations.departments_by_billing_account_name_operations import DepartmentsByBillingAccountNameOperations from .operations.departments_operations import DepartmentsOperations -from .operations.enrollment_accounts_by_billing_account_id_operations import EnrollmentAccountsByBillingAccountIdOperations +from .operations.enrollment_accounts_by_billing_account_name_operations import EnrollmentAccountsByBillingAccountNameOperations from .operations.enrollment_accounts_operations import EnrollmentAccountsOperations from .operations.invoices_by_billing_account_operations import InvoicesByBillingAccountOperations from .operations.invoice_pricesheet_operations import InvoicePricesheetOperations @@ -45,6 +45,15 @@ from .operations.policy_operations import PolicyOperations from .operations.billing_property_operations import BillingPropertyOperations from .operations.operations import Operations +from .operations.billing_accountbilling_permissions_operations import BillingAccountbillingPermissionsOperations +from .operations.invoice_sectionsbilling_permissions_operations import InvoiceSectionsbillingPermissionsOperations +from .operations.billing_profilebilling_permissions_operations import BillingProfilebillingPermissionsOperations +from .operations.billing_accountbilling_role_definition_operations import BillingAccountbillingRoleDefinitionOperations +from .operations.invoice_sectionbilling_role_definition_operations import InvoiceSectionbillingRoleDefinitionOperations +from .operations.billing_profilebilling_role_definition_operations import BillingProfilebillingRoleDefinitionOperations +from .operations.billing_accountbilling_role_assignment_operations import BillingAccountbillingRoleAssignmentOperations +from .operations.invoice_sectionbilling_role_assignment_operations import InvoiceSectionbillingRoleAssignmentOperations +from .operations.billing_profilebilling_role_assignment_operations import BillingProfilebillingRoleAssignmentOperations from . import models @@ -94,22 +103,22 @@ class BillingManagementClient(SDKClient): :vartype available_balance_by_billing_profile: azure.mgmt.billing.operations.AvailableBalanceByBillingProfileOperations :ivar payment_methods_by_billing_profile: PaymentMethodsByBillingProfile operations :vartype payment_methods_by_billing_profile: azure.mgmt.billing.operations.PaymentMethodsByBillingProfileOperations - :ivar billing_profiles_by_billing_account_id: BillingProfilesByBillingAccountId operations - :vartype billing_profiles_by_billing_account_id: azure.mgmt.billing.operations.BillingProfilesByBillingAccountIdOperations + :ivar billing_profiles_by_billing_account_name: BillingProfilesByBillingAccountName operations + :vartype billing_profiles_by_billing_account_name: azure.mgmt.billing.operations.BillingProfilesByBillingAccountNameOperations :ivar billing_profiles: BillingProfiles operations :vartype billing_profiles: azure.mgmt.billing.operations.BillingProfilesOperations - :ivar invoice_sections_by_billing_account_id: InvoiceSectionsByBillingAccountId operations - :vartype invoice_sections_by_billing_account_id: azure.mgmt.billing.operations.InvoiceSectionsByBillingAccountIdOperations + :ivar invoice_sections_by_billing_account_name: InvoiceSectionsByBillingAccountName operations + :vartype invoice_sections_by_billing_account_name: azure.mgmt.billing.operations.InvoiceSectionsByBillingAccountNameOperations :ivar invoice_sections: InvoiceSections operations :vartype invoice_sections: azure.mgmt.billing.operations.InvoiceSectionsOperations :ivar invoice_sections_with_create_subscription_permission: InvoiceSectionsWithCreateSubscriptionPermission operations :vartype invoice_sections_with_create_subscription_permission: azure.mgmt.billing.operations.InvoiceSectionsWithCreateSubscriptionPermissionOperations - :ivar departments_by_billing_account_id: DepartmentsByBillingAccountId operations - :vartype departments_by_billing_account_id: azure.mgmt.billing.operations.DepartmentsByBillingAccountIdOperations + :ivar departments_by_billing_account_name: DepartmentsByBillingAccountName operations + :vartype departments_by_billing_account_name: azure.mgmt.billing.operations.DepartmentsByBillingAccountNameOperations :ivar departments: Departments operations :vartype departments: azure.mgmt.billing.operations.DepartmentsOperations - :ivar enrollment_accounts_by_billing_account_id: EnrollmentAccountsByBillingAccountId operations - :vartype enrollment_accounts_by_billing_account_id: azure.mgmt.billing.operations.EnrollmentAccountsByBillingAccountIdOperations + :ivar enrollment_accounts_by_billing_account_name: EnrollmentAccountsByBillingAccountName operations + :vartype enrollment_accounts_by_billing_account_name: azure.mgmt.billing.operations.EnrollmentAccountsByBillingAccountNameOperations :ivar enrollment_accounts: EnrollmentAccounts operations :vartype enrollment_accounts: azure.mgmt.billing.operations.EnrollmentAccountsOperations :ivar invoices_by_billing_account: InvoicesByBillingAccount operations @@ -142,6 +151,24 @@ class BillingManagementClient(SDKClient): :vartype billing_property: azure.mgmt.billing.operations.BillingPropertyOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.billing.operations.Operations + :ivar billing_accountbilling_permissions: BillingAccountbillingPermissions operations + :vartype billing_accountbilling_permissions: azure.mgmt.billing.operations.BillingAccountbillingPermissionsOperations + :ivar invoice_sectionsbilling_permissions: InvoiceSectionsbillingPermissions operations + :vartype invoice_sectionsbilling_permissions: azure.mgmt.billing.operations.InvoiceSectionsbillingPermissionsOperations + :ivar billing_profilebilling_permissions: BillingProfilebillingPermissions operations + :vartype billing_profilebilling_permissions: azure.mgmt.billing.operations.BillingProfilebillingPermissionsOperations + :ivar billing_accountbilling_role_definition: BillingAccountbillingRoleDefinition operations + :vartype billing_accountbilling_role_definition: azure.mgmt.billing.operations.BillingAccountbillingRoleDefinitionOperations + :ivar invoice_sectionbilling_role_definition: InvoiceSectionbillingRoleDefinition operations + :vartype invoice_sectionbilling_role_definition: azure.mgmt.billing.operations.InvoiceSectionbillingRoleDefinitionOperations + :ivar billing_profilebilling_role_definition: BillingProfilebillingRoleDefinition operations + :vartype billing_profilebilling_role_definition: azure.mgmt.billing.operations.BillingProfilebillingRoleDefinitionOperations + :ivar billing_accountbilling_role_assignment: BillingAccountbillingRoleAssignment operations + :vartype billing_accountbilling_role_assignment: azure.mgmt.billing.operations.BillingAccountbillingRoleAssignmentOperations + :ivar invoice_sectionbilling_role_assignment: InvoiceSectionbillingRoleAssignment operations + :vartype invoice_sectionbilling_role_assignment: azure.mgmt.billing.operations.InvoiceSectionbillingRoleAssignmentOperations + :ivar billing_profilebilling_role_assignment: BillingProfilebillingRoleAssignment operations + :vartype billing_profilebilling_role_assignment: azure.mgmt.billing.operations.BillingProfilebillingRoleAssignmentOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -170,21 +197,21 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.payment_methods_by_billing_profile = PaymentMethodsByBillingProfileOperations( self._client, self.config, self._serialize, self._deserialize) - self.billing_profiles_by_billing_account_id = BillingProfilesByBillingAccountIdOperations( + self.billing_profiles_by_billing_account_name = BillingProfilesByBillingAccountNameOperations( self._client, self.config, self._serialize, self._deserialize) self.billing_profiles = BillingProfilesOperations( self._client, self.config, self._serialize, self._deserialize) - self.invoice_sections_by_billing_account_id = InvoiceSectionsByBillingAccountIdOperations( + self.invoice_sections_by_billing_account_name = InvoiceSectionsByBillingAccountNameOperations( self._client, self.config, self._serialize, self._deserialize) self.invoice_sections = InvoiceSectionsOperations( self._client, self.config, self._serialize, self._deserialize) self.invoice_sections_with_create_subscription_permission = InvoiceSectionsWithCreateSubscriptionPermissionOperations( self._client, self.config, self._serialize, self._deserialize) - self.departments_by_billing_account_id = DepartmentsByBillingAccountIdOperations( + self.departments_by_billing_account_name = DepartmentsByBillingAccountNameOperations( self._client, self.config, self._serialize, self._deserialize) self.departments = DepartmentsOperations( self._client, self.config, self._serialize, self._deserialize) - self.enrollment_accounts_by_billing_account_id = EnrollmentAccountsByBillingAccountIdOperations( + self.enrollment_accounts_by_billing_account_name = EnrollmentAccountsByBillingAccountNameOperations( self._client, self.config, self._serialize, self._deserialize) self.enrollment_accounts = EnrollmentAccountsOperations( self._client, self.config, self._serialize, self._deserialize) @@ -218,16 +245,34 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) + self.billing_accountbilling_permissions = BillingAccountbillingPermissionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoice_sectionsbilling_permissions = InvoiceSectionsbillingPermissionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_profilebilling_permissions = BillingProfilebillingPermissionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_accountbilling_role_definition = BillingAccountbillingRoleDefinitionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoice_sectionbilling_role_definition = InvoiceSectionbillingRoleDefinitionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_profilebilling_role_definition = BillingProfilebillingRoleDefinitionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_accountbilling_role_assignment = BillingAccountbillingRoleAssignmentOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoice_sectionbilling_role_assignment = InvoiceSectionbillingRoleAssignmentOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_profilebilling_role_assignment = BillingProfilebillingRoleAssignmentOperations( + self._client, self.config, self._serialize, self._deserialize) def transactions_by_billing_profile( - self, billing_account_id, billing_profile_id, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): - """Lists the transactions by billingProfileId for given start date and end - date. - - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param billing_profile_id: Billing Profile Id. - :type billing_profile_id: str + self, billing_account_name, billing_profile_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the transactions by billingProfileName for given start date and + end date. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str :param start_date: Start date :type start_date: str :param end_date: End date @@ -251,8 +296,8 @@ def transactions_by_billing_profile( # Construct URL url = self.transactions_by_billing_profile.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, '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) @@ -291,14 +336,14 @@ def transactions_by_billing_profile( return client_raw_response return deserialized - transactions_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/transactions'} + transactions_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/transactions'} def update_auto_renew_for_billing_account( - self, billing_account_id, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): """Cancel product by product id. - :param billing_account_id: billing Account Id. - :type billing_account_id: str + :param billing_account_name: billing Account Id. + :type billing_account_name: str :param product_name: Invoide Id. :type product_name: str :param auto_renew: Request parameters to update auto renew policy a @@ -321,7 +366,7 @@ def update_auto_renew_for_billing_account( # Construct URL url = self.update_auto_renew_for_billing_account.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), 'productName': self._serialize.url("product_name", product_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -361,16 +406,16 @@ def update_auto_renew_for_billing_account( return client_raw_response return deserialized - update_auto_renew_for_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/products/{productName}/updateAutoRenew'} + update_auto_renew_for_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/updateAutoRenew'} def update_auto_renew_for_invoice_section( - self, billing_account_id, invoice_section_id, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, invoice_section_name, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): """Cancel auto renew for product by product id. - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param invoice_section_id: InvoiceSection Id. - :type invoice_section_id: str + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str :param product_name: Invoide Id. :type product_name: str :param auto_renew: Request parameters to update auto renew policy a @@ -393,8 +438,8 @@ def update_auto_renew_for_invoice_section( # Construct URL url = self.update_auto_renew_for_invoice_section.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'invoiceSectionId': self._serialize.url("invoice_section_id", invoice_section_id, 'str'), + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), 'productName': self._serialize.url("product_name", product_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -434,4 +479,4 @@ def update_auto_renew_for_invoice_section( return client_raw_response return deserialized - update_auto_renew_for_invoice_section.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}/products/{productName}/updateAutoRenew'} + update_auto_renew_for_invoice_section.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}/updateAutoRenew'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py index 98b0eb5cdaf6..6db4f6911fd9 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py @@ -54,6 +54,13 @@ from .update_auto_renew_request_py3 import UpdateAutoRenewRequest from .operation_display_py3 import OperationDisplay from .operation_py3 import Operation + from .billing_role_assignment_payload_py3 import BillingRoleAssignmentPayload + from .billing_role_assignment_py3 import BillingRoleAssignment + from .billing_role_assignment_list_result_py3 import BillingRoleAssignmentListResult + from .billing_permissions_py3 import BillingPermissions + from .billing_permissions_list_result_py3 import BillingPermissionsListResult + from .billing_role_definition_py3 import BillingRoleDefinition + from .billing_role_definition_list_result_py3 import BillingRoleDefinitionListResult except (SyntaxError, ImportError): from .transfer_product_request_properties import TransferProductRequestProperties from .transfer_billing_subscription_result import TransferBillingSubscriptionResult @@ -99,6 +106,13 @@ from .update_auto_renew_request import UpdateAutoRenewRequest from .operation_display import OperationDisplay from .operation import Operation + from .billing_role_assignment_payload import BillingRoleAssignmentPayload + from .billing_role_assignment import BillingRoleAssignment + from .billing_role_assignment_list_result import BillingRoleAssignmentListResult + from .billing_permissions import BillingPermissions + from .billing_permissions_list_result import BillingPermissionsListResult + from .billing_role_definition import BillingRoleDefinition + from .billing_role_definition_list_result import BillingRoleDefinitionListResult from .payment_method_paged import PaymentMethodPaged from .billing_subscription_summary_paged import BillingSubscriptionSummaryPaged from .product_summary_paged import ProductSummaryPaged @@ -159,6 +173,13 @@ 'UpdateAutoRenewRequest', 'OperationDisplay', 'Operation', + 'BillingRoleAssignmentPayload', + 'BillingRoleAssignment', + 'BillingRoleAssignmentListResult', + 'BillingPermissions', + 'BillingPermissionsListResult', + 'BillingRoleDefinition', + 'BillingRoleDefinitionListResult', 'PaymentMethodPaged', 'BillingSubscriptionSummaryPaged', 'ProductSummaryPaged', diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions.py new file mode 100644 index 000000000000..dfb6d75273a2 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions.py @@ -0,0 +1,41 @@ +# 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 BillingPermissions(Model): + """The set of allowed action and not allowed actions a caller has on a billing + account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar actions: The set of actions that the caller is allowed to do + :vartype actions: list[str] + :ivar not_actions: The set of actions the caller is not allowed to do + :vartype not_actions: list[str] + """ + + _validation = { + 'actions': {'readonly': True}, + 'not_actions': {'readonly': True}, + } + + _attribute_map = { + 'actions': {'key': 'actions', 'type': '[str]'}, + 'not_actions': {'key': 'notActions', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(BillingPermissions, self).__init__(**kwargs) + self.actions = None + self.not_actions = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.py new file mode 100644 index 000000000000..a2df95cab160 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.py @@ -0,0 +1,36 @@ +# 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 BillingPermissionsListResult(Model): + """Result of list billingPermissions a caller has on a billing account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list OF billingPermissions a caller has on a billing + account. + :vartype value: list[~azure.mgmt.billing.models.BillingPermissions] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingPermissions]'}, + } + + def __init__(self, **kwargs): + super(BillingPermissionsListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_py3.py new file mode 100644 index 000000000000..dd88a48cdc83 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_py3.py @@ -0,0 +1,36 @@ +# 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 BillingPermissionsListResult(Model): + """Result of list billingPermissions a caller has on a billing account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list OF billingPermissions a caller has on a billing + account. + :vartype value: list[~azure.mgmt.billing.models.BillingPermissions] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingPermissions]'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingPermissionsListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_py3.py new file mode 100644 index 000000000000..d0a020868a94 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_py3.py @@ -0,0 +1,41 @@ +# 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 BillingPermissions(Model): + """The set of allowed action and not allowed actions a caller has on a billing + account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar actions: The set of actions that the caller is allowed to do + :vartype actions: list[str] + :ivar not_actions: The set of actions the caller is not allowed to do + :vartype not_actions: list[str] + """ + + _validation = { + 'actions': {'readonly': True}, + 'not_actions': {'readonly': True}, + } + + _attribute_map = { + 'actions': {'key': 'actions', 'type': '[str]'}, + 'not_actions': {'key': 'notActions', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingPermissions, self).__init__(**kwargs) + self.actions = None + self.not_actions = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment.py new file mode 100644 index 000000000000..6024d68d792c --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BillingRoleAssignment(Resource): + """a role assignment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar created_on: the date the role assignment is created + :vartype created_on: str + :ivar created_by_principal_tenant_id: the creator's tenant Id + :vartype created_by_principal_tenant_id: str + :ivar created_by_principal_id: the creator's principal Id + :vartype created_by_principal_id: str + :ivar billing_role_assignment_name: the name of the role assignment + :vartype billing_role_assignment_name: str + :ivar principal_id: The user's principal id that the role gets assigned to + :vartype principal_id: str + :ivar role_definition_name: The role defintion id + :vartype role_definition_name: str + :ivar scope: The scope the role get assigned to + :vartype scope: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_on': {'readonly': True}, + 'created_by_principal_tenant_id': {'readonly': True}, + 'created_by_principal_id': {'readonly': True}, + 'billing_role_assignment_name': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'role_definition_name': {'readonly': True}, + 'scope': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'str'}, + 'created_by_principal_tenant_id': {'key': 'properties.createdByPrincipalTenantId', 'type': 'str'}, + 'created_by_principal_id': {'key': 'properties.createdByPrincipalId', 'type': 'str'}, + 'billing_role_assignment_name': {'key': 'properties.name', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'role_definition_name': {'key': 'properties.roleDefinitionName', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingRoleAssignment, self).__init__(**kwargs) + self.created_on = None + self.created_by_principal_tenant_id = None + self.created_by_principal_id = None + self.billing_role_assignment_name = None + self.principal_id = None + self.role_definition_name = None + self.scope = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result.py new file mode 100644 index 000000000000..e0bd17aae8cc --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result.py @@ -0,0 +1,35 @@ +# 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 BillingRoleAssignmentListResult(Model): + """Result of get list of role assignments. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list role assignments + :vartype value: list[~azure.mgmt.billing.models.BillingRoleAssignment] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingRoleAssignment]'}, + } + + def __init__(self, **kwargs): + super(BillingRoleAssignmentListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result_py3.py new file mode 100644 index 000000000000..ff36c26cf4dd --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result_py3.py @@ -0,0 +1,35 @@ +# 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 BillingRoleAssignmentListResult(Model): + """Result of get list of role assignments. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list role assignments + :vartype value: list[~azure.mgmt.billing.models.BillingRoleAssignment] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingRoleAssignment]'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingRoleAssignmentListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.py new file mode 100644 index 000000000000..f565dd006656 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.py @@ -0,0 +1,40 @@ +# 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 BillingRoleAssignmentPayload(Model): + """The payload use to update role assignment on a scope. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The user's principal id that the role gets assigned to + :vartype principal_id: str + :ivar billing_role_definition_name: The role defintion id + :vartype billing_role_definition_name: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'billing_role_definition_name': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'billing_role_definition_name': {'key': 'billingRoleDefinitionName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingRoleAssignmentPayload, self).__init__(**kwargs) + self.principal_id = None + self.billing_role_definition_name = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py new file mode 100644 index 000000000000..a352ca96f8a5 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py @@ -0,0 +1,40 @@ +# 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 BillingRoleAssignmentPayload(Model): + """The payload use to update role assignment on a scope. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The user's principal id that the role gets assigned to + :vartype principal_id: str + :ivar billing_role_definition_name: The role defintion id + :vartype billing_role_definition_name: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'billing_role_definition_name': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'billing_role_definition_name': {'key': 'billingRoleDefinitionName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingRoleAssignmentPayload, self).__init__(**kwargs) + self.principal_id = None + self.billing_role_definition_name = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_py3.py new file mode 100644 index 000000000000..50e5e9156a9e --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_py3.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class BillingRoleAssignment(Resource): + """a role assignment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar created_on: the date the role assignment is created + :vartype created_on: str + :ivar created_by_principal_tenant_id: the creator's tenant Id + :vartype created_by_principal_tenant_id: str + :ivar created_by_principal_id: the creator's principal Id + :vartype created_by_principal_id: str + :ivar billing_role_assignment_name: the name of the role assignment + :vartype billing_role_assignment_name: str + :ivar principal_id: The user's principal id that the role gets assigned to + :vartype principal_id: str + :ivar role_definition_name: The role defintion id + :vartype role_definition_name: str + :ivar scope: The scope the role get assigned to + :vartype scope: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_on': {'readonly': True}, + 'created_by_principal_tenant_id': {'readonly': True}, + 'created_by_principal_id': {'readonly': True}, + 'billing_role_assignment_name': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'role_definition_name': {'readonly': True}, + 'scope': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'str'}, + 'created_by_principal_tenant_id': {'key': 'properties.createdByPrincipalTenantId', 'type': 'str'}, + 'created_by_principal_id': {'key': 'properties.createdByPrincipalId', 'type': 'str'}, + 'billing_role_assignment_name': {'key': 'properties.name', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'role_definition_name': {'key': 'properties.roleDefinitionName', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingRoleAssignment, self).__init__(**kwargs) + self.created_on = None + self.created_by_principal_tenant_id = None + self.created_by_principal_id = None + self.billing_role_assignment_name = None + self.principal_id = None + self.role_definition_name = None + self.scope = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py new file mode 100644 index 000000000000..6c8655f43301 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BillingRoleDefinition(Resource): + """Result of get role definition for a role. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar description: The role description + :vartype description: str + :ivar value: The list OF billingPermissions a caller has on a billing + account. + :vartype value: list[~azure.mgmt.billing.models.BillingPermissions] + :ivar role_name: The name of the role + :vartype role_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'value': {'readonly': True}, + 'role_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'value': {'key': 'properties.permissions.value', 'type': '[BillingPermissions]'}, + 'role_name': {'key': 'properties.roleName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingRoleDefinition, self).__init__(**kwargs) + self.description = None + self.value = None + self.role_name = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result.py new file mode 100644 index 000000000000..c49aa86ed9c8 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result.py @@ -0,0 +1,35 @@ +# 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 BillingRoleDefinitionListResult(Model): + """list the role definitions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of role definitions. + :vartype value: list[~azure.mgmt.billing.models.BillingRoleDefinition] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingRoleDefinition]'}, + } + + def __init__(self, **kwargs): + super(BillingRoleDefinitionListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result_py3.py new file mode 100644 index 000000000000..6132318aaed1 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result_py3.py @@ -0,0 +1,35 @@ +# 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 BillingRoleDefinitionListResult(Model): + """list the role definitions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of role definitions. + :vartype value: list[~azure.mgmt.billing.models.BillingRoleDefinition] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingRoleDefinition]'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingRoleDefinitionListResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py new file mode 100644 index 000000000000..7db2564951ed --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class BillingRoleDefinition(Resource): + """Result of get role definition for a role. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar description: The role description + :vartype description: str + :ivar value: The list OF billingPermissions a caller has on a billing + account. + :vartype value: list[~azure.mgmt.billing.models.BillingPermissions] + :ivar role_name: The name of the role + :vartype role_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'value': {'readonly': True}, + 'role_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'value': {'key': 'properties.permissions.value', 'type': '[BillingPermissions]'}, + 'role_name': {'key': 'properties.roleName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingRoleDefinition, self).__init__(**kwargs) + self.description = None + self.value = None + self.role_name = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context.py index 00a7ab12f173..ef7372a0c02e 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context.py @@ -21,15 +21,15 @@ class EnrollmentAccountContext(Model): :type start_date: datetime :param end_date: Account End Date :type end_date: datetime - :param enrollment_account_id: The enrollment account id. - :type enrollment_account_id: str + :param enrollment_account_name: The enrollment account id. + :type enrollment_account_name: str """ _attribute_map = { 'cost_center': {'key': 'costCenter', 'type': 'str'}, 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, - 'enrollment_account_id': {'key': 'enrollmentAccountId', 'type': 'str'}, + 'enrollment_account_name': {'key': 'enrollmentAccountName', 'type': 'str'}, } def __init__(self, **kwargs): @@ -37,4 +37,4 @@ def __init__(self, **kwargs): self.cost_center = kwargs.get('cost_center', None) self.start_date = kwargs.get('start_date', None) self.end_date = kwargs.get('end_date', None) - self.enrollment_account_id = kwargs.get('enrollment_account_id', None) + self.enrollment_account_name = kwargs.get('enrollment_account_name', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context_py3.py index 24c70723c07b..10dd1f3d0236 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context_py3.py @@ -21,20 +21,20 @@ class EnrollmentAccountContext(Model): :type start_date: datetime :param end_date: Account End Date :type end_date: datetime - :param enrollment_account_id: The enrollment account id. - :type enrollment_account_id: str + :param enrollment_account_name: The enrollment account id. + :type enrollment_account_name: str """ _attribute_map = { 'cost_center': {'key': 'costCenter', 'type': 'str'}, 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, - 'enrollment_account_id': {'key': 'enrollmentAccountId', 'type': 'str'}, + 'enrollment_account_name': {'key': 'enrollmentAccountName', 'type': 'str'}, } - def __init__(self, *, cost_center: str=None, start_date=None, end_date=None, enrollment_account_id: str=None, **kwargs) -> None: + def __init__(self, *, cost_center: str=None, start_date=None, end_date=None, enrollment_account_name: str=None, **kwargs) -> None: super(EnrollmentAccountContext, self).__init__(**kwargs) self.cost_center = cost_center self.start_date = start_date self.end_date = end_date - self.enrollment_account_id = enrollment_account_id + self.enrollment_account_name = enrollment_account_name diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py index 644eb4e804f8..6af50002d8cc 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py @@ -15,14 +15,15 @@ class TransferBillingSubscriptionRequest(Model): """Request parameters to transfer billing subscription. - :param destination_invoice_section_id: The destination invoiceSectionId. - :type destination_invoice_section_id: str + :param destination_invoice_section_name: The destination + invoiceSectionName. + :type destination_invoice_section_name: str """ _attribute_map = { - 'destination_invoice_section_id': {'key': 'properties.destinationInvoiceSectionId', 'type': 'str'}, + 'destination_invoice_section_name': {'key': 'properties.destinationInvoiceSectionName', 'type': 'str'}, } def __init__(self, **kwargs): super(TransferBillingSubscriptionRequest, self).__init__(**kwargs) - self.destination_invoice_section_id = kwargs.get('destination_invoice_section_id', None) + self.destination_invoice_section_name = kwargs.get('destination_invoice_section_name', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py index c72ba7021efb..32e96f842cdf 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py @@ -15,14 +15,15 @@ class TransferBillingSubscriptionRequestProperties(Model): """Request parameters to transfer billing subscription. - :param destination_invoice_section_id: The destination invoiceSectionId. - :type destination_invoice_section_id: str + :param destination_invoice_section_name: The destination + invoiceSectionName. + :type destination_invoice_section_name: str """ _attribute_map = { - 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, + 'destination_invoice_section_name': {'key': 'destinationInvoiceSectionName', 'type': 'str'}, } def __init__(self, **kwargs): super(TransferBillingSubscriptionRequestProperties, self).__init__(**kwargs) - self.destination_invoice_section_id = kwargs.get('destination_invoice_section_id', None) + self.destination_invoice_section_name = kwargs.get('destination_invoice_section_name', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py index 2aad5ad5cce0..95d748e6b66d 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py @@ -15,14 +15,15 @@ class TransferBillingSubscriptionRequestProperties(Model): """Request parameters to transfer billing subscription. - :param destination_invoice_section_id: The destination invoiceSectionId. - :type destination_invoice_section_id: str + :param destination_invoice_section_name: The destination + invoiceSectionName. + :type destination_invoice_section_name: str """ _attribute_map = { - 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, + 'destination_invoice_section_name': {'key': 'destinationInvoiceSectionName', 'type': 'str'}, } - def __init__(self, *, destination_invoice_section_id: str=None, **kwargs) -> None: + def __init__(self, *, destination_invoice_section_name: str=None, **kwargs) -> None: super(TransferBillingSubscriptionRequestProperties, self).__init__(**kwargs) - self.destination_invoice_section_id = destination_invoice_section_id + self.destination_invoice_section_name = destination_invoice_section_name diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py index 1256de722471..6d12cbdb86c7 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py @@ -15,14 +15,15 @@ class TransferBillingSubscriptionRequest(Model): """Request parameters to transfer billing subscription. - :param destination_invoice_section_id: The destination invoiceSectionId. - :type destination_invoice_section_id: str + :param destination_invoice_section_name: The destination + invoiceSectionName. + :type destination_invoice_section_name: str """ _attribute_map = { - 'destination_invoice_section_id': {'key': 'properties.destinationInvoiceSectionId', 'type': 'str'}, + 'destination_invoice_section_name': {'key': 'properties.destinationInvoiceSectionName', 'type': 'str'}, } - def __init__(self, *, destination_invoice_section_id: str=None, **kwargs) -> None: + def __init__(self, *, destination_invoice_section_name: str=None, **kwargs) -> None: super(TransferBillingSubscriptionRequest, self).__init__(**kwargs) - self.destination_invoice_section_id = destination_invoice_section_id + self.destination_invoice_section_name = destination_invoice_section_name diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result.py index a3a4b5c4e5c9..a606c5260389 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result.py @@ -15,14 +15,14 @@ class TransferBillingSubscriptionResult(Model): """Request parameters to transfer billing subscription. - :param billing_subscription_id: The destination billing subscription id. - :type billing_subscription_id: str + :param billing_subscription_name: The destination billing subscription id. + :type billing_subscription_name: str """ _attribute_map = { - 'billing_subscription_id': {'key': 'properties.billingSubscriptionId', 'type': 'str'}, + 'billing_subscription_name': {'key': 'properties.billingSubscriptionName', 'type': 'str'}, } def __init__(self, **kwargs): super(TransferBillingSubscriptionResult, self).__init__(**kwargs) - self.billing_subscription_id = kwargs.get('billing_subscription_id', None) + self.billing_subscription_name = kwargs.get('billing_subscription_name', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result_py3.py index 7fe20ee4ea05..116dbe42cef3 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result_py3.py @@ -15,14 +15,14 @@ class TransferBillingSubscriptionResult(Model): """Request parameters to transfer billing subscription. - :param billing_subscription_id: The destination billing subscription id. - :type billing_subscription_id: str + :param billing_subscription_name: The destination billing subscription id. + :type billing_subscription_name: str """ _attribute_map = { - 'billing_subscription_id': {'key': 'properties.billingSubscriptionId', 'type': 'str'}, + 'billing_subscription_name': {'key': 'properties.billingSubscriptionName', 'type': 'str'}, } - def __init__(self, *, billing_subscription_id: str=None, **kwargs) -> None: + def __init__(self, *, billing_subscription_name: str=None, **kwargs) -> None: super(TransferBillingSubscriptionResult, self).__init__(**kwargs) - self.billing_subscription_id = billing_subscription_id + self.billing_subscription_name = billing_subscription_name diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py index 9feaa795f8f8..47ca8b229e97 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py @@ -15,14 +15,14 @@ class TransferProductRequestProperties(Model): """The properties of the product to initiate a transfer. - :param destination_invoice_section_id: Destination invoice section id. - :type destination_invoice_section_id: str + :param destination_invoice_section_name: Destination invoice section id. + :type destination_invoice_section_name: str """ _attribute_map = { - 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, + 'destination_invoice_section_name': {'key': 'destinationInvoiceSectionName', 'type': 'str'}, } def __init__(self, **kwargs): super(TransferProductRequestProperties, self).__init__(**kwargs) - self.destination_invoice_section_id = kwargs.get('destination_invoice_section_id', None) + self.destination_invoice_section_name = kwargs.get('destination_invoice_section_name', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py index 029af2856f0e..715e24e5b95b 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py @@ -15,14 +15,14 @@ class TransferProductRequestProperties(Model): """The properties of the product to initiate a transfer. - :param destination_invoice_section_id: Destination invoice section id. - :type destination_invoice_section_id: str + :param destination_invoice_section_name: Destination invoice section id. + :type destination_invoice_section_name: str """ _attribute_map = { - 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, + 'destination_invoice_section_name': {'key': 'destinationInvoiceSectionName', 'type': 'str'}, } - def __init__(self, *, destination_invoice_section_id: str=None, **kwargs) -> None: + def __init__(self, *, destination_invoice_section_name: str=None, **kwargs) -> None: super(TransferProductRequestProperties, self).__init__(**kwargs) - self.destination_invoice_section_id = destination_invoice_section_id + self.destination_invoice_section_name = destination_invoice_section_name diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index 870264027c11..1c936c305cd0 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -13,14 +13,14 @@ from .billing_accounts_with_create_invoice_section_permission_operations import BillingAccountsWithCreateInvoiceSectionPermissionOperations from .available_balance_by_billing_profile_operations import AvailableBalanceByBillingProfileOperations from .payment_methods_by_billing_profile_operations import PaymentMethodsByBillingProfileOperations -from .billing_profiles_by_billing_account_id_operations import BillingProfilesByBillingAccountIdOperations +from .billing_profiles_by_billing_account_name_operations import BillingProfilesByBillingAccountNameOperations from .billing_profiles_operations import BillingProfilesOperations -from .invoice_sections_by_billing_account_id_operations import InvoiceSectionsByBillingAccountIdOperations +from .invoice_sections_by_billing_account_name_operations import InvoiceSectionsByBillingAccountNameOperations from .invoice_sections_operations import InvoiceSectionsOperations from .invoice_sections_with_create_subscription_permission_operations import InvoiceSectionsWithCreateSubscriptionPermissionOperations -from .departments_by_billing_account_id_operations import DepartmentsByBillingAccountIdOperations +from .departments_by_billing_account_name_operations import DepartmentsByBillingAccountNameOperations from .departments_operations import DepartmentsOperations -from .enrollment_accounts_by_billing_account_id_operations import EnrollmentAccountsByBillingAccountIdOperations +from .enrollment_accounts_by_billing_account_name_operations import EnrollmentAccountsByBillingAccountNameOperations from .enrollment_accounts_operations import EnrollmentAccountsOperations from .invoices_by_billing_account_operations import InvoicesByBillingAccountOperations from .invoice_pricesheet_operations import InvoicePricesheetOperations @@ -37,20 +37,29 @@ from .policy_operations import PolicyOperations from .billing_property_operations import BillingPropertyOperations from .operations import Operations +from .billing_accountbilling_permissions_operations import BillingAccountbillingPermissionsOperations +from .invoice_sectionsbilling_permissions_operations import InvoiceSectionsbillingPermissionsOperations +from .billing_profilebilling_permissions_operations import BillingProfilebillingPermissionsOperations +from .billing_accountbilling_role_definition_operations import BillingAccountbillingRoleDefinitionOperations +from .invoice_sectionbilling_role_definition_operations import InvoiceSectionbillingRoleDefinitionOperations +from .billing_profilebilling_role_definition_operations import BillingProfilebillingRoleDefinitionOperations +from .billing_accountbilling_role_assignment_operations import BillingAccountbillingRoleAssignmentOperations +from .invoice_sectionbilling_role_assignment_operations import InvoiceSectionbillingRoleAssignmentOperations +from .billing_profilebilling_role_assignment_operations import BillingProfilebillingRoleAssignmentOperations __all__ = [ 'BillingAccountsOperations', 'BillingAccountsWithCreateInvoiceSectionPermissionOperations', 'AvailableBalanceByBillingProfileOperations', 'PaymentMethodsByBillingProfileOperations', - 'BillingProfilesByBillingAccountIdOperations', + 'BillingProfilesByBillingAccountNameOperations', 'BillingProfilesOperations', - 'InvoiceSectionsByBillingAccountIdOperations', + 'InvoiceSectionsByBillingAccountNameOperations', 'InvoiceSectionsOperations', 'InvoiceSectionsWithCreateSubscriptionPermissionOperations', - 'DepartmentsByBillingAccountIdOperations', + 'DepartmentsByBillingAccountNameOperations', 'DepartmentsOperations', - 'EnrollmentAccountsByBillingAccountIdOperations', + 'EnrollmentAccountsByBillingAccountNameOperations', 'EnrollmentAccountsOperations', 'InvoicesByBillingAccountOperations', 'InvoicePricesheetOperations', @@ -67,4 +76,13 @@ 'PolicyOperations', 'BillingPropertyOperations', 'Operations', + 'BillingAccountbillingPermissionsOperations', + 'InvoiceSectionsbillingPermissionsOperations', + 'BillingProfilebillingPermissionsOperations', + 'BillingAccountbillingRoleDefinitionOperations', + 'InvoiceSectionbillingRoleDefinitionOperations', + 'BillingProfilebillingRoleDefinitionOperations', + 'BillingAccountbillingRoleAssignmentOperations', + 'InvoiceSectionbillingRoleAssignmentOperations', + 'BillingProfilebillingRoleAssignmentOperations', ] diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/available_balance_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/available_balance_by_billing_profile_operations.py index 1d75c0a7e2fa..f4d743d0317a 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/available_balance_by_billing_profile_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/available_balance_by_billing_profile_operations.py @@ -37,14 +37,14 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def get( - self, billing_account_id, billing_profile_id, custom_headers=None, raw=False, **operation_config): - """The latest available credit balance for a given billingAccountId and - billingProfileId. - - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param billing_profile_id: Billing Profile Id. - :type billing_profile_id: str + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """The latest available credit balance for a given billingAccountName and + billingProfileName. + + :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 @@ -59,8 +59,8 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, '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) @@ -95,4 +95,4 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/availableBalance/default'} + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/availableBalance/default'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_permissions_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_permissions_operations.py new file mode 100644 index 000000000000..c1b32be6bcdd --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_permissions_operations.py @@ -0,0 +1,94 @@ +# 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 BillingAccountbillingPermissionsOperations(object): + """BillingAccountbillingPermissionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """Lists all billingPermissions for the caller has for a billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingPermissionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingPermissionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + 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('BillingPermissionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingPermissions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_role_assignment_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_role_assignment_operations.py new file mode 100644 index 000000000000..3cc3f29760e4 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_role_assignment_operations.py @@ -0,0 +1,279 @@ +# 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 BillingAccountbillingRoleAssignmentOperations(object): + """BillingAccountbillingRoleAssignmentOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignment for the caller. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_role_assignment_name: role assignment id. + :type billing_role_assignment_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: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment 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'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_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('BillingRoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def delete( + self, billing_account_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Delete the role assignment on this billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_role_assignment_name: role assignment id. + :type billing_role_assignment_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: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_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.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('BillingRoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def list( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignments on the Billing Account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + 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('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments'} + + def add( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """The operation to add a role assignment to a billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = None + + # Construct URL + url = self.add.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, 'BillingRoleAssignmentPayload') + + # 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 [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/createBillingRoleAssignment'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_role_definition_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_role_definition_operations.py new file mode 100644 index 000000000000..59c7821b36aa --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_role_definition_operations.py @@ -0,0 +1,155 @@ +# 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 BillingAccountbillingRoleDefinitionOperations(object): + """BillingAccountbillingRoleDefinitionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_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_role_definition_name: role definition id. + :type billing_role_definition_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: BillingRoleDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinition 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'), + 'billingRoleDefinitionName': self._serialize.url("billing_role_definition_name", billing_role_definition_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('BillingRoleDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}'} + + def list( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """Lists the role definition for a billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingRoleDefinitionListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinitionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + 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('BillingRoleDefinitionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleDefinitions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py index 1bc83a3badf0..e2df4e98e87d 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py @@ -93,11 +93,11 @@ def list( list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts'} def get( - self, billing_account_id, expand=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): """Get the billing account by id. - :param billing_account_id: billing Account Id. - :type billing_account_id: str + :param billing_account_name: billing Account Id. + :type billing_account_name: str :param expand: May be used to expand the invoiceSections and billingProfiles. :type expand: str @@ -115,7 +115,7 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -152,4 +152,4 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}'} + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_permissions_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_permissions_operations.py new file mode 100644 index 000000000000..8c9430429cb6 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_permissions_operations.py @@ -0,0 +1,97 @@ +# 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 BillingProfilebillingPermissionsOperations(object): + """BillingProfilebillingPermissionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """Lists all billingPermissions for the caller has for 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 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: BillingPermissionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingPermissionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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('BillingPermissionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingPermissions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_role_assignment_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_role_assignment_operations.py new file mode 100644 index 000000000000..2d104699b91b --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_role_assignment_operations.py @@ -0,0 +1,291 @@ +# 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 BillingProfilebillingRoleAssignmentOperations(object): + """BillingProfilebillingRoleAssignmentOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_name, billing_profile_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignment for the caller on the 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 billing_role_assignment_name: role assignment id. + :type billing_role_assignment_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: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment 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'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_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('BillingRoleAssignment', 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}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def delete( + self, billing_account_name, billing_profile_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Delete the role assignment on this 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 billing_role_assignment_name: role assignment id. + :type billing_role_assignment_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: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.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'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_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.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('BillingRoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def list( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignments on the 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: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleAssignments'} + + def add( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """The operation to add a role assignment to 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: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = None + + # Construct URL + url = self.add.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' + 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, 'BillingRoleAssignmentPayload') + + # 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 [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/createBillingRoleAssignment'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_role_definition_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_role_definition_operations.py new file mode 100644 index 000000000000..5551593fb9b4 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_role_definition_operations.py @@ -0,0 +1,161 @@ +# 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 BillingProfilebillingRoleDefinitionOperations(object): + """BillingProfilebillingRoleDefinitionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_name, billing_profile_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 billing_role_definition_name: role definition id. + :type billing_role_definition_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: BillingRoleDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinition 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'), + 'billingRoleDefinitionName': self._serialize.url("billing_role_definition_name", billing_role_definition_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('BillingRoleDefinition', 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}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}'} + + def list( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """Lists the role definition 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: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingRoleDefinitionListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinitionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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('BillingRoleDefinitionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleDefinitions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_by_billing_account_id_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_by_billing_account_name_operations.py similarity index 88% rename from azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_by_billing_account_id_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_by_billing_account_name_operations.py index 3ecd2dd6e428..c5b107bebdf5 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_by_billing_account_id_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_by_billing_account_name_operations.py @@ -15,8 +15,8 @@ from .. import models -class BillingProfilesByBillingAccountIdOperations(object): - """BillingProfilesByBillingAccountIdOperations operations. +class BillingProfilesByBillingAccountNameOperations(object): + """BillingProfilesByBillingAccountNameOperations operations. :param client: Client for service requests. :param config: Configuration of service client. @@ -37,11 +37,11 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list( - self, billing_account_id, expand=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): """Lists all billing profiles for a user which that user has access to. - :param billing_account_id: billing Account Id. - :type billing_account_id: str + :param billing_account_name: billing Account Id. + :type billing_account_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 @@ -58,7 +58,7 @@ def list( # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -95,4 +95,4 @@ def list( return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles'} + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py index 6c3a8f73d71f..023bd234b1ed 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py @@ -39,13 +39,13 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def get( - self, billing_account_id, billing_profile_id, expand=None, custom_headers=None, raw=False, **operation_config): + 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_id: billing Account Id. - :type billing_account_id: str - :param billing_profile_id: Billing Profile Id. - :type billing_profile_id: str + :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 @@ -62,8 +62,8 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, '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) @@ -100,16 +100,16 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'} + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}'} def _update_initial( - self, billing_account_id, billing_profile_id, 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.update.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, '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) @@ -156,13 +156,13 @@ def _update_initial( return deserialized def update( - self, billing_account_id, billing_profile_id, 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 update a billing profile. - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param billing_profile_id: Billing Profile Id. - :type billing_profile_id: str + :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 parameters: Parameters supplied to the update billing profile operation. :type parameters: ~azure.mgmt.billing.models.BillingProfile @@ -181,8 +181,8 @@ def update( :class:`ErrorResponseException` """ raw_result = self._update_initial( - billing_account_id=billing_account_id, - billing_profile_id=billing_profile_id, + billing_account_name=billing_account_name, + billing_profile_name=billing_profile_name, parameters=parameters, custom_headers=custom_headers, raw=True, @@ -210,4 +210,4 @@ 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/{billingAccountId}/billingProfiles/{billingProfileId}'} + update.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py index 35491decba02..2da5d990012d 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscription_operations.py @@ -39,15 +39,15 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def get( - self, billing_account_id, invoice_section_id, billing_subscription_id, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, invoice_section_name, billing_subscription_name, custom_headers=None, raw=False, **operation_config): """Get a single billing subscription by name. - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param invoice_section_id: InvoiceSection Id. - :type invoice_section_id: str - :param billing_subscription_id: Billing Subscription Id. - :type billing_subscription_id: str + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_subscription_name: Billing Subscription Id. + :type billing_subscription_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 @@ -62,9 +62,9 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'invoiceSectionId': self._serialize.url("invoice_section_id", invoice_section_id, 'str'), - 'billingSubscriptionId': self._serialize.url("billing_subscription_id", billing_subscription_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingSubscriptionName': self._serialize.url("billing_subscription_name", billing_subscription_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -99,19 +99,19 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}/billingSubscriptions/{billingSubscriptionId}'} + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}'} def _transfer_initial( - self, billing_account_id, invoice_section_id, destination_invoice_section_id=None, custom_headers=None, raw=False, **operation_config): - parameters = models.TransferBillingSubscriptionRequestProperties(destination_invoice_section_id=destination_invoice_section_id) + self, billing_account_name, invoice_section_name, billing_subscription_name, destination_invoice_section_name=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TransferBillingSubscriptionRequestProperties(destination_invoice_section_name=destination_invoice_section_name) # Construct URL url = self.transfer.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'invoiceSectionId': self._serialize.url("invoice_section_id", invoice_section_id, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingSubscriptionName': self._serialize.url("billing_subscription_name", billing_subscription_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -158,17 +158,19 @@ def _transfer_initial( return deserialized def transfer( - self, billing_account_id, invoice_section_id, destination_invoice_section_id=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, billing_account_name, invoice_section_name, billing_subscription_name, destination_invoice_section_name=None, custom_headers=None, raw=False, polling=True, **operation_config): """Transfers the GTM subscription from one invoice section to another within a billing account. - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param invoice_section_id: InvoiceSection Id. - :type invoice_section_id: str - :param destination_invoice_section_id: The destination - invoiceSectionId. - :type destination_invoice_section_id: str + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_subscription_name: Billing Subscription Id. + :type billing_subscription_name: str + :param destination_invoice_section_name: The destination + invoiceSectionName. + :type destination_invoice_section_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 @@ -185,9 +187,10 @@ def transfer( :class:`ErrorResponseException` """ raw_result = self._transfer_initial( - billing_account_id=billing_account_id, - invoice_section_id=invoice_section_id, - destination_invoice_section_id=destination_invoice_section_id, + billing_account_name=billing_account_name, + invoice_section_name=invoice_section_name, + billing_subscription_name=billing_subscription_name, + destination_invoice_section_name=destination_invoice_section_name, custom_headers=custom_headers, raw=True, **operation_config @@ -215,4 +218,4 @@ 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/{billingAccountId}/invoiceSections/{invoiceSectionId}/billingSubscriptions/{subscriptionId}/transfer'} + transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/transfer'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py index cb7390b76069..788ce0e94f88 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_billing_profile_operations.py @@ -37,13 +37,13 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list( - self, billing_account_id, billing_profile_id, custom_headers=None, raw=False, **operation_config): - """Lists billing subscriptions by billingProfileId. + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """Lists billing subscriptions by billingProfileName. - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param billing_profile_id: Billing Profile Id. - :type billing_profile_id: str + :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 @@ -59,8 +59,8 @@ def list( # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, '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) @@ -95,4 +95,4 @@ def list( return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}/billingSubscriptions'} + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfile/{billingProfileName}/billingSubscriptions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_invoice_section_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_invoice_section_operations.py index a6a839312b1e..55d6e5916929 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_invoice_section_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_by_invoice_section_operations.py @@ -37,13 +37,13 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list( - self, billing_account_id, invoice_section_id, custom_headers=None, raw=False, **operation_config): - """Lists billing subscription by invoiceSectionId. + self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Lists billing subscription by invoiceSectionName. - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param invoice_section_id: InvoiceSection Id. - :type invoice_section_id: str + :param billing_account_name: billing Account Id. + :type billing_account_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 @@ -59,8 +59,8 @@ def list( # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'invoiceSectionId': self._serialize.url("invoice_section_id", invoice_section_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -95,4 +95,4 @@ def list( return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}/billingSubscriptions'} + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/departments_by_billing_account_id_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/departments_by_billing_account_name_operations.py similarity index 89% rename from azure-mgmt-billing/azure/mgmt/billing/operations/departments_by_billing_account_id_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/departments_by_billing_account_name_operations.py index adda34ba245b..172983a0c965 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/departments_by_billing_account_id_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/departments_by_billing_account_name_operations.py @@ -15,8 +15,8 @@ from .. import models -class DepartmentsByBillingAccountIdOperations(object): - """DepartmentsByBillingAccountIdOperations operations. +class DepartmentsByBillingAccountNameOperations(object): + """DepartmentsByBillingAccountNameOperations operations. :param client: Client for service requests. :param config: Configuration of service client. @@ -37,11 +37,11 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list( - self, billing_account_id, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): """Lists all departments for a user which he has access to. - :param billing_account_id: billing Account Id. - :type billing_account_id: str + :param billing_account_name: billing Account Id. + :type billing_account_name: str :param expand: May be used to expand the enrollmentAccounts. :type expand: str :param filter: The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and @@ -63,7 +63,7 @@ def list( # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -102,4 +102,4 @@ def list( return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments'} + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py index 209022fda2fc..d455356b1845 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py @@ -37,13 +37,13 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def get( - self, billing_account_id, department_id, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, department_name, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): """Get the department by id. - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param department_id: Department Id. - :type department_id: str + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param department_name: Department Id. + :type department_name: str :param expand: May be used to expand the enrollmentAccounts. :type expand: str :param filter: The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and @@ -65,8 +65,8 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'departmentId': self._serialize.url("department_id", department_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'departmentName': self._serialize.url("department_name", department_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -105,4 +105,4 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'} + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_by_billing_account_id_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_by_billing_account_name_operations.py similarity index 88% rename from azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_by_billing_account_id_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_by_billing_account_name_operations.py index 3214a240686a..768b8cf0bfdb 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_by_billing_account_id_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_by_billing_account_name_operations.py @@ -15,8 +15,8 @@ from .. import models -class EnrollmentAccountsByBillingAccountIdOperations(object): - """EnrollmentAccountsByBillingAccountIdOperations operations. +class EnrollmentAccountsByBillingAccountNameOperations(object): + """EnrollmentAccountsByBillingAccountNameOperations operations. :param client: Client for service requests. :param config: Configuration of service client. @@ -37,11 +37,11 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list( - self, billing_account_id, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): """Lists all Enrollment Accounts for a user which he has access to. - :param billing_account_id: billing Account Id. - :type billing_account_id: str + :param billing_account_name: billing Account Id. + :type billing_account_name: str :param expand: May be used to expand the department. :type expand: str :param filter: The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and @@ -63,7 +63,7 @@ def list( # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -102,4 +102,4 @@ def list( return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts'} + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py index f12258dae6ee..3686d725dbb4 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py @@ -37,13 +37,13 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def get_by_enrollment_account_account_id( - self, billing_account_id, enrollment_account_id, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, enrollment_account_name, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): """Get the enrollment account by id. - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param enrollment_account_id: Enrollment Account Id. - :type enrollment_account_id: str + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param enrollment_account_name: Enrollment Account Id. + :type enrollment_account_name: str :param expand: May be used to expand the Department. :type expand: str :param filter: The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and @@ -65,8 +65,8 @@ def get_by_enrollment_account_account_id( # Construct URL url = self.get_by_enrollment_account_account_id.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'enrollmentAccountId': self._serialize.url("enrollment_account_id", enrollment_account_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'enrollmentAccountName': self._serialize.url("enrollment_account_name", enrollment_account_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -105,4 +105,4 @@ def get_by_enrollment_account_account_id( return client_raw_response return deserialized - get_by_enrollment_account_account_id.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'} + get_by_enrollment_account_account_id.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py index 1c3cbd30f5d1..462be27bbfc4 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py @@ -37,13 +37,13 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def get( - self, billing_account_id, billing_profile_id, 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): """Get the invoice by id. - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param billing_profile_id: Billing Profile Id. - :type billing_profile_id: str + :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_name: Invoide Id. :type invoice_name: str :param dict custom_headers: headers that will be added to the request @@ -60,8 +60,8 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str'), + '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) @@ -97,4 +97,4 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoices/{invoiceName}'} + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_pricesheet_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_pricesheet_operations.py index c51f79dd3148..82914f0724ca 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_pricesheet_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_pricesheet_operations.py @@ -40,11 +40,11 @@ def __init__(self, client, config, serializer, deserializer): def _download_initial( - self, billing_account_id, invoice_name, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, invoice_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.download.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), 'invoiceName': self._serialize.url("invoice_name", invoice_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -90,11 +90,11 @@ def _download_initial( return deserialized def download( - self, billing_account_id, invoice_name, custom_headers=None, raw=False, polling=True, **operation_config): + self, billing_account_name, invoice_name, custom_headers=None, raw=False, polling=True, **operation_config): """Get pricesheet data for invoice id (invoiceName). - :param billing_account_id: Azure Billing Account ID. - :type billing_account_id: str + :param billing_account_name: Azure Billing Account ID. + :type billing_account_name: str :param invoice_name: The name of an invoice resource. :type invoice_name: str :param dict custom_headers: headers that will be added to the request @@ -112,7 +112,7 @@ def download( :class:`ErrorResponseException` """ raw_result = self._download_initial( - billing_account_id=billing_account_id, + billing_account_name=billing_account_name, invoice_name=invoice_name, custom_headers=custom_headers, raw=True, @@ -142,4 +142,4 @@ 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/{billingAccountId}/invoices/{invoiceName}/pricesheet/default/download'} + download.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/pricesheet/default/download'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionbilling_role_assignment_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionbilling_role_assignment_operations.py new file mode 100644 index 000000000000..ff9da198b71a --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionbilling_role_assignment_operations.py @@ -0,0 +1,291 @@ +# 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 InvoiceSectionbillingRoleAssignmentOperations(object): + """InvoiceSectionbillingRoleAssignmentOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_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 invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_role_assignment_name: role assignment id. + :type billing_role_assignment_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: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment 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'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_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('BillingRoleAssignment', 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}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def delete( + self, billing_account_name, invoice_section_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Delete the role assignment on this invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_role_assignment_name: role assignment id. + :type billing_role_assignment_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: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_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.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('BillingRoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def list( + self, billing_account_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 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: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments'} + + def add( + self, billing_account_name, invoice_section_name, 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 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: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = None + + # Construct URL + url = self.add.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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, 'BillingRoleAssignmentPayload') + + # 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 [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/createBillingRoleAssignment'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionbilling_role_definition_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionbilling_role_definition_operations.py new file mode 100644 index 000000000000..e6f088a9e709 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionbilling_role_definition_operations.py @@ -0,0 +1,161 @@ +# 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 InvoiceSectionbillingRoleDefinitionOperations(object): + """InvoiceSectionbillingRoleDefinitionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, billing_account_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 invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_role_definition_name: role definition id. + :type billing_role_definition_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: BillingRoleDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinition 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'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingRoleDefinitionName': self._serialize.url("billing_role_definition_name", billing_role_definition_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('BillingRoleDefinition', 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}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}'} + + def list( + self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Lists the role definition for a invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_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: BillingRoleDefinitionListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinitionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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('BillingRoleDefinitionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleDefinitions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_id_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_name_operations.py similarity index 88% rename from azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_id_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_name_operations.py index f1fb5fbafbe4..cf321426d2a5 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_id_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_by_billing_account_name_operations.py @@ -15,8 +15,8 @@ from .. import models -class InvoiceSectionsByBillingAccountIdOperations(object): - """InvoiceSectionsByBillingAccountIdOperations operations. +class InvoiceSectionsByBillingAccountNameOperations(object): + """InvoiceSectionsByBillingAccountNameOperations operations. :param client: Client for service requests. :param config: Configuration of service client. @@ -37,11 +37,11 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list( - self, billing_account_id, expand=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): """Lists all invoice sections for a user which he has access to. - :param billing_account_id: billing Account Id. - :type billing_account_id: str + :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 dict custom_headers: headers that will be added to the request @@ -58,7 +58,7 @@ def list( # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -101,4 +101,4 @@ def list( return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections'} + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py index f132bb8d2a39..10b082a6bb5a 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py @@ -40,13 +40,13 @@ def __init__(self, client, config, serializer, deserializer): def _create_initial( - self, billing_account_id, display_name=None, billing_profiles=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, display_name=None, billing_profiles=None, custom_headers=None, raw=False, **operation_config): parameters = models.InvoiceSectionProperties(display_name=display_name, billing_profiles=billing_profiles) # Construct URL url = self.create.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -94,11 +94,11 @@ def _create_initial( return deserialized def create( - self, billing_account_id, display_name=None, billing_profiles=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, billing_account_name, display_name=None, billing_profiles=None, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to create a InvoiceSection. - :param billing_account_id: billing Account Id. - :type billing_account_id: str + :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_profiles: The billing profiles associated to the @@ -120,7 +120,7 @@ def create( :class:`ErrorResponseException` """ raw_result = self._create_initial( - billing_account_id=billing_account_id, + billing_account_name=billing_account_name, display_name=display_name, billing_profiles=billing_profiles, custom_headers=custom_headers, @@ -150,16 +150,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) - create.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections'} + create.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections'} def get( - self, billing_account_id, invoice_section_id, expand=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, invoice_section_name, expand=None, custom_headers=None, raw=False, **operation_config): """Get the InvoiceSection by id. - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param invoice_section_id: InvoiceSection Id. - :type invoice_section_id: str + :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 @@ -176,8 +176,8 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'invoiceSectionId': self._serialize.url("invoice_section_id", invoice_section_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -214,18 +214,18 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'} + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}'} def _update_initial( - self, billing_account_id, invoice_section_id, display_name=None, billing_profiles=None, custom_headers=None, raw=False, **operation_config): + 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) # Construct URL url = self.update.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'invoiceSectionId': self._serialize.url("invoice_section_id", invoice_section_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -272,13 +272,13 @@ def _update_initial( return deserialized def update( - self, billing_account_id, invoice_section_id, display_name=None, billing_profiles=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, billing_account_name, invoice_section_name, display_name=None, billing_profiles=None, custom_headers=None, raw=False, polling=True, **operation_config): """The operation to update a InvoiceSection. - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param invoice_section_id: InvoiceSection Id. - :type invoice_section_id: str + :param billing_account_name: billing Account Id. + :type billing_account_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 @@ -300,8 +300,8 @@ def update( :class:`ErrorResponseException` """ raw_result = self._update_initial( - billing_account_id=billing_account_id, - invoice_section_id=invoice_section_id, + billing_account_name=billing_account_name, + invoice_section_name=invoice_section_name, display_name=display_name, billing_profiles=billing_profiles, custom_headers=custom_headers, @@ -330,4 +330,4 @@ 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/{billingAccountId}/invoiceSections/{invoiceSectionId}'} + update.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py index e5eabe36f304..9e7f4efa1681 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_with_create_subscription_permission_operations.py @@ -37,12 +37,12 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list( - self, billing_account_id, expand=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): """Lists all invoiceSections with create subscription permission for a user. - :param billing_account_id: billing Account Id. - :type billing_account_id: str + :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 dict custom_headers: headers that will be added to the request @@ -59,7 +59,7 @@ def list( # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -102,4 +102,4 @@ def list( return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/listInvoiceSectionsWithCreateSubscriptionPermission'} + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/listInvoiceSectionsWithCreateSubscriptionPermission'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionsbilling_permissions_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionsbilling_permissions_operations.py new file mode 100644 index 000000000000..b72a21e7b141 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionsbilling_permissions_operations.py @@ -0,0 +1,97 @@ +# 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 InvoiceSectionsbillingPermissionsOperations(object): + """InvoiceSectionsbillingPermissionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Lists all billingPermissions for the caller has for a Invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_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: BillingPermissionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingPermissionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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('BillingPermissionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingPermissions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_account_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_account_operations.py index 98cf7397ccef..ebe0c5541426 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_account_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_account_operations.py @@ -37,11 +37,11 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list( - self, billing_account_id, period_start_date, period_end_date, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, period_start_date, period_end_date, custom_headers=None, raw=False, **operation_config): """List of invoices for a billing account. - :param billing_account_id: billing Account Id. - :type billing_account_id: str + :param billing_account_name: billing Account Id. + :type billing_account_name: str :param period_start_date: Invoice period start date. :type period_start_date: str :param period_end_date: Invoice period end date. @@ -60,7 +60,7 @@ def list( # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -97,4 +97,4 @@ def list( return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoices'} + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_profile_operations.py index 8a75998d8723..6ab2dea8e87b 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_profile_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_by_billing_profile_operations.py @@ -37,13 +37,13 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list( - self, billing_account_id, billing_profile_id, period_start_date, period_end_date, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, period_start_date, period_end_date, custom_headers=None, raw=False, **operation_config): """List of invoices for a billing profile. - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param billing_profile_id: Billing Profile Id. - :type billing_profile_id: str + :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 period_start_date: Invoice period start date. :type period_start_date: str :param period_end_date: Invoice period end date. @@ -62,8 +62,8 @@ def list( # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, '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) @@ -100,4 +100,4 @@ def list( return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoices'} + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_by_billing_profile_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_by_billing_profile_operations.py index 1816d597fa1d..efdccfb7b5d7 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_by_billing_profile_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_by_billing_profile_operations.py @@ -37,13 +37,13 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list( - self, billing_account_id, billing_profile_id, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): """Lists the Payment Methods by billing profile Id. - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param billing_profile_id: Billing Profile Id. - :type billing_profile_id: str + :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 @@ -61,8 +61,8 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, '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) @@ -102,4 +102,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/paymentMethods'} + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/paymentMethods'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py index aa2249813cee..674f8c4ca445 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/policy_operations.py @@ -37,13 +37,13 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def get_by_billing_profile( - self, billing_account_id, billing_profile_id, custom_headers=None, raw=False, **operation_config): - """The policy for a given billingAccountId and billingProfileId. + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """The policy for a given billingAccountName and billingProfileName. - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param billing_profile_id: Billing Profile Id. - :type billing_profile_id: str + :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 @@ -58,8 +58,8 @@ def get_by_billing_profile( # Construct URL url = self.get_by_billing_profile.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, '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) @@ -94,16 +94,16 @@ def get_by_billing_profile( return client_raw_response return deserialized - get_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/policies/default'} + get_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default'} def update( - self, billing_account_id, billing_profile_id, reservation_purchases_allowed=None, marketplace_purchases_allowed=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, billing_profile_name, reservation_purchases_allowed=None, marketplace_purchases_allowed=None, custom_headers=None, raw=False, **operation_config): """The operation to update a policy. - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param billing_profile_id: Billing Profile Id. - :type billing_profile_id: str + :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 reservation_purchases_allowed: The reservationPurchasesAllowed flag. :type reservation_purchases_allowed: bool @@ -126,8 +126,8 @@ def update( # Construct URL url = self.update.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, '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) @@ -166,4 +166,4 @@ def update( return client_raw_response return deserialized - update.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/policies/default'} + update.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_account_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_account_operations.py index d1c6f407719c..e8501d24a68c 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_account_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_account_operations.py @@ -37,11 +37,11 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list( - self, billing_account_id, filter=None, custom_headers=None, raw=False, **operation_config): - """Lists products by billingAccountId. + self, billing_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists products by billingAccountName. - :param billing_account_id: billing Account Id. - :type billing_account_id: str + :param billing_account_name: billing Account Id. + :type billing_account_name: str :param filter: May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair @@ -64,7 +64,7 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -106,4 +106,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/products'} + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_subscriptions_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_subscriptions_operations.py index 8854062e4043..44caf3354c61 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_subscriptions_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_billing_subscriptions_operations.py @@ -37,11 +37,11 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list( - self, billing_account_id, custom_headers=None, raw=False, **operation_config): - """Lists billing subscriptions by billingAccountId. + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """Lists billing subscriptions by billingAccountName. - :param billing_account_id: billing Account Id. - :type billing_account_id: str + :param billing_account_name: billing Account Id. + :type billing_account_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -99,4 +99,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingSubscriptions'} + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_invoice_section_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_invoice_section_operations.py index 202b420fd11c..8f9605d27e35 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_invoice_section_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/products_by_invoice_section_operations.py @@ -37,13 +37,13 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list( - self, billing_account_id, invoice_section_id, filter=None, custom_headers=None, raw=False, **operation_config): - """Lists products by invoiceSectionId. + self, billing_account_name, invoice_section_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists products by invoiceSectionName. - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param invoice_section_id: InvoiceSection Id. - :type invoice_section_id: str + :param billing_account_name: billing Account Id. + :type billing_account_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 supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair @@ -63,8 +63,8 @@ def list( # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'invoiceSectionId': self._serialize.url("invoice_section_id", invoice_section_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -101,4 +101,4 @@ def list( return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}/products'} + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py index fa697517c28d..2e42af87024a 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py @@ -37,13 +37,13 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def get( - self, billing_account_id, invoice_section_id, product_name, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, invoice_section_name, product_name, custom_headers=None, raw=False, **operation_config): """Get a single product by name. - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param invoice_section_id: InvoiceSection Id. - :type invoice_section_id: str + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str :param product_name: Invoide Id. :type product_name: str :param dict custom_headers: headers that will be added to the request @@ -60,8 +60,8 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'invoiceSectionId': self._serialize.url("invoice_section_id", invoice_section_id, 'str'), + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), 'productName': self._serialize.url("product_name", product_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -97,20 +97,21 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}/products/{productName}'} + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}'} def transfer( - self, billing_account_id, invoice_section_id, product_name, destination_invoice_section_id=None, custom_headers=None, raw=False, **operation_config): + self, billing_account_name, invoice_section_name, product_name, destination_invoice_section_name=None, custom_headers=None, raw=False, **operation_config): """The operation to transfer a Product to another InvoiceSection. - :param billing_account_id: billing Account Id. - :type billing_account_id: str - :param invoice_section_id: InvoiceSection Id. - :type invoice_section_id: str + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str :param product_name: Invoide Id. :type product_name: str - :param destination_invoice_section_id: Destination invoice section id. - :type destination_invoice_section_id: str + :param destination_invoice_section_name: Destination invoice section + id. + :type destination_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 @@ -122,13 +123,13 @@ def transfer( :raises: :class:`ErrorResponseException` """ - parameters = models.TransferProductRequestProperties(destination_invoice_section_id=destination_invoice_section_id) + parameters = models.TransferProductRequestProperties(destination_invoice_section_name=destination_invoice_section_name) # Construct URL url = self.transfer.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'invoiceSectionId': self._serialize.url("invoice_section_id", invoice_section_id, 'str'), + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), 'productName': self._serialize.url("product_name", product_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -175,4 +176,4 @@ def transfer( return client_raw_response return deserialized - transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}/products/{productName}/transfer'} + transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}/transfer'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_account_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_account_operations.py index 2e71b0f4fa9e..815440c4613b 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_account_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_by_billing_account_operations.py @@ -37,12 +37,12 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list( - self, billing_account_id, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): - """Lists the transactions by billingAccountId for given start and end + self, billing_account_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the transactions by billingAccountName for given start and end date. - :param billing_account_id: billing Account Id. - :type billing_account_id: str + :param billing_account_name: billing Account Id. + :type billing_account_name: str :param start_date: Start date :type start_date: str :param end_date: End date @@ -69,7 +69,7 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -113,4 +113,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/transactions'} + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/transactions'} From a31518b6454184acc1dbd969097628784bc43c32 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 22 Mar 2019 03:00:16 +0000 Subject: [PATCH 5/8] Generated from eb7c9238276302bff4fbe0eff259d6417afe80b7 Fix typos/casings. --- .../mgmt/billing/billing_management_client.py | 64 +++++++++---------- .../mgmt/billing/models/billing_property.py | 10 +-- .../billing/models/billing_property_py3.py | 10 +-- .../azure/mgmt/billing/models/enrollment.py | 10 +-- .../mgmt/billing/models/enrollment_py3.py | 10 +-- .../azure/mgmt/billing/operations/__init__.py | 32 +++++----- ...account_billing_permissions_operations.py} | 4 +- ...unt_billing_role_assignment_operations.py} | 4 +- ...unt_billing_role_definition_operations.py} | 4 +- ...profile_billing_permissions_operations.py} | 4 +- ...ile_billing_role_assignment_operations.py} | 4 +- ...ile_billing_role_definition_operations.py} | 4 +- ...ion_billing_role_assignment_operations.py} | 4 +- ...ion_billing_role_definition_operations.py} | 4 +- 14 files changed, 84 insertions(+), 84 deletions(-) rename azure-mgmt-billing/azure/mgmt/billing/operations/{billing_accountbilling_permissions_operations.py => billing_account_billing_permissions_operations.py} (96%) rename azure-mgmt-billing/azure/mgmt/billing/operations/{billing_accountbilling_role_assignment_operations.py => billing_account_billing_role_assignment_operations.py} (99%) rename azure-mgmt-billing/azure/mgmt/billing/operations/{billing_accountbilling_role_definition_operations.py => billing_account_billing_role_definition_operations.py} (98%) rename azure-mgmt-billing/azure/mgmt/billing/operations/{billing_profilebilling_permissions_operations.py => billing_profile_billing_permissions_operations.py} (97%) rename azure-mgmt-billing/azure/mgmt/billing/operations/{billing_profilebilling_role_assignment_operations.py => billing_profile_billing_role_assignment_operations.py} (99%) rename azure-mgmt-billing/azure/mgmt/billing/operations/{billing_profilebilling_role_definition_operations.py => billing_profile_billing_role_definition_operations.py} (98%) rename azure-mgmt-billing/azure/mgmt/billing/operations/{invoice_sectionbilling_role_assignment_operations.py => invoice_section_billing_role_assignment_operations.py} (99%) rename azure-mgmt-billing/azure/mgmt/billing/operations/{invoice_sectionbilling_role_definition_operations.py => invoice_section_billing_role_definition_operations.py} (98%) diff --git a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index 8af06a0bf660..1be364512f23 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -45,15 +45,15 @@ from .operations.policy_operations import PolicyOperations from .operations.billing_property_operations import BillingPropertyOperations from .operations.operations import Operations -from .operations.billing_accountbilling_permissions_operations import BillingAccountbillingPermissionsOperations +from .operations.billing_account_billing_permissions_operations import BillingAccountBillingPermissionsOperations from .operations.invoice_sectionsbilling_permissions_operations import InvoiceSectionsbillingPermissionsOperations -from .operations.billing_profilebilling_permissions_operations import BillingProfilebillingPermissionsOperations -from .operations.billing_accountbilling_role_definition_operations import BillingAccountbillingRoleDefinitionOperations -from .operations.invoice_sectionbilling_role_definition_operations import InvoiceSectionbillingRoleDefinitionOperations -from .operations.billing_profilebilling_role_definition_operations import BillingProfilebillingRoleDefinitionOperations -from .operations.billing_accountbilling_role_assignment_operations import BillingAccountbillingRoleAssignmentOperations -from .operations.invoice_sectionbilling_role_assignment_operations import InvoiceSectionbillingRoleAssignmentOperations -from .operations.billing_profilebilling_role_assignment_operations import BillingProfilebillingRoleAssignmentOperations +from .operations.billing_profile_billing_permissions_operations import BillingProfileBillingPermissionsOperations +from .operations.billing_account_billing_role_definition_operations import BillingAccountBillingRoleDefinitionOperations +from .operations.invoice_section_billing_role_definition_operations import InvoiceSectionBillingRoleDefinitionOperations +from .operations.billing_profile_billing_role_definition_operations import BillingProfileBillingRoleDefinitionOperations +from .operations.billing_account_billing_role_assignment_operations import BillingAccountBillingRoleAssignmentOperations +from .operations.invoice_section_billing_role_assignment_operations import InvoiceSectionBillingRoleAssignmentOperations +from .operations.billing_profile_billing_role_assignment_operations import BillingProfileBillingRoleAssignmentOperations from . import models @@ -151,24 +151,24 @@ class BillingManagementClient(SDKClient): :vartype billing_property: azure.mgmt.billing.operations.BillingPropertyOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.billing.operations.Operations - :ivar billing_accountbilling_permissions: BillingAccountbillingPermissions operations - :vartype billing_accountbilling_permissions: azure.mgmt.billing.operations.BillingAccountbillingPermissionsOperations + :ivar billing_account_billing_permissions: BillingAccountBillingPermissions operations + :vartype billing_account_billing_permissions: azure.mgmt.billing.operations.BillingAccountBillingPermissionsOperations :ivar invoice_sectionsbilling_permissions: InvoiceSectionsbillingPermissions operations :vartype invoice_sectionsbilling_permissions: azure.mgmt.billing.operations.InvoiceSectionsbillingPermissionsOperations - :ivar billing_profilebilling_permissions: BillingProfilebillingPermissions operations - :vartype billing_profilebilling_permissions: azure.mgmt.billing.operations.BillingProfilebillingPermissionsOperations - :ivar billing_accountbilling_role_definition: BillingAccountbillingRoleDefinition operations - :vartype billing_accountbilling_role_definition: azure.mgmt.billing.operations.BillingAccountbillingRoleDefinitionOperations - :ivar invoice_sectionbilling_role_definition: InvoiceSectionbillingRoleDefinition operations - :vartype invoice_sectionbilling_role_definition: azure.mgmt.billing.operations.InvoiceSectionbillingRoleDefinitionOperations - :ivar billing_profilebilling_role_definition: BillingProfilebillingRoleDefinition operations - :vartype billing_profilebilling_role_definition: azure.mgmt.billing.operations.BillingProfilebillingRoleDefinitionOperations - :ivar billing_accountbilling_role_assignment: BillingAccountbillingRoleAssignment operations - :vartype billing_accountbilling_role_assignment: azure.mgmt.billing.operations.BillingAccountbillingRoleAssignmentOperations - :ivar invoice_sectionbilling_role_assignment: InvoiceSectionbillingRoleAssignment operations - :vartype invoice_sectionbilling_role_assignment: azure.mgmt.billing.operations.InvoiceSectionbillingRoleAssignmentOperations - :ivar billing_profilebilling_role_assignment: BillingProfilebillingRoleAssignment operations - :vartype billing_profilebilling_role_assignment: azure.mgmt.billing.operations.BillingProfilebillingRoleAssignmentOperations + :ivar billing_profile_billing_permissions: BillingProfileBillingPermissions operations + :vartype billing_profile_billing_permissions: azure.mgmt.billing.operations.BillingProfileBillingPermissionsOperations + :ivar billing_account_billing_role_definition: BillingAccountBillingRoleDefinition operations + :vartype billing_account_billing_role_definition: azure.mgmt.billing.operations.BillingAccountBillingRoleDefinitionOperations + :ivar invoice_section_billing_role_definition: InvoiceSectionBillingRoleDefinition operations + :vartype invoice_section_billing_role_definition: azure.mgmt.billing.operations.InvoiceSectionBillingRoleDefinitionOperations + :ivar billing_profile_billing_role_definition: BillingProfileBillingRoleDefinition operations + :vartype billing_profile_billing_role_definition: azure.mgmt.billing.operations.BillingProfileBillingRoleDefinitionOperations + :ivar billing_account_billing_role_assignment: BillingAccountBillingRoleAssignment operations + :vartype billing_account_billing_role_assignment: azure.mgmt.billing.operations.BillingAccountBillingRoleAssignmentOperations + :ivar invoice_section_billing_role_assignment: InvoiceSectionBillingRoleAssignment operations + :vartype invoice_section_billing_role_assignment: azure.mgmt.billing.operations.InvoiceSectionBillingRoleAssignmentOperations + :ivar billing_profile_billing_role_assignment: BillingProfileBillingRoleAssignment operations + :vartype billing_profile_billing_role_assignment: azure.mgmt.billing.operations.BillingProfileBillingRoleAssignmentOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -245,23 +245,23 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) - self.billing_accountbilling_permissions = BillingAccountbillingPermissionsOperations( + self.billing_account_billing_permissions = BillingAccountBillingPermissionsOperations( self._client, self.config, self._serialize, self._deserialize) self.invoice_sectionsbilling_permissions = InvoiceSectionsbillingPermissionsOperations( self._client, self.config, self._serialize, self._deserialize) - self.billing_profilebilling_permissions = BillingProfilebillingPermissionsOperations( + self.billing_profile_billing_permissions = BillingProfileBillingPermissionsOperations( self._client, self.config, self._serialize, self._deserialize) - self.billing_accountbilling_role_definition = BillingAccountbillingRoleDefinitionOperations( + self.billing_account_billing_role_definition = BillingAccountBillingRoleDefinitionOperations( self._client, self.config, self._serialize, self._deserialize) - self.invoice_sectionbilling_role_definition = InvoiceSectionbillingRoleDefinitionOperations( + self.invoice_section_billing_role_definition = InvoiceSectionBillingRoleDefinitionOperations( self._client, self.config, self._serialize, self._deserialize) - self.billing_profilebilling_role_definition = BillingProfilebillingRoleDefinitionOperations( + self.billing_profile_billing_role_definition = BillingProfileBillingRoleDefinitionOperations( self._client, self.config, self._serialize, self._deserialize) - self.billing_accountbilling_role_assignment = BillingAccountbillingRoleAssignmentOperations( + self.billing_account_billing_role_assignment = BillingAccountBillingRoleAssignmentOperations( self._client, self.config, self._serialize, self._deserialize) - self.invoice_sectionbilling_role_assignment = InvoiceSectionbillingRoleAssignmentOperations( + self.invoice_section_billing_role_assignment = InvoiceSectionBillingRoleAssignmentOperations( self._client, self.config, self._serialize, self._deserialize) - self.billing_profilebilling_role_assignment = BillingProfilebillingRoleAssignmentOperations( + self.billing_profile_billing_role_assignment = BillingProfileBillingRoleAssignmentOperations( self._client, self.config, self._serialize, self._deserialize) def transactions_by_billing_profile( diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py index 81004ae28a87..03e1f2c5c142 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py @@ -28,8 +28,8 @@ class BillingProperty(Model): :vartype billing_account_name: str :ivar billing_profile_id: Billing profile Id. :vartype billing_profile_id: str - :ivar billing_proflie_name: Billing profile name. - :vartype billing_proflie_name: str + :ivar billing_profile_name: Billing profile name. + :vartype billing_profile_name: str :ivar invoice_section_id: Invoice Section Id. :vartype invoice_section_id: str :ivar invoice_section_name: Invoice Section name. @@ -46,7 +46,7 @@ class BillingProperty(Model): 'billing_account_id': {'readonly': True}, 'billing_account_name': {'readonly': True}, 'billing_profile_id': {'readonly': True}, - 'billing_proflie_name': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, 'invoice_section_id': {'readonly': True}, 'invoice_section_name': {'readonly': True}, 'sku_id': {'readonly': True}, @@ -59,7 +59,7 @@ class BillingProperty(Model): 'billing_account_id': {'key': 'billingAccountId', 'type': 'str'}, 'billing_account_name': {'key': 'billingAccountName', 'type': 'str'}, 'billing_profile_id': {'key': 'billingProfileId', 'type': 'str'}, - 'billing_proflie_name': {'key': 'billingProflieName', 'type': 'str'}, + 'billing_profile_name': {'key': 'billingProfileName', 'type': 'str'}, 'invoice_section_id': {'key': 'invoiceSectionId', 'type': 'str'}, 'invoice_section_name': {'key': 'invoiceSectionName', 'type': 'str'}, 'sku_id': {'key': 'skuId', 'type': 'str'}, @@ -73,7 +73,7 @@ def __init__(self, **kwargs): self.billing_account_id = None self.billing_account_name = None self.billing_profile_id = None - self.billing_proflie_name = None + self.billing_profile_name = None self.invoice_section_id = None self.invoice_section_name = None self.sku_id = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py index 3db37fa4626c..0334fde90ca7 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py @@ -28,8 +28,8 @@ class BillingProperty(Model): :vartype billing_account_name: str :ivar billing_profile_id: Billing profile Id. :vartype billing_profile_id: str - :ivar billing_proflie_name: Billing profile name. - :vartype billing_proflie_name: str + :ivar billing_profile_name: Billing profile name. + :vartype billing_profile_name: str :ivar invoice_section_id: Invoice Section Id. :vartype invoice_section_id: str :ivar invoice_section_name: Invoice Section name. @@ -46,7 +46,7 @@ class BillingProperty(Model): 'billing_account_id': {'readonly': True}, 'billing_account_name': {'readonly': True}, 'billing_profile_id': {'readonly': True}, - 'billing_proflie_name': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, 'invoice_section_id': {'readonly': True}, 'invoice_section_name': {'readonly': True}, 'sku_id': {'readonly': True}, @@ -59,7 +59,7 @@ class BillingProperty(Model): 'billing_account_id': {'key': 'billingAccountId', 'type': 'str'}, 'billing_account_name': {'key': 'billingAccountName', 'type': 'str'}, 'billing_profile_id': {'key': 'billingProfileId', 'type': 'str'}, - 'billing_proflie_name': {'key': 'billingProflieName', 'type': 'str'}, + 'billing_profile_name': {'key': 'billingProfileName', 'type': 'str'}, 'invoice_section_id': {'key': 'invoiceSectionId', 'type': 'str'}, 'invoice_section_name': {'key': 'invoiceSectionName', 'type': 'str'}, 'sku_id': {'key': 'skuId', 'type': 'str'}, @@ -73,7 +73,7 @@ def __init__(self, **kwargs) -> None: self.billing_account_id = None self.billing_account_name = None self.billing_profile_id = None - self.billing_proflie_name = None + self.billing_profile_name = None self.invoice_section_id = None self.invoice_section_name = None self.sku_id = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment.py index ac79d74d2408..f72863ab2de9 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment.py @@ -34,8 +34,8 @@ class Enrollment(Model): :vartype country_code: str :ivar status: Enrollment status :vartype status: str - :ivar billing_cylce: Enrollment billing cycle - :vartype billing_cylce: str + :ivar billing_cycle: Enrollment billing cycle + :vartype billing_cycle: str """ _validation = { @@ -45,7 +45,7 @@ class Enrollment(Model): 'language': {'readonly': True}, 'country_code': {'readonly': True}, 'status': {'readonly': True}, - 'billing_cylce': {'readonly': True}, + 'billing_cycle': {'readonly': True}, } _attribute_map = { @@ -57,7 +57,7 @@ class Enrollment(Model): 'language': {'key': 'language', 'type': 'str'}, 'country_code': {'key': 'countryCode', 'type': 'str'}, 'status': {'key': 'status', 'type': 'str'}, - 'billing_cylce': {'key': 'billingCylce', 'type': 'str'}, + 'billing_cycle': {'key': 'billingCycle', 'type': 'str'}, } def __init__(self, **kwargs): @@ -70,4 +70,4 @@ def __init__(self, **kwargs): self.language = None self.country_code = None self.status = None - self.billing_cylce = None + self.billing_cycle = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_py3.py index ebe9261ebf6e..1c1a8618c379 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_py3.py @@ -34,8 +34,8 @@ class Enrollment(Model): :vartype country_code: str :ivar status: Enrollment status :vartype status: str - :ivar billing_cylce: Enrollment billing cycle - :vartype billing_cylce: str + :ivar billing_cycle: Enrollment billing cycle + :vartype billing_cycle: str """ _validation = { @@ -45,7 +45,7 @@ class Enrollment(Model): 'language': {'readonly': True}, 'country_code': {'readonly': True}, 'status': {'readonly': True}, - 'billing_cylce': {'readonly': True}, + 'billing_cycle': {'readonly': True}, } _attribute_map = { @@ -57,7 +57,7 @@ class Enrollment(Model): 'language': {'key': 'language', 'type': 'str'}, 'country_code': {'key': 'countryCode', 'type': 'str'}, 'status': {'key': 'status', 'type': 'str'}, - 'billing_cylce': {'key': 'billingCylce', 'type': 'str'}, + 'billing_cycle': {'key': 'billingCycle', 'type': 'str'}, } def __init__(self, *, start_date=None, end_date=None, **kwargs) -> None: @@ -70,4 +70,4 @@ def __init__(self, *, start_date=None, end_date=None, **kwargs) -> None: self.language = None self.country_code = None self.status = None - self.billing_cylce = None + self.billing_cycle = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index 1c936c305cd0..17d9d0c2d7be 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -37,15 +37,15 @@ from .policy_operations import PolicyOperations from .billing_property_operations import BillingPropertyOperations from .operations import Operations -from .billing_accountbilling_permissions_operations import BillingAccountbillingPermissionsOperations +from .billing_account_billing_permissions_operations import BillingAccountBillingPermissionsOperations from .invoice_sectionsbilling_permissions_operations import InvoiceSectionsbillingPermissionsOperations -from .billing_profilebilling_permissions_operations import BillingProfilebillingPermissionsOperations -from .billing_accountbilling_role_definition_operations import BillingAccountbillingRoleDefinitionOperations -from .invoice_sectionbilling_role_definition_operations import InvoiceSectionbillingRoleDefinitionOperations -from .billing_profilebilling_role_definition_operations import BillingProfilebillingRoleDefinitionOperations -from .billing_accountbilling_role_assignment_operations import BillingAccountbillingRoleAssignmentOperations -from .invoice_sectionbilling_role_assignment_operations import InvoiceSectionbillingRoleAssignmentOperations -from .billing_profilebilling_role_assignment_operations import BillingProfilebillingRoleAssignmentOperations +from .billing_profile_billing_permissions_operations import BillingProfileBillingPermissionsOperations +from .billing_account_billing_role_definition_operations import BillingAccountBillingRoleDefinitionOperations +from .invoice_section_billing_role_definition_operations import InvoiceSectionBillingRoleDefinitionOperations +from .billing_profile_billing_role_definition_operations import BillingProfileBillingRoleDefinitionOperations +from .billing_account_billing_role_assignment_operations import BillingAccountBillingRoleAssignmentOperations +from .invoice_section_billing_role_assignment_operations import InvoiceSectionBillingRoleAssignmentOperations +from .billing_profile_billing_role_assignment_operations import BillingProfileBillingRoleAssignmentOperations __all__ = [ 'BillingAccountsOperations', @@ -76,13 +76,13 @@ 'PolicyOperations', 'BillingPropertyOperations', 'Operations', - 'BillingAccountbillingPermissionsOperations', + 'BillingAccountBillingPermissionsOperations', 'InvoiceSectionsbillingPermissionsOperations', - 'BillingProfilebillingPermissionsOperations', - 'BillingAccountbillingRoleDefinitionOperations', - 'InvoiceSectionbillingRoleDefinitionOperations', - 'BillingProfilebillingRoleDefinitionOperations', - 'BillingAccountbillingRoleAssignmentOperations', - 'InvoiceSectionbillingRoleAssignmentOperations', - 'BillingProfilebillingRoleAssignmentOperations', + 'BillingProfileBillingPermissionsOperations', + 'BillingAccountBillingRoleDefinitionOperations', + 'InvoiceSectionBillingRoleDefinitionOperations', + 'BillingProfileBillingRoleDefinitionOperations', + 'BillingAccountBillingRoleAssignmentOperations', + 'InvoiceSectionBillingRoleAssignmentOperations', + 'BillingProfileBillingRoleAssignmentOperations', ] diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_permissions_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_permissions_operations.py similarity index 96% rename from azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_permissions_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_permissions_operations.py index c1b32be6bcdd..5424cc0e51cc 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_permissions_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_permissions_operations.py @@ -15,8 +15,8 @@ from .. import models -class BillingAccountbillingPermissionsOperations(object): - """BillingAccountbillingPermissionsOperations operations. +class BillingAccountBillingPermissionsOperations(object): + """BillingAccountBillingPermissionsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_role_assignment_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_assignment_operations.py similarity index 99% rename from azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_role_assignment_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_assignment_operations.py index 3cc3f29760e4..f8ff12e9940c 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_role_assignment_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_assignment_operations.py @@ -15,8 +15,8 @@ from .. import models -class BillingAccountbillingRoleAssignmentOperations(object): - """BillingAccountbillingRoleAssignmentOperations operations. +class BillingAccountBillingRoleAssignmentOperations(object): + """BillingAccountBillingRoleAssignmentOperations operations. :param client: Client for service requests. :param config: Configuration of service client. diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_role_definition_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_definition_operations.py similarity index 98% rename from azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_role_definition_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_definition_operations.py index 59c7821b36aa..ec6ddf02ab4f 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accountbilling_role_definition_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_account_billing_role_definition_operations.py @@ -15,8 +15,8 @@ from .. import models -class BillingAccountbillingRoleDefinitionOperations(object): - """BillingAccountbillingRoleDefinitionOperations operations. +class BillingAccountBillingRoleDefinitionOperations(object): + """BillingAccountBillingRoleDefinitionOperations operations. :param client: Client for service requests. :param config: Configuration of service client. diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_permissions_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_permissions_operations.py similarity index 97% rename from azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_permissions_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_permissions_operations.py index 8c9430429cb6..c9178f7574db 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_permissions_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_permissions_operations.py @@ -15,8 +15,8 @@ from .. import models -class BillingProfilebillingPermissionsOperations(object): - """BillingProfilebillingPermissionsOperations operations. +class BillingProfileBillingPermissionsOperations(object): + """BillingProfileBillingPermissionsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_role_assignment_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_assignment_operations.py similarity index 99% rename from azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_role_assignment_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_assignment_operations.py index 2d104699b91b..eec018f7a41c 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_role_assignment_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_assignment_operations.py @@ -15,8 +15,8 @@ from .. import models -class BillingProfilebillingRoleAssignmentOperations(object): - """BillingProfilebillingRoleAssignmentOperations operations. +class BillingProfileBillingRoleAssignmentOperations(object): + """BillingProfileBillingRoleAssignmentOperations operations. :param client: Client for service requests. :param config: Configuration of service client. diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_role_definition_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_definition_operations.py similarity index 98% rename from azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_role_definition_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_definition_operations.py index 5551593fb9b4..9489c03d4247 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profilebilling_role_definition_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profile_billing_role_definition_operations.py @@ -15,8 +15,8 @@ from .. import models -class BillingProfilebillingRoleDefinitionOperations(object): - """BillingProfilebillingRoleDefinitionOperations operations. +class BillingProfileBillingRoleDefinitionOperations(object): + """BillingProfileBillingRoleDefinitionOperations operations. :param client: Client for service requests. :param config: Configuration of service client. diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionbilling_role_assignment_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_assignment_operations.py similarity index 99% rename from azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionbilling_role_assignment_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_assignment_operations.py index ff9da198b71a..2a836c469ae8 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionbilling_role_assignment_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_assignment_operations.py @@ -15,8 +15,8 @@ from .. import models -class InvoiceSectionbillingRoleAssignmentOperations(object): - """InvoiceSectionbillingRoleAssignmentOperations operations. +class InvoiceSectionBillingRoleAssignmentOperations(object): + """InvoiceSectionBillingRoleAssignmentOperations operations. :param client: Client for service requests. :param config: Configuration of service client. diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionbilling_role_definition_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_definition_operations.py similarity index 98% rename from azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionbilling_role_definition_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_definition_operations.py index e6f088a9e709..e45824959e4b 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionbilling_role_definition_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_section_billing_role_definition_operations.py @@ -15,8 +15,8 @@ from .. import models -class InvoiceSectionbillingRoleDefinitionOperations(object): - """InvoiceSectionbillingRoleDefinitionOperations operations. +class InvoiceSectionBillingRoleDefinitionOperations(object): + """InvoiceSectionBillingRoleDefinitionOperations operations. :param client: Client for service requests. :param config: Configuration of service client. From 5da779b4b156b910183b570e43e2492cd331a262 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 22 Mar 2019 03:02:12 +0000 Subject: [PATCH 6/8] Generated from f6c76e2b360ce261fc784a0b0111907b827c3000 more typos/casing fixes --- .../azure/mgmt/billing/billing_management_client.py | 12 ++++++------ .../azure/mgmt/billing/models/billing_profile.py | 2 +- .../azure/mgmt/billing/models/billing_profile_py3.py | 2 +- .../mgmt/billing/models/billing_role_assignment.py | 2 +- .../models/billing_role_assignment_payload.py | 2 +- .../models/billing_role_assignment_payload_py3.py | 2 +- .../billing/models/billing_role_assignment_py3.py | 2 +- .../mgmt/billing/models/update_auto_renew_request.py | 2 +- .../billing/models/update_auto_renew_request_py3.py | 2 +- .../azure/mgmt/billing/operations/__init__.py | 4 ++-- .../mgmt/billing/operations/invoice_operations.py | 2 +- ...voice_sections_billing_permissions_operations.py} | 4 ++-- .../mgmt/billing/operations/products_operations.py | 4 ++-- 13 files changed, 21 insertions(+), 21 deletions(-) rename azure-mgmt-billing/azure/mgmt/billing/operations/{invoice_sectionsbilling_permissions_operations.py => invoice_sections_billing_permissions_operations.py} (97%) diff --git a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index 1be364512f23..31ed6022c618 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -46,7 +46,7 @@ from .operations.billing_property_operations import BillingPropertyOperations from .operations.operations import Operations from .operations.billing_account_billing_permissions_operations import BillingAccountBillingPermissionsOperations -from .operations.invoice_sectionsbilling_permissions_operations import InvoiceSectionsbillingPermissionsOperations +from .operations.invoice_sections_billing_permissions_operations import InvoiceSectionsBillingPermissionsOperations from .operations.billing_profile_billing_permissions_operations import BillingProfileBillingPermissionsOperations from .operations.billing_account_billing_role_definition_operations import BillingAccountBillingRoleDefinitionOperations from .operations.invoice_section_billing_role_definition_operations import InvoiceSectionBillingRoleDefinitionOperations @@ -153,8 +153,8 @@ class BillingManagementClient(SDKClient): :vartype operations: azure.mgmt.billing.operations.Operations :ivar billing_account_billing_permissions: BillingAccountBillingPermissions operations :vartype billing_account_billing_permissions: azure.mgmt.billing.operations.BillingAccountBillingPermissionsOperations - :ivar invoice_sectionsbilling_permissions: InvoiceSectionsbillingPermissions operations - :vartype invoice_sectionsbilling_permissions: azure.mgmt.billing.operations.InvoiceSectionsbillingPermissionsOperations + :ivar invoice_sections_billing_permissions: InvoiceSectionsBillingPermissions operations + :vartype invoice_sections_billing_permissions: azure.mgmt.billing.operations.InvoiceSectionsBillingPermissionsOperations :ivar billing_profile_billing_permissions: BillingProfileBillingPermissions operations :vartype billing_profile_billing_permissions: azure.mgmt.billing.operations.BillingProfileBillingPermissionsOperations :ivar billing_account_billing_role_definition: BillingAccountBillingRoleDefinition operations @@ -247,7 +247,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.billing_account_billing_permissions = BillingAccountBillingPermissionsOperations( self._client, self.config, self._serialize, self._deserialize) - self.invoice_sectionsbilling_permissions = InvoiceSectionsbillingPermissionsOperations( + self.invoice_sections_billing_permissions = InvoiceSectionsBillingPermissionsOperations( self._client, self.config, self._serialize, self._deserialize) self.billing_profile_billing_permissions = BillingProfileBillingPermissionsOperations( self._client, self.config, self._serialize, self._deserialize) @@ -344,7 +344,7 @@ def update_auto_renew_for_billing_account( :param billing_account_name: billing Account Id. :type billing_account_name: str - :param product_name: Invoide Id. + :param product_name: Invoice Id. :type product_name: str :param auto_renew: Request parameters to update auto renew policy a product. Possible values include: 'true', 'false' @@ -416,7 +416,7 @@ def update_auto_renew_for_invoice_section( :type billing_account_name: str :param invoice_section_name: InvoiceSection Id. :type invoice_section_name: str - :param product_name: Invoide Id. + :param product_name: Invoice Id. :type product_name: str :param auto_renew: Request parameters to update auto renew policy a product. Possible values include: 'true', 'false' diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py index 8a7dc1f878eb..9fbb2d68a214 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py @@ -30,7 +30,7 @@ class BillingProfile(Resource): :type po_number: str :param billing_address: Billing address. :type billing_address: ~azure.mgmt.billing.models.Address - :ivar invoice_email_opt_in: If the billing profile is opted in to recieve + :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. diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py index 7acb8b5cf7dc..d7113faf83f3 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py @@ -30,7 +30,7 @@ class BillingProfile(Resource): :type po_number: str :param billing_address: Billing address. :type billing_address: ~azure.mgmt.billing.models.Address - :ivar invoice_email_opt_in: If the billing profile is opted in to recieve + :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. diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment.py index 6024d68d792c..c626a9811a31 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment.py @@ -34,7 +34,7 @@ class BillingRoleAssignment(Resource): :vartype billing_role_assignment_name: str :ivar principal_id: The user's principal id that the role gets assigned to :vartype principal_id: str - :ivar role_definition_name: The role defintion id + :ivar role_definition_name: The role definition id :vartype role_definition_name: str :ivar scope: The scope the role get assigned to :vartype scope: str diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.py index f565dd006656..7cc47de28ff1 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.py @@ -20,7 +20,7 @@ class BillingRoleAssignmentPayload(Model): :ivar principal_id: The user's principal id that the role gets assigned to :vartype principal_id: str - :ivar billing_role_definition_name: The role defintion id + :ivar billing_role_definition_name: The role definition id :vartype billing_role_definition_name: str """ diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py index a352ca96f8a5..966a8fe639df 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py @@ -20,7 +20,7 @@ class BillingRoleAssignmentPayload(Model): :ivar principal_id: The user's principal id that the role gets assigned to :vartype principal_id: str - :ivar billing_role_definition_name: The role defintion id + :ivar billing_role_definition_name: The role definition id :vartype billing_role_definition_name: str """ diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_py3.py index 50e5e9156a9e..05dcf924e246 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_py3.py @@ -34,7 +34,7 @@ class BillingRoleAssignment(Resource): :vartype billing_role_assignment_name: str :ivar principal_id: The user's principal id that the role gets assigned to :vartype principal_id: str - :ivar role_definition_name: The role defintion id + :ivar role_definition_name: The role definition id :vartype role_definition_name: str :ivar scope: The scope the role get assigned to :vartype scope: str diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request.py b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request.py index 0fc17045c814..80db81d894c6 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request.py @@ -13,7 +13,7 @@ class UpdateAutoRenewRequest(Model): - """Request parameters to update auto renew for support prouct. + """Request parameters to update auto renew for support product. :param auto_renew: Request parameters to update auto renew policy a product. Possible values include: 'true', 'false' diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request_py3.py index f2b5638c9370..5f99c7657109 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request_py3.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request_py3.py @@ -13,7 +13,7 @@ class UpdateAutoRenewRequest(Model): - """Request parameters to update auto renew for support prouct. + """Request parameters to update auto renew for support product. :param auto_renew: Request parameters to update auto renew policy a product. Possible values include: 'true', 'false' diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index 17d9d0c2d7be..78b51f850b18 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -38,7 +38,7 @@ from .billing_property_operations import BillingPropertyOperations from .operations import Operations from .billing_account_billing_permissions_operations import BillingAccountBillingPermissionsOperations -from .invoice_sectionsbilling_permissions_operations import InvoiceSectionsbillingPermissionsOperations +from .invoice_sections_billing_permissions_operations import InvoiceSectionsBillingPermissionsOperations from .billing_profile_billing_permissions_operations import BillingProfileBillingPermissionsOperations from .billing_account_billing_role_definition_operations import BillingAccountBillingRoleDefinitionOperations from .invoice_section_billing_role_definition_operations import InvoiceSectionBillingRoleDefinitionOperations @@ -77,7 +77,7 @@ 'BillingPropertyOperations', 'Operations', 'BillingAccountBillingPermissionsOperations', - 'InvoiceSectionsbillingPermissionsOperations', + 'InvoiceSectionsBillingPermissionsOperations', 'BillingProfileBillingPermissionsOperations', 'BillingAccountBillingRoleDefinitionOperations', 'InvoiceSectionBillingRoleDefinitionOperations', diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py index 462be27bbfc4..8b8e32685d1c 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_operations.py @@ -44,7 +44,7 @@ def get( :type billing_account_name: str :param billing_profile_name: Billing Profile Id. :type billing_profile_name: str - :param invoice_name: Invoide Id. + :param invoice_name: Invoice Id. :type invoice_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionsbilling_permissions_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_billing_permissions_operations.py similarity index 97% rename from azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionsbilling_permissions_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_billing_permissions_operations.py index b72a21e7b141..36a228cc651a 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sectionsbilling_permissions_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_billing_permissions_operations.py @@ -15,8 +15,8 @@ from .. import models -class InvoiceSectionsbillingPermissionsOperations(object): - """InvoiceSectionsbillingPermissionsOperations operations. +class InvoiceSectionsBillingPermissionsOperations(object): + """InvoiceSectionsBillingPermissionsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py index 2e42af87024a..5b1e91b354fd 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py @@ -44,7 +44,7 @@ def get( :type billing_account_name: str :param invoice_section_name: InvoiceSection Id. :type invoice_section_name: str - :param product_name: Invoide Id. + :param product_name: Invoice Id. :type product_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -107,7 +107,7 @@ def transfer( :type billing_account_name: str :param invoice_section_name: InvoiceSection Id. :type invoice_section_name: str - :param product_name: Invoide Id. + :param product_name: Invoice Id. :type product_name: str :param destination_invoice_section_name: Destination invoice section id. From d0fac9756c7d6880d9cafcf8a2500db76aef7a33 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 25 Mar 2019 20:12:28 +0000 Subject: [PATCH 7/8] Generated from 0c43fc1e5550599a0df891a84034d4b3836eb7dc Add missing parameters/fix casing. --- .../mgmt/billing/billing_management_client.py | 15 + .../azure/mgmt/billing/models/__init__.py | 33 ++ .../billing/models/accept_transfer_request.py | 28 ++ .../models/accept_transfer_request_py3.py | 28 ++ .../models/billing_management_client_enums.py | 32 ++ .../models/detailed_transfer_status.py | 52 +++ .../models/detailed_transfer_status_py3.py | 52 +++ .../azure/mgmt/billing/models/error.py | 40 ++ .../azure/mgmt/billing/models/error_py3.py | 40 ++ .../models/initiate_transfer_request.py | 32 ++ .../models/initiate_transfer_request_py3.py | 32 ++ .../mgmt/billing/models/product_details.py | 33 ++ .../billing/models/product_details_py3.py | 33 ++ .../models/recipient_transfer_details.py | 79 ++++ .../recipient_transfer_details_paged.py | 27 ++ .../models/recipient_transfer_details_py3.py | 79 ++++ .../mgmt/billing/models/transfer_details.py | 83 +++++ .../billing/models/transfer_details_paged.py | 27 ++ .../billing/models/transfer_details_py3.py | 83 +++++ .../azure/mgmt/billing/operations/__init__.py | 6 + .../recipient_transfer_operations.py | 149 ++++++++ .../billing/operations/transfer_operations.py | 350 ++++++++++++++++++ .../operations/transfers_operations.py | 102 +++++ 23 files changed, 1435 insertions(+) create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/error.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/error_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/product_details.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/product_details_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_paged.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_paged.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfer_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/transfer_operations.py create mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py diff --git a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index 31ed6022c618..c1d60c2577cb 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -44,6 +44,9 @@ from .operations.transactions_by_billing_account_operations import TransactionsByBillingAccountOperations from .operations.policy_operations import PolicyOperations from .operations.billing_property_operations import BillingPropertyOperations +from .operations.transfer_operations import TransferOperations +from .operations.transfers_operations import TransfersOperations +from .operations.recipient_transfer_operations import RecipientTransferOperations from .operations.operations import Operations from .operations.billing_account_billing_permissions_operations import BillingAccountBillingPermissionsOperations from .operations.invoice_sections_billing_permissions_operations import InvoiceSectionsBillingPermissionsOperations @@ -149,6 +152,12 @@ class BillingManagementClient(SDKClient): :vartype policy: azure.mgmt.billing.operations.PolicyOperations :ivar billing_property: BillingProperty operations :vartype billing_property: azure.mgmt.billing.operations.BillingPropertyOperations + :ivar transfer: Transfer operations + :vartype transfer: azure.mgmt.billing.operations.TransferOperations + :ivar transfers: Transfers operations + :vartype transfers: azure.mgmt.billing.operations.TransfersOperations + :ivar recipient_transfer: RecipientTransfer operations + :vartype recipient_transfer: azure.mgmt.billing.operations.RecipientTransferOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.billing.operations.Operations :ivar billing_account_billing_permissions: BillingAccountBillingPermissions operations @@ -243,6 +252,12 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.billing_property = BillingPropertyOperations( self._client, self.config, self._serialize, self._deserialize) + self.transfer = TransferOperations( + self._client, self.config, self._serialize, self._deserialize) + self.transfers = TransfersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.recipient_transfer = RecipientTransferOperations( + self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) self.billing_account_billing_permissions = BillingAccountBillingPermissionsOperations( diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py index 6db4f6911fd9..1f3d0ce9efe6 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py @@ -10,6 +10,13 @@ # -------------------------------------------------------------------------- try: + from .initiate_transfer_request_py3 import InitiateTransferRequest + from .product_details_py3 import ProductDetails + from .accept_transfer_request_py3 import AcceptTransferRequest + from .error_py3 import Error + from .detailed_transfer_status_py3 import DetailedTransferStatus + from .transfer_details_py3 import TransferDetails + from .recipient_transfer_details_py3 import RecipientTransferDetails from .transfer_product_request_properties_py3 import TransferProductRequestProperties from .transfer_billing_subscription_result_py3 import TransferBillingSubscriptionResult from .transfer_billing_subscription_request_properties_py3 import TransferBillingSubscriptionRequestProperties @@ -62,6 +69,13 @@ from .billing_role_definition_py3 import BillingRoleDefinition from .billing_role_definition_list_result_py3 import BillingRoleDefinitionListResult except (SyntaxError, ImportError): + from .initiate_transfer_request import InitiateTransferRequest + from .product_details import ProductDetails + from .accept_transfer_request import AcceptTransferRequest + from .error import Error + from .detailed_transfer_status import DetailedTransferStatus + from .transfer_details import TransferDetails + from .recipient_transfer_details import RecipientTransferDetails from .transfer_product_request_properties import TransferProductRequestProperties from .transfer_billing_subscription_result import TransferBillingSubscriptionResult from .transfer_billing_subscription_request_properties import TransferBillingSubscriptionRequestProperties @@ -117,8 +131,14 @@ from .billing_subscription_summary_paged import BillingSubscriptionSummaryPaged from .product_summary_paged import ProductSummaryPaged from .transactions_summary_paged import TransactionsSummaryPaged +from .transfer_details_paged import TransferDetailsPaged +from .recipient_transfer_details_paged import RecipientTransferDetailsPaged from .operation_paged import OperationPaged from .billing_management_client_enums import ( + ProductType, + TransferStatus, + ProductTransferStatus, + EligibleProductType, ProductStatusType, BillingFrequency, BillingSubscriptionStatusType, @@ -129,6 +149,13 @@ ) __all__ = [ + 'InitiateTransferRequest', + 'ProductDetails', + 'AcceptTransferRequest', + 'Error', + 'DetailedTransferStatus', + 'TransferDetails', + 'RecipientTransferDetails', 'TransferProductRequestProperties', 'TransferBillingSubscriptionResult', 'TransferBillingSubscriptionRequestProperties', @@ -184,7 +211,13 @@ 'BillingSubscriptionSummaryPaged', 'ProductSummaryPaged', 'TransactionsSummaryPaged', + 'TransferDetailsPaged', + 'RecipientTransferDetailsPaged', 'OperationPaged', + 'ProductType', + 'TransferStatus', + 'ProductTransferStatus', + 'EligibleProductType', 'ProductStatusType', 'BillingFrequency', 'BillingSubscriptionStatusType', diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request.py b/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request.py new file mode 100644 index 000000000000..375360756bcd --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AcceptTransferRequest(Model): + """Request parameters to accept transfer. + + :param product_details: Request parameters to accept transfer. + :type product_details: list[~azure.mgmt.billing.models.ProductDetails] + """ + + _attribute_map = { + 'product_details': {'key': 'properties.productDetails', 'type': '[ProductDetails]'}, + } + + def __init__(self, **kwargs): + super(AcceptTransferRequest, self).__init__(**kwargs) + self.product_details = kwargs.get('product_details', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request_py3.py new file mode 100644 index 000000000000..3c82c015bb09 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AcceptTransferRequest(Model): + """Request parameters to accept transfer. + + :param product_details: Request parameters to accept transfer. + :type product_details: list[~azure.mgmt.billing.models.ProductDetails] + """ + + _attribute_map = { + 'product_details': {'key': 'properties.productDetails', 'type': '[ProductDetails]'}, + } + + def __init__(self, *, product_details=None, **kwargs) -> None: + super(AcceptTransferRequest, self).__init__(**kwargs) + self.product_details = product_details diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py b/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py index f677df06b38b..39ace87835df 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py +++ b/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py @@ -12,6 +12,38 @@ from enum import Enum +class ProductType(str, Enum): + + azure_subscription = "AzureSubscription" + azure_reservation = "AzureReservation" + + +class TransferStatus(str, Enum): + + pending = "Pending" + in_progress = "InProgress" + completed = "Completed" + completed_with_errors = "CompletedWithErrors" + failed = "Failed" + canceled = "Canceled" + declined = "Declined" + + +class ProductTransferStatus(str, Enum): + + not_started = "NotStarted" + in_progress = "InProgress" + completed = "Completed" + failed = "Failed" + + +class EligibleProductType(str, Enum): + + dev_test_azure_subscription = "DevTestAzureSubscription" + standard_azure_subscription = "StandardAzureSubscription" + azure_reservation = "AzureReservation" + + class ProductStatusType(str, Enum): active = "Active" diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status.py b/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status.py new file mode 100644 index 000000000000..a63309cd238f --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status.py @@ -0,0 +1,52 @@ +# 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 DetailedTransferStatus(Model): + """Detailed transfer status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar product_type: Type of product being transferred. Possible values + include: 'AzureSubscription', 'AzureReservation' + :vartype product_type: str or ~azure.mgmt.billing.models.ProductType + :ivar product_id: Id of product being transferred. + :vartype product_id: str + :ivar transfer_status: Transfer status. Possible values include: + 'NotStarted', 'InProgress', 'Completed', 'Failed' + :vartype transfer_status: str or + ~azure.mgmt.billing.models.ProductTransferStatus + :param error_details: Error details for transfer execution. + :type error_details: ~azure.mgmt.billing.models.Error + """ + + _validation = { + 'product_type': {'readonly': True}, + 'product_id': {'readonly': True}, + 'transfer_status': {'readonly': True}, + } + + _attribute_map = { + 'product_type': {'key': 'productType', 'type': 'str'}, + 'product_id': {'key': 'productId', 'type': 'str'}, + 'transfer_status': {'key': 'transferStatus', 'type': 'str'}, + 'error_details': {'key': 'errorDetails', 'type': 'Error'}, + } + + def __init__(self, **kwargs): + super(DetailedTransferStatus, self).__init__(**kwargs) + self.product_type = None + self.product_id = None + self.transfer_status = None + self.error_details = kwargs.get('error_details', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status_py3.py new file mode 100644 index 000000000000..3c2cf121483e --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status_py3.py @@ -0,0 +1,52 @@ +# 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 DetailedTransferStatus(Model): + """Detailed transfer status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar product_type: Type of product being transferred. Possible values + include: 'AzureSubscription', 'AzureReservation' + :vartype product_type: str or ~azure.mgmt.billing.models.ProductType + :ivar product_id: Id of product being transferred. + :vartype product_id: str + :ivar transfer_status: Transfer status. Possible values include: + 'NotStarted', 'InProgress', 'Completed', 'Failed' + :vartype transfer_status: str or + ~azure.mgmt.billing.models.ProductTransferStatus + :param error_details: Error details for transfer execution. + :type error_details: ~azure.mgmt.billing.models.Error + """ + + _validation = { + 'product_type': {'readonly': True}, + 'product_id': {'readonly': True}, + 'transfer_status': {'readonly': True}, + } + + _attribute_map = { + 'product_type': {'key': 'productType', 'type': 'str'}, + 'product_id': {'key': 'productId', 'type': 'str'}, + 'transfer_status': {'key': 'transferStatus', 'type': 'str'}, + 'error_details': {'key': 'errorDetails', 'type': 'Error'}, + } + + def __init__(self, *, error_details=None, **kwargs) -> None: + super(DetailedTransferStatus, self).__init__(**kwargs) + self.product_type = None + self.product_id = None + self.transfer_status = None + self.error_details = error_details diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/error.py b/azure-mgmt-billing/azure/mgmt/billing/models/error.py new file mode 100644 index 000000000000..dd81e5a5b953 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/error.py @@ -0,0 +1,40 @@ +# 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 Error(Model): + """Error details for transfer execution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error_code: Error code. + :vartype error_code: str + :ivar error_message: Error message. + :vartype error_message: str + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.error_code = None + self.error_message = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/error_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/error_py3.py new file mode 100644 index 000000000000..d510f6b409ab --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/error_py3.py @@ -0,0 +1,40 @@ +# 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 Error(Model): + """Error details for transfer execution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error_code: Error code. + :vartype error_code: str + :ivar error_message: Error message. + :vartype error_message: str + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.error_code = None + self.error_message = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py b/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py new file mode 100644 index 000000000000..726b8b201c15 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py @@ -0,0 +1,32 @@ +# 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 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/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py new file mode 100644 index 000000000000..564bdd8fbbb0 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py @@ -0,0 +1,32 @@ +# 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 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: + super(InitiateTransferRequest, self).__init__(**kwargs) + self.billing_profile_id = billing_profile_id + self.recipient_email_id = recipient_email_id diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/product_details.py b/azure-mgmt-billing/azure/mgmt/billing/models/product_details.py new file mode 100644 index 000000000000..b0e92125fc0c --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/product_details.py @@ -0,0 +1,33 @@ +# 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 ProductDetails(Model): + """Details of the product to be transferred. + + :param product_type: Type of the prouct to be transferred. Possible values + include: 'AzureSubscription', 'AzureReservation' + :type product_type: str or ~azure.mgmt.billing.models.ProductType + :param product_id: Id of product to be transferred. + :type product_id: str + """ + + _attribute_map = { + 'product_type': {'key': 'productType', 'type': 'str'}, + 'product_id': {'key': 'productId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProductDetails, self).__init__(**kwargs) + self.product_type = kwargs.get('product_type', None) + self.product_id = kwargs.get('product_id', None) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/product_details_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/product_details_py3.py new file mode 100644 index 000000000000..1baa2e9789cc --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/product_details_py3.py @@ -0,0 +1,33 @@ +# 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 ProductDetails(Model): + """Details of the product to be transferred. + + :param product_type: Type of the prouct to be transferred. Possible values + include: 'AzureSubscription', 'AzureReservation' + :type product_type: str or ~azure.mgmt.billing.models.ProductType + :param product_id: Id of product to be transferred. + :type product_id: str + """ + + _attribute_map = { + 'product_type': {'key': 'productType', 'type': 'str'}, + 'product_id': {'key': 'productId', 'type': 'str'}, + } + + def __init__(self, *, product_type=None, product_id: str=None, **kwargs) -> None: + super(ProductDetails, self).__init__(**kwargs) + self.product_type = product_type + self.product_id = product_id diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py b/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py new file mode 100644 index 000000000000..d354dbc6a36a --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py @@ -0,0 +1,79 @@ +# 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 RecipientTransferDetails(Model): + """Details of the transfer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar creation_time: Transfer creation time. + :vartype creation_time: datetime + :ivar expiration_time: Transfer expiration time. + :vartype expiration_time: datetime + :ivar allowed_product_type: Type of subscriptions that can be transferred. + :vartype allowed_product_type: list[str or + ~azure.mgmt.billing.models.EligibleProductType] + :ivar transfer_status: Overall transfer status. Possible values include: + 'Pending', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', + 'Canceled', 'Declined' + :vartype transfer_status: str or ~azure.mgmt.billing.models.TransferStatus + :ivar recipient_email_id: Email Id of recipient of transfer. + :vartype recipient_email_id: str + :ivar initiator_email_id: Email Id of initiator of transfer. + :vartype initiator_email_id: str + :ivar canceled_by: Email Id who user canceled the transfer. + :vartype canceled_by: str + :ivar last_modified_time: Transfer last modification time. + :vartype last_modified_time: datetime + :ivar detailed_transfer_status: Detailed transfer status. + :vartype detailed_transfer_status: + list[~azure.mgmt.billing.models.DetailedTransferStatus] + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'allowed_product_type': {'readonly': True}, + 'transfer_status': {'readonly': True}, + 'recipient_email_id': {'readonly': True}, + 'initiator_email_id': {'readonly': True}, + 'canceled_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'detailed_transfer_status': {'readonly': True}, + } + + _attribute_map = { + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'allowed_product_type': {'key': 'properties.allowedProductType', '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'}, + 'canceled_by': {'key': 'properties.canceledBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'detailed_transfer_status': {'key': 'properties.detailedTransferStatus', 'type': '[DetailedTransferStatus]'}, + } + + def __init__(self, **kwargs): + super(RecipientTransferDetails, self).__init__(**kwargs) + self.creation_time = None + self.expiration_time = None + self.allowed_product_type = None + self.transfer_status = None + self.recipient_email_id = None + self.initiator_email_id = None + self.canceled_by = None + self.last_modified_time = None + self.detailed_transfer_status = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_paged.py b/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_paged.py new file mode 100644 index 000000000000..28cd6d360efd --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class RecipientTransferDetailsPaged(Paged): + """ + A paging container for iterating over a list of :class:`RecipientTransferDetails ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RecipientTransferDetails]'} + } + + def __init__(self, *args, **kwargs): + + super(RecipientTransferDetailsPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py new file mode 100644 index 000000000000..90fcfe2ab2fc --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py @@ -0,0 +1,79 @@ +# 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 RecipientTransferDetails(Model): + """Details of the transfer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar creation_time: Transfer creation time. + :vartype creation_time: datetime + :ivar expiration_time: Transfer expiration time. + :vartype expiration_time: datetime + :ivar allowed_product_type: Type of subscriptions that can be transferred. + :vartype allowed_product_type: list[str or + ~azure.mgmt.billing.models.EligibleProductType] + :ivar transfer_status: Overall transfer status. Possible values include: + 'Pending', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', + 'Canceled', 'Declined' + :vartype transfer_status: str or ~azure.mgmt.billing.models.TransferStatus + :ivar recipient_email_id: Email Id of recipient of transfer. + :vartype recipient_email_id: str + :ivar initiator_email_id: Email Id of initiator of transfer. + :vartype initiator_email_id: str + :ivar canceled_by: Email Id who user canceled the transfer. + :vartype canceled_by: str + :ivar last_modified_time: Transfer last modification time. + :vartype last_modified_time: datetime + :ivar detailed_transfer_status: Detailed transfer status. + :vartype detailed_transfer_status: + list[~azure.mgmt.billing.models.DetailedTransferStatus] + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'allowed_product_type': {'readonly': True}, + 'transfer_status': {'readonly': True}, + 'recipient_email_id': {'readonly': True}, + 'initiator_email_id': {'readonly': True}, + 'canceled_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'detailed_transfer_status': {'readonly': True}, + } + + _attribute_map = { + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'allowed_product_type': {'key': 'properties.allowedProductType', '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'}, + 'canceled_by': {'key': 'properties.canceledBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'detailed_transfer_status': {'key': 'properties.detailedTransferStatus', 'type': '[DetailedTransferStatus]'}, + } + + def __init__(self, **kwargs) -> None: + super(RecipientTransferDetails, self).__init__(**kwargs) + self.creation_time = None + self.expiration_time = None + self.allowed_product_type = None + self.transfer_status = None + self.recipient_email_id = None + self.initiator_email_id = None + self.canceled_by = None + self.last_modified_time = None + self.detailed_transfer_status = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py new file mode 100644 index 000000000000..602499a0a3de --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py @@ -0,0 +1,83 @@ +# 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 TransferDetails(Model): + """Details of the transfer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar creation_time: Transfer creation time. + :vartype creation_time: datetime + :ivar expiration_time: Transfer expiration time. + :vartype expiration_time: datetime + :ivar invoice_section_id: Target invoice setion Id. + :vartype invoice_section_id: str + :ivar billing_account_id: Target billing account Id. + :vartype billing_account_id: str + :ivar transfer_status: Overall transfer status. Possible values include: + 'Pending', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', + 'Canceled', 'Declined' + :vartype transfer_status: str or ~azure.mgmt.billing.models.TransferStatus + :ivar recipient_email_id: Email Id of recipient of transfer. + :vartype recipient_email_id: str + :ivar initiator_email_id: Email Id of initiator of transfer. + :vartype initiator_email_id: str + :ivar canceled_by: Email Id who user canceled the transfer. + :vartype canceled_by: str + :ivar last_modified_time: Transfer last modification time. + :vartype last_modified_time: datetime + :ivar detailed_transfer_status: Detailed transfer status. + :vartype detailed_transfer_status: + list[~azure.mgmt.billing.models.DetailedTransferStatus] + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'billing_account_id': {'readonly': True}, + 'transfer_status': {'readonly': True}, + 'recipient_email_id': {'readonly': True}, + 'initiator_email_id': {'readonly': True}, + 'canceled_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'detailed_transfer_status': {'readonly': True}, + } + + _attribute_map = { + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'billing_account_id': {'key': 'properties.billingAccountId', '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'}, + 'canceled_by': {'key': 'properties.canceledBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'detailed_transfer_status': {'key': 'properties.detailedTransferStatus', 'type': '[DetailedTransferStatus]'}, + } + + def __init__(self, **kwargs): + super(TransferDetails, self).__init__(**kwargs) + self.creation_time = None + self.expiration_time = None + self.invoice_section_id = None + self.billing_account_id = None + self.transfer_status = None + self.recipient_email_id = None + self.initiator_email_id = None + self.canceled_by = None + self.last_modified_time = None + self.detailed_transfer_status = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_paged.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_paged.py new file mode 100644 index 000000000000..868739480a54 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class TransferDetailsPaged(Paged): + """ + A paging container for iterating over a list of :class:`TransferDetails ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TransferDetails]'} + } + + def __init__(self, *args, **kwargs): + + super(TransferDetailsPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py new file mode 100644 index 000000000000..9b91427721cc --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py @@ -0,0 +1,83 @@ +# 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 TransferDetails(Model): + """Details of the transfer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar creation_time: Transfer creation time. + :vartype creation_time: datetime + :ivar expiration_time: Transfer expiration time. + :vartype expiration_time: datetime + :ivar invoice_section_id: Target invoice setion Id. + :vartype invoice_section_id: str + :ivar billing_account_id: Target billing account Id. + :vartype billing_account_id: str + :ivar transfer_status: Overall transfer status. Possible values include: + 'Pending', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', + 'Canceled', 'Declined' + :vartype transfer_status: str or ~azure.mgmt.billing.models.TransferStatus + :ivar recipient_email_id: Email Id of recipient of transfer. + :vartype recipient_email_id: str + :ivar initiator_email_id: Email Id of initiator of transfer. + :vartype initiator_email_id: str + :ivar canceled_by: Email Id who user canceled the transfer. + :vartype canceled_by: str + :ivar last_modified_time: Transfer last modification time. + :vartype last_modified_time: datetime + :ivar detailed_transfer_status: Detailed transfer status. + :vartype detailed_transfer_status: + list[~azure.mgmt.billing.models.DetailedTransferStatus] + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'billing_account_id': {'readonly': True}, + 'transfer_status': {'readonly': True}, + 'recipient_email_id': {'readonly': True}, + 'initiator_email_id': {'readonly': True}, + 'canceled_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'detailed_transfer_status': {'readonly': True}, + } + + _attribute_map = { + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'billing_account_id': {'key': 'properties.billingAccountId', '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'}, + 'canceled_by': {'key': 'properties.canceledBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'detailed_transfer_status': {'key': 'properties.detailedTransferStatus', 'type': '[DetailedTransferStatus]'}, + } + + def __init__(self, **kwargs) -> None: + super(TransferDetails, self).__init__(**kwargs) + self.creation_time = None + self.expiration_time = None + self.invoice_section_id = None + self.billing_account_id = None + self.transfer_status = None + self.recipient_email_id = None + self.initiator_email_id = None + self.canceled_by = None + self.last_modified_time = None + self.detailed_transfer_status = None diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index 78b51f850b18..afba6c4ae619 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -36,6 +36,9 @@ from .transactions_by_billing_account_operations import TransactionsByBillingAccountOperations from .policy_operations import PolicyOperations from .billing_property_operations import BillingPropertyOperations +from .transfer_operations import TransferOperations +from .transfers_operations import TransfersOperations +from .recipient_transfer_operations import RecipientTransferOperations from .operations import Operations from .billing_account_billing_permissions_operations import BillingAccountBillingPermissionsOperations from .invoice_sections_billing_permissions_operations import InvoiceSectionsBillingPermissionsOperations @@ -75,6 +78,9 @@ 'TransactionsByBillingAccountOperations', 'PolicyOperations', 'BillingPropertyOperations', + 'TransferOperations', + 'TransfersOperations', + 'RecipientTransferOperations', 'Operations', 'BillingAccountBillingPermissionsOperations', 'InvoiceSectionsBillingPermissionsOperations', diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfer_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfer_operations.py new file mode 100644 index 000000000000..67bce10a5101 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfer_operations.py @@ -0,0 +1,149 @@ +# 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 RecipientTransferOperations(object): + """RecipientTransferOperations 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 get( + self, transfer_name, custom_headers=None, raw=False, **operation_config): + """Gets the transfer with given transfer Id. + + :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: RecipientTransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.RecipientTransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + '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('RecipientTransferDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/transfers/{transferName}/'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the transfers received by caller. + + :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 RecipientTransferDetails + :rtype: + ~azure.mgmt.billing.models.RecipientTransferDetailsPaged[~azure.mgmt.billing.models.RecipientTransferDetails] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # 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.RecipientTransferDetailsPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RecipientTransferDetailsPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/transfers'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transfer_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/transfer_operations.py new file mode 100644 index 000000000000..418a6bee75a3 --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/transfer_operations.py @@ -0,0 +1,350 @@ +# 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 TransferOperations(object): + """TransferOperations 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, invoice_section_name, billing_profile_id=None, recipient_email_id=None, custom_headers=None, raw=False, **operation_config): + """Initiates the request to transfer the GTM or legacy subscriptions or + RIs to GTM. + + :param billing_account_name: billing Account Id. + :type billing_account_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 + :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` + """ + body = models.InitiateTransferRequest(billing_profile_id=billing_profile_id, 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'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_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(body, '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}/invoiceSections/{invoiceSectionName}/initiateTransfer'} + + def get( + self, billing_account_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 invoice_section_name: InvoiceSection Id. + :type invoice_section_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'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_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}/invoiceSections/{invoiceSectionName}/transfers/{transferName}'} + + def cancel( + self, billing_account_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 invoice_section_name: InvoiceSection Id. + :type invoice_section_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'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_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}/invoiceSections/{invoiceSectionName}/transfers/{transferName}'} + + def accept( + self, transfer_name, product_details=None, custom_headers=None, raw=False, **operation_config): + """Accepts the transfer with given transfer Id. + + :param transfer_name: Transfer Name. + :type transfer_name: str + :param product_details: Request parameters to accept transfer. + :type product_details: list[~azure.mgmt.billing.models.ProductDetails] + :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: RecipientTransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.RecipientTransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + body = models.AcceptTransferRequest(product_details=product_details) + + # Construct URL + url = self.accept.metadata['url'] + path_format_arguments = { + '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' + 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(body, 'AcceptTransferRequest') + + # 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('RecipientTransferDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + accept.metadata = {'url': '/providers/Microsoft.Billing/transfers/{transferName}/acceptTransfer'} + + def decline( + self, transfer_name, custom_headers=None, raw=False, **operation_config): + """Declines the transfer with given transfer Id. + + :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: RecipientTransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.RecipientTransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.decline.metadata['url'] + path_format_arguments = { + '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.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('RecipientTransferDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + decline.metadata = {'url': '/providers/Microsoft.Billing/transfers/{transferName}/declineTransfer'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py new file mode 100644 index 000000000000..f399bd711beb --- /dev/null +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py @@ -0,0 +1,102 @@ +# 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 TransfersOperations(object): + """TransfersOperations 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, 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 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: 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'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_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}/invoiceSections/{invoiceSectionName}/transfers'} From 96d0dc2726a03a9444c83720778a51b6ad2a2a7e Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 25 Mar 2019 20:25:40 +0000 Subject: [PATCH 8/8] Generated from 1b2e4dd688f49f222cce286b8e0603643e3df045 Consolidate operationId naming. --- .../mgmt/billing/billing_management_client.py | 13 +- .../azure/mgmt/billing/operations/__init__.py | 6 +- .../recipient_transfer_operations.py | 149 ------------ ...s.py => recipient_transfers_operations.py} | 221 ++++++------------ .../operations/transfers_operations.py | 195 ++++++++++++++++ 5 files changed, 271 insertions(+), 313 deletions(-) delete mode 100644 azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfer_operations.py rename azure-mgmt-billing/azure/mgmt/billing/operations/{transfer_operations.py => recipient_transfers_operations.py} (56%) diff --git a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index c1d60c2577cb..88371287f0cd 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -44,9 +44,8 @@ from .operations.transactions_by_billing_account_operations import TransactionsByBillingAccountOperations from .operations.policy_operations import PolicyOperations from .operations.billing_property_operations import BillingPropertyOperations -from .operations.transfer_operations import TransferOperations from .operations.transfers_operations import TransfersOperations -from .operations.recipient_transfer_operations import RecipientTransferOperations +from .operations.recipient_transfers_operations import RecipientTransfersOperations from .operations.operations import Operations from .operations.billing_account_billing_permissions_operations import BillingAccountBillingPermissionsOperations from .operations.invoice_sections_billing_permissions_operations import InvoiceSectionsBillingPermissionsOperations @@ -152,12 +151,10 @@ class BillingManagementClient(SDKClient): :vartype policy: azure.mgmt.billing.operations.PolicyOperations :ivar billing_property: BillingProperty operations :vartype billing_property: azure.mgmt.billing.operations.BillingPropertyOperations - :ivar transfer: Transfer operations - :vartype transfer: azure.mgmt.billing.operations.TransferOperations :ivar transfers: Transfers operations :vartype transfers: azure.mgmt.billing.operations.TransfersOperations - :ivar recipient_transfer: RecipientTransfer operations - :vartype recipient_transfer: azure.mgmt.billing.operations.RecipientTransferOperations + :ivar recipient_transfers: RecipientTransfers operations + :vartype recipient_transfers: azure.mgmt.billing.operations.RecipientTransfersOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.billing.operations.Operations :ivar billing_account_billing_permissions: BillingAccountBillingPermissions operations @@ -252,11 +249,9 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.billing_property = BillingPropertyOperations( self._client, self.config, self._serialize, self._deserialize) - self.transfer = TransferOperations( - self._client, self.config, self._serialize, self._deserialize) self.transfers = TransfersOperations( self._client, self.config, self._serialize, self._deserialize) - self.recipient_transfer = RecipientTransferOperations( + self.recipient_transfers = RecipientTransfersOperations( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index afba6c4ae619..8c73c7b45153 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -36,9 +36,8 @@ from .transactions_by_billing_account_operations import TransactionsByBillingAccountOperations from .policy_operations import PolicyOperations from .billing_property_operations import BillingPropertyOperations -from .transfer_operations import TransferOperations from .transfers_operations import TransfersOperations -from .recipient_transfer_operations import RecipientTransferOperations +from .recipient_transfers_operations import RecipientTransfersOperations from .operations import Operations from .billing_account_billing_permissions_operations import BillingAccountBillingPermissionsOperations from .invoice_sections_billing_permissions_operations import InvoiceSectionsBillingPermissionsOperations @@ -78,9 +77,8 @@ 'TransactionsByBillingAccountOperations', 'PolicyOperations', 'BillingPropertyOperations', - 'TransferOperations', 'TransfersOperations', - 'RecipientTransferOperations', + 'RecipientTransfersOperations', 'Operations', 'BillingAccountBillingPermissionsOperations', 'InvoiceSectionsBillingPermissionsOperations', diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfer_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfer_operations.py deleted file mode 100644 index 67bce10a5101..000000000000 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfer_operations.py +++ /dev/null @@ -1,149 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class RecipientTransferOperations(object): - """RecipientTransferOperations 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 get( - self, transfer_name, custom_headers=None, raw=False, **operation_config): - """Gets the transfer with given transfer Id. - - :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: RecipientTransferDetails or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.RecipientTransferDetails or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - '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('RecipientTransferDetails', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/transfers/{transferName}/'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists the transfers received by caller. - - :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 RecipientTransferDetails - :rtype: - ~azure.mgmt.billing.models.RecipientTransferDetailsPaged[~azure.mgmt.billing.models.RecipientTransferDetails] - :raises: - :class:`ErrorResponseException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - - # 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.RecipientTransferDetailsPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.RecipientTransferDetailsPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Billing/transfers'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transfer_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py similarity index 56% rename from azure-mgmt-billing/azure/mgmt/billing/operations/transfer_operations.py rename to azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py index 418a6bee75a3..04d1f8d4dd43 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/transfer_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py @@ -15,8 +15,8 @@ from .. import models -class TransferOperations(object): - """TransferOperations operations. +class RecipientTransfersOperations(object): + """RecipientTransfersOperations operations. :param client: Client for service requests. :param config: Configuration of service client. @@ -34,38 +34,31 @@ 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): - """Initiates the request to transfer the GTM or legacy subscriptions or - RIs to GTM. - - :param billing_account_name: billing Account Id. - :type billing_account_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 + def accept( + self, transfer_name, product_details=None, custom_headers=None, raw=False, **operation_config): + """Accepts the transfer with given transfer Id. + + :param transfer_name: Transfer Name. + :type transfer_name: str + :param product_details: Request parameters to accept transfer. + :type product_details: list[~azure.mgmt.billing.models.ProductDetails] :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 + :return: RecipientTransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.RecipientTransferDetails or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ - body = models.InitiateTransferRequest(billing_profile_id=billing_profile_id, recipient_email_id=recipient_email_id) + body = models.AcceptTransferRequest(product_details=product_details) # Construct URL - url = self.initiate.metadata['url'] + url = self.accept.metadata['url'] path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -84,7 +77,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(body, 'AcceptTransferRequest') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) @@ -96,85 +89,19 @@ def initiate( 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}/invoiceSections/{invoiceSectionName}/initiateTransfer'} - - def get( - self, billing_account_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 invoice_section_name: InvoiceSection Id. - :type invoice_section_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'), - 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_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) + deserialized = self._deserialize('RecipientTransferDetails', 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}/transfers/{transferName}'} + accept.metadata = {'url': '/providers/Microsoft.Billing/transfers/{transferName}/acceptTransfer'} - def cancel( - self, billing_account_name, invoice_section_name, transfer_name, custom_headers=None, raw=False, **operation_config): - """Cancels the transfer for given transfer Id. + def decline( + self, transfer_name, custom_headers=None, raw=False, **operation_config): + """Declines the transfer with given transfer 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 transfer_name: Transfer Name. :type transfer_name: str :param dict custom_headers: headers that will be added to the request @@ -182,17 +109,15 @@ def cancel( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: TransferDetails or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.TransferDetails or + :return: RecipientTransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.RecipientTransferDetails or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.cancel.metadata['url'] + url = self.decline.metadata['url'] path_format_arguments = { - 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), - 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -211,7 +136,7 @@ def cancel( 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) + 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]: @@ -220,23 +145,21 @@ def cancel( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('TransferDetails', response) + deserialized = self._deserialize('RecipientTransferDetails', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - cancel.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}'} + decline.metadata = {'url': '/providers/Microsoft.Billing/transfers/{transferName}/declineTransfer'} - def accept( - self, transfer_name, product_details=None, custom_headers=None, raw=False, **operation_config): - """Accepts the transfer with given transfer Id. + def get( + self, transfer_name, custom_headers=None, raw=False, **operation_config): + """Gets the transfer with given transfer Id. :param transfer_name: Transfer Name. :type transfer_name: str - :param product_details: Request parameters to accept transfer. - :type product_details: list[~azure.mgmt.billing.models.ProductDetails] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -248,10 +171,8 @@ def accept( :raises: :class:`ErrorResponseException` """ - body = models.AcceptTransferRequest(product_details=product_details) - # Construct URL - url = self.accept.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') } @@ -263,7 +184,6 @@ def accept( # 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: @@ -271,11 +191,8 @@ def accept( 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(body, 'AcceptTransferRequest') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) + 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]: @@ -291,60 +208,62 @@ def accept( return client_raw_response return deserialized - accept.metadata = {'url': '/providers/Microsoft.Billing/transfers/{transferName}/acceptTransfer'} + get.metadata = {'url': '/providers/Microsoft.Billing/transfers/{transferName}/'} - def decline( - self, transfer_name, custom_headers=None, raw=False, **operation_config): - """Declines the transfer with given transfer Id. + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the transfers received by caller. - :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: RecipientTransferDetails or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.RecipientTransferDetails or - ~msrest.pipeline.ClientRawResponse + :return: An iterator like instance of RecipientTransferDetails + :rtype: + ~azure.mgmt.billing.models.RecipientTransferDetailsPaged[~azure.mgmt.billing.models.RecipientTransferDetails] :raises: :class:`ErrorResponseException` """ - # Construct URL - url = self.decline.metadata['url'] - path_format_arguments = { - 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) + def internal_paging(next_link=None, raw=False): - # Construct parameters - query_parameters = {} + if not next_link: + # Construct URL + url = self.list.metadata['url'] - # 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 parameters + query_parameters = {} - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + else: + url = next_link + query_parameters = {} - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) + # Construct headers + header_parameters = {} + header_parameters['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') - deserialized = None + # 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 == 200: - deserialized = self._deserialize('RecipientTransferDetails', response) + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.RecipientTransferDetailsPaged(internal_paging, self._deserialize.dependencies) if raw: - client_raw_response = ClientRawResponse(deserialized, response) + header_dict = {} + client_raw_response = models.RecipientTransferDetailsPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - decline.metadata = {'url': '/providers/Microsoft.Billing/transfers/{transferName}/declineTransfer'} + list.metadata = {'url': '/providers/Microsoft.Billing/transfers'} diff --git a/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py b/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py index f399bd711beb..7ab9cae9d90d 100644 --- a/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py +++ b/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py @@ -34,6 +34,201 @@ 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): + """Initiates the request to transfer the GTM or legacy subscriptions or + RIs to GTM. + + :param billing_account_name: billing Account Id. + :type billing_account_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 + :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` + """ + body = models.InitiateTransferRequest(billing_profile_id=billing_profile_id, 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'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_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(body, '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}/invoiceSections/{invoiceSectionName}/initiateTransfer'} + + def get( + self, billing_account_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 invoice_section_name: InvoiceSection Id. + :type invoice_section_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'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_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}/invoiceSections/{invoiceSectionName}/transfers/{transferName}'} + + def cancel( + self, billing_account_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 invoice_section_name: InvoiceSection Id. + :type invoice_section_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'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_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}/invoiceSections/{invoiceSectionName}/transfers/{transferName}'} + def list( self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): """Lists all transfer's details initiated from given invoice section.