diff --git a/sdk/billing/azure-mgmt-billing/README.rst b/sdk/billing/azure-mgmt-billing/README.rst index b68710c15df4..42cef9a57e71 100644 --- a/sdk/billing/azure-mgmt-billing/README.rst +++ b/sdk/billing/azure-mgmt-billing/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Billing Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. +This package has been tested with Python 2.7, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py index 7806b688963f..c5a3100452db 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -9,14 +9,36 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from .operations.billing_accounts_operations import BillingAccountsOperations +from .operations.payment_methods_operations import PaymentMethodsOperations +from .operations.address_operations import AddressOperations +from .operations.available_balances_operations import AvailableBalancesOperations +from .operations.billing_profiles_operations import BillingProfilesOperations +from .operations.customers_operations import CustomersOperations +from .operations.invoice_sections_operations import InvoiceSectionsOperations +from .operations.billing_permissions_operations import BillingPermissionsOperations +from .operations.billing_subscriptions_operations import BillingSubscriptionsOperations +from .operations.products_operations import ProductsOperations +from .operations.transactions_operations import TransactionsOperations +from .operations.departments_operations import DepartmentsOperations from .operations.enrollment_accounts_operations import EnrollmentAccountsOperations -from .operations.billing_periods_operations import BillingPeriodsOperations from .operations.invoices_operations import InvoicesOperations +from .operations.price_sheet_operations import PriceSheetOperations +from .operations.policies_operations import PoliciesOperations +from .operations.billing_property_operations import BillingPropertyOperations +from .operations.transfers_operations import TransfersOperations +from .operations.partner_transfers_operations import PartnerTransfersOperations +from .operations.partner_transfers_transfers_operations import PartnerTransfersTransfersOperations +from .operations.recipient_transfers_operations import RecipientTransfersOperations from .operations.operations import Operations +from .operations.billing_role_definitions_operations import BillingRoleDefinitionsOperations +from .operations.billing_role_assignments_operations import BillingRoleAssignmentsOperations +from .operations.agreements_operations import AgreementsOperations +from .operations.line_of_credits_operations import LineOfCreditsOperations from . import models @@ -52,20 +74,64 @@ def __init__( self.subscription_id = subscription_id -class BillingManagementClient(object): +class BillingManagementClient(SDKClient): """Billing client provides access to billing resources for Azure subscriptions. :ivar config: Configuration for client. :vartype config: BillingManagementClientConfiguration + :ivar billing_accounts: BillingAccounts operations + :vartype billing_accounts: azure.mgmt.billing.operations.BillingAccountsOperations + :ivar payment_methods: PaymentMethods operations + :vartype payment_methods: azure.mgmt.billing.operations.PaymentMethodsOperations + :ivar address: Address operations + :vartype address: azure.mgmt.billing.operations.AddressOperations + :ivar available_balances: AvailableBalances operations + :vartype available_balances: azure.mgmt.billing.operations.AvailableBalancesOperations + :ivar billing_profiles: BillingProfiles operations + :vartype billing_profiles: azure.mgmt.billing.operations.BillingProfilesOperations + :ivar customers: Customers operations + :vartype customers: azure.mgmt.billing.operations.CustomersOperations + :ivar invoice_sections: InvoiceSections operations + :vartype invoice_sections: azure.mgmt.billing.operations.InvoiceSectionsOperations + :ivar billing_permissions: BillingPermissions operations + :vartype billing_permissions: azure.mgmt.billing.operations.BillingPermissionsOperations + :ivar billing_subscriptions: BillingSubscriptions operations + :vartype billing_subscriptions: azure.mgmt.billing.operations.BillingSubscriptionsOperations + :ivar products: Products operations + :vartype products: azure.mgmt.billing.operations.ProductsOperations + :ivar transactions: Transactions operations + :vartype transactions: azure.mgmt.billing.operations.TransactionsOperations + :ivar departments: Departments operations + :vartype departments: azure.mgmt.billing.operations.DepartmentsOperations :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 price_sheet: PriceSheet operations + :vartype price_sheet: azure.mgmt.billing.operations.PriceSheetOperations + :ivar policies: Policies operations + :vartype policies: azure.mgmt.billing.operations.PoliciesOperations + :ivar billing_property: BillingProperty operations + :vartype billing_property: azure.mgmt.billing.operations.BillingPropertyOperations + :ivar transfers: Transfers operations + :vartype transfers: azure.mgmt.billing.operations.TransfersOperations + :ivar partner_transfers: PartnerTransfers operations + :vartype partner_transfers: azure.mgmt.billing.operations.PartnerTransfersOperations + :ivar partner_transfers_transfers: PartnerTransfersTransfers operations + :vartype partner_transfers_transfers: azure.mgmt.billing.operations.PartnerTransfersTransfersOperations + :ivar recipient_transfers: RecipientTransfers operations + :vartype recipient_transfers: azure.mgmt.billing.operations.RecipientTransfersOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.billing.operations.Operations + :ivar billing_role_definitions: BillingRoleDefinitions operations + :vartype billing_role_definitions: azure.mgmt.billing.operations.BillingRoleDefinitionsOperations + :ivar billing_role_assignments: BillingRoleAssignments operations + :vartype billing_role_assignments: azure.mgmt.billing.operations.BillingRoleAssignmentsOperations + :ivar agreements: Agreements operations + :vartype agreements: azure.mgmt.billing.operations.AgreementsOperations + :ivar line_of_credits: LineOfCredits operations + :vartype line_of_credits: azure.mgmt.billing.operations.LineOfCreditsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -79,18 +145,62 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = BillingManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + 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 = '2019-10-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.enrollment_accounts = EnrollmentAccountsOperations( + self.billing_accounts = BillingAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.payment_methods = PaymentMethodsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.address = AddressOperations( + self._client, self.config, self._serialize, self._deserialize) + self.available_balances = AvailableBalancesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_profiles = BillingProfilesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.customers = CustomersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoice_sections = InvoiceSectionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_permissions = BillingPermissionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_subscriptions = BillingSubscriptionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.products = ProductsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.transactions = TransactionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.departments = DepartmentsOperations( self._client, self.config, self._serialize, self._deserialize) - self.billing_periods = BillingPeriodsOperations( + self.enrollment_accounts = EnrollmentAccountsOperations( self._client, self.config, self._serialize, self._deserialize) self.invoices = InvoicesOperations( self._client, self.config, self._serialize, self._deserialize) + self.price_sheet = PriceSheetOperations( + self._client, self.config, self._serialize, self._deserialize) + self.policies = PoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_property = BillingPropertyOperations( + self._client, self.config, self._serialize, self._deserialize) + self.transfers = TransfersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.partner_transfers = PartnerTransfersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.partner_transfers_transfers = PartnerTransfersTransfersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.recipient_transfers = RecipientTransfersOperations( + self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) + self.billing_role_definitions = BillingRoleDefinitionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_role_assignments = BillingRoleAssignmentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.agreements = AgreementsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.line_of_credits = LineOfCreditsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py index b49fd4a67883..6d3fe3f9e95e 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py @@ -9,32 +9,289 @@ # regenerated. # -------------------------------------------------------------------------- -from .enrollment_account import EnrollmentAccount -from .billing_period import BillingPeriod -from .download_url import DownloadUrl -from .error_details import ErrorDetails -from .error_response import ErrorResponse, ErrorResponseException -from .invoice import Invoice -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 +try: + from .azure_plan_py3 import AzurePlan + from .reseller_py3 import Reseller + from .customer_py3 import Customer + from .initiate_transfer_request_py3 import InitiateTransferRequest + from .address_details_py3 import AddressDetails + from .validate_address_response_py3 import ValidateAddressResponse + from .product_details_py3 import ProductDetails + from .accept_transfer_request_py3 import AcceptTransferRequest + 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 + from .transfer_billing_subscription_request_py3 import TransferBillingSubscriptionRequest + from .validate_subscription_transfer_eligibility_error_py3 import ValidateSubscriptionTransferEligibilityError + from .validate_subscription_transfer_eligibility_result_py3 import ValidateSubscriptionTransferEligibilityResult + from .update_auto_renew_operation_py3 import UpdateAutoRenewOperation + from .invoice_section_py3 import InvoiceSection + from .billing_profile_py3 import BillingProfile + from .enrollment_policies_py3 import EnrollmentPolicies + from .enrollment_py3 import Enrollment + from .enrollment_account_py3 import EnrollmentAccount + from .department_py3 import Department + from .billing_account_py3 import BillingAccount + from .billing_account_list_result_py3 import BillingAccountListResult + from .billing_account_update_request_py3 import BillingAccountUpdateRequest + from .billing_property_py3 import BillingProperty + from .department_list_result_py3 import DepartmentListResult + from .enrollment_account_list_result_py3 import EnrollmentAccountListResult + from .billing_profile_list_result_py3 import BillingProfileListResult + from .billing_profile_creation_request_py3 import BillingProfileCreationRequest + from .invoice_section_creation_request_py3 import InvoiceSectionCreationRequest + from .invoice_section_list_result_py3 import InvoiceSectionListResult + from .download_url_py3 import DownloadUrl + from .error_details_py3 import ErrorDetails + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .resource_py3 import Resource + from .amount_py3 import Amount + from .document_py3 import Document + from .payment_properties_py3 import PaymentProperties + from .invoice_py3 import Invoice + from .invoice_list_result_py3 import InvoiceListResult + from .product_py3 import Product + from .products_list_result_py3 import ProductsListResult + from .validate_product_transfer_eligibility_error_py3 import ValidateProductTransferEligibilityError + from .validate_product_transfer_eligibility_result_py3 import ValidateProductTransferEligibilityResult + from .billing_subscription_py3 import BillingSubscription + from .billing_subscriptions_list_result_py3 import BillingSubscriptionsListResult + from .enrollment_account_context_py3 import EnrollmentAccountContext + from .transaction_py3 import Transaction + from .transaction_list_result_py3 import TransactionListResult + from .policy_py3 import Policy + from .available_balance_py3 import AvailableBalance + from .payment_method_py3 import PaymentMethod + 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_properties_py3 import BillingPermissionsProperties + from .billing_permissions_list_result_py3 import BillingPermissionsListResult + from .billing_role_definition_py3 import BillingRoleDefinition + from .billing_role_definition_list_result_py3 import BillingRoleDefinitionListResult + from .participants_py3 import Participants + from .agreement_py3 import Agreement + from .agreement_list_result_py3 import AgreementListResult + from .validation_result_properties_py3 import ValidationResultProperties + from .validate_transfer_response_py3 import ValidateTransferResponse + from .validate_transfer_list_response_py3 import ValidateTransferListResponse + from .line_of_credit_py3 import LineOfCredit +except (SyntaxError, ImportError): + from .azure_plan import AzurePlan + from .reseller import Reseller + from .customer import Customer + from .initiate_transfer_request import InitiateTransferRequest + from .address_details import AddressDetails + from .validate_address_response import ValidateAddressResponse + 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 + from .transfer_billing_subscription_request import TransferBillingSubscriptionRequest + from .validate_subscription_transfer_eligibility_error import ValidateSubscriptionTransferEligibilityError + from .validate_subscription_transfer_eligibility_result import ValidateSubscriptionTransferEligibilityResult + from .update_auto_renew_operation import UpdateAutoRenewOperation + from .invoice_section import InvoiceSection + from .billing_profile import BillingProfile + from .enrollment_policies import EnrollmentPolicies + from .enrollment import Enrollment + from .enrollment_account import EnrollmentAccount + from .department import Department + from .billing_account import BillingAccount + from .billing_account_list_result import BillingAccountListResult + from .billing_account_update_request import BillingAccountUpdateRequest + from .billing_property import BillingProperty + from .department_list_result import DepartmentListResult + from .enrollment_account_list_result import EnrollmentAccountListResult + from .billing_profile_list_result import BillingProfileListResult + from .billing_profile_creation_request import BillingProfileCreationRequest + from .invoice_section_creation_request import InvoiceSectionCreationRequest + from .invoice_section_list_result import InvoiceSectionListResult + from .download_url import DownloadUrl + from .error_details import ErrorDetails + from .error_response import ErrorResponse, ErrorResponseException + from .resource import Resource + from .amount import Amount + from .document import Document + from .payment_properties import PaymentProperties + from .invoice import Invoice + from .invoice_list_result import InvoiceListResult + from .product import Product + from .products_list_result import ProductsListResult + from .validate_product_transfer_eligibility_error import ValidateProductTransferEligibilityError + from .validate_product_transfer_eligibility_result import ValidateProductTransferEligibilityResult + from .billing_subscription import BillingSubscription + from .billing_subscriptions_list_result import BillingSubscriptionsListResult + from .enrollment_account_context import EnrollmentAccountContext + from .transaction import Transaction + from .transaction_list_result import TransactionListResult + 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 + 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_properties import BillingPermissionsProperties + from .billing_permissions_list_result import BillingPermissionsListResult + from .billing_role_definition import BillingRoleDefinition + from .billing_role_definition_list_result import BillingRoleDefinitionListResult + from .participants import Participants + from .agreement import Agreement + from .agreement_list_result import AgreementListResult + from .validation_result_properties import ValidationResultProperties + from .validate_transfer_response import ValidateTransferResponse + from .validate_transfer_list_response import ValidateTransferListResponse + from .line_of_credit import LineOfCredit +from .payment_method_paged import PaymentMethodPaged +from .customer_paged import CustomerPaged +from .billing_subscription_paged import BillingSubscriptionPaged +from .product_paged import ProductPaged +from .transaction_paged import TransactionPaged +from .transfer_details_paged import TransferDetailsPaged +from .recipient_transfer_details_paged import RecipientTransferDetailsPaged from .operation_paged import OperationPaged +from .billing_management_client_enums import ( + AddressValidationStatus, + ProductType, + TransferStatus, + ProductTransferStatus, + EligibleProductType, + SubscriptionTransferValidationErrorCode, + AgreementType, + CustomerType, + InvoiceStatus, + DocumentType, + ProductStatusType, + BillingFrequency, + ProductTransferValidationErrorCode, + BillingSubscriptionStatusType, + TransactionTypeKind, + ReservationType, + MarketplacePurchasesPolicy, + ReservationPurchasesPolicy, + ViewChargesPolicy, + PaymentMethodType, + UpdateAutoRenew, + Status, +) __all__ = [ + 'AzurePlan', + 'Reseller', + 'Customer', + 'InitiateTransferRequest', + 'AddressDetails', + 'ValidateAddressResponse', + 'ProductDetails', + 'AcceptTransferRequest', + 'Error', + 'DetailedTransferStatus', + 'TransferDetails', + 'RecipientTransferDetails', + 'TransferProductRequestProperties', + 'TransferBillingSubscriptionResult', + 'TransferBillingSubscriptionRequestProperties', + 'TransferBillingSubscriptionRequest', + 'ValidateSubscriptionTransferEligibilityError', + 'ValidateSubscriptionTransferEligibilityResult', + 'UpdateAutoRenewOperation', + 'InvoiceSection', + 'BillingProfile', + 'EnrollmentPolicies', + 'Enrollment', 'EnrollmentAccount', - 'BillingPeriod', + 'Department', + 'BillingAccount', + 'BillingAccountListResult', + 'BillingAccountUpdateRequest', + 'BillingProperty', + 'DepartmentListResult', + 'EnrollmentAccountListResult', + 'BillingProfileListResult', + 'BillingProfileCreationRequest', + 'InvoiceSectionCreationRequest', + 'InvoiceSectionListResult', 'DownloadUrl', 'ErrorDetails', 'ErrorResponse', 'ErrorResponseException', + 'Resource', + 'Amount', + 'Document', + 'PaymentProperties', 'Invoice', + 'InvoiceListResult', + 'Product', + 'ProductsListResult', + 'ValidateProductTransferEligibilityError', + 'ValidateProductTransferEligibilityResult', + 'BillingSubscription', + 'BillingSubscriptionsListResult', + 'EnrollmentAccountContext', + 'Transaction', + 'TransactionListResult', + 'Policy', + 'AvailableBalance', + 'PaymentMethod', + 'UpdateAutoRenewRequest', 'OperationDisplay', 'Operation', - 'Resource', - 'EnrollmentAccountPaged', - 'BillingPeriodPaged', - 'InvoicePaged', + 'BillingRoleAssignmentPayload', + 'BillingRoleAssignment', + 'BillingRoleAssignmentListResult', + 'BillingPermissionsProperties', + 'BillingPermissionsListResult', + 'BillingRoleDefinition', + 'BillingRoleDefinitionListResult', + 'Participants', + 'Agreement', + 'AgreementListResult', + 'ValidationResultProperties', + 'ValidateTransferResponse', + 'ValidateTransferListResponse', + 'LineOfCredit', + 'PaymentMethodPaged', + 'CustomerPaged', + 'BillingSubscriptionPaged', + 'ProductPaged', + 'TransactionPaged', + 'TransferDetailsPaged', + 'RecipientTransferDetailsPaged', 'OperationPaged', + 'AddressValidationStatus', + 'ProductType', + 'TransferStatus', + 'ProductTransferStatus', + 'EligibleProductType', + 'SubscriptionTransferValidationErrorCode', + 'AgreementType', + 'CustomerType', + 'InvoiceStatus', + 'DocumentType', + 'ProductStatusType', + 'BillingFrequency', + 'ProductTransferValidationErrorCode', + 'BillingSubscriptionStatusType', + 'TransactionTypeKind', + 'ReservationType', + 'MarketplacePurchasesPolicy', + 'ReservationPurchasesPolicy', + 'ViewChargesPolicy', + 'PaymentMethodType', + 'UpdateAutoRenew', + 'Status', ] diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request.py new file mode 100644 index 000000000000..375360756bcd --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/accept_transfer_request_py3.py new file mode 100644 index 000000000000..3c82c015bb09 --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_details.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_details.py new file mode 100644 index 000000000000..482bb0977023 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_details.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 AddressDetails(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(AddressDetails, self).__init__(**kwargs) + self.first_name = kwargs.get('first_name', None) + self.last_name = kwargs.get('last_name', None) + self.company_name = kwargs.get('company_name', None) + 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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_details_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_details_py3.py new file mode 100644 index 000000000000..5c588a787a1e --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_details_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 AddressDetails(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(AddressDetails, 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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement.py new file mode 100644 index 000000000000..a117306b8f54 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement.py @@ -0,0 +1,66 @@ +# 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 Agreement(Resource): + """An agreement 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 agreement_link: The link to the agreement. + :vartype agreement_link: str + :ivar effective_date: Effective date. + :vartype effective_date: datetime + :ivar expiration_date: Expiration date. + :vartype expiration_date: datetime + :param participants: Participants or signer of the agreement. + :type participants: list[~azure.mgmt.billing.models.Participants] + :ivar status: The agreement status + :vartype status: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'agreement_link': {'readonly': True}, + 'effective_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'agreement_link': {'key': 'properties.agreementLink', 'type': 'str'}, + 'effective_date': {'key': 'properties.effectiveDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'participants': {'key': 'properties.participants', 'type': '[Participants]'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Agreement, self).__init__(**kwargs) + self.agreement_link = None + self.effective_date = None + self.expiration_date = None + self.participants = kwargs.get('participants', None) + self.status = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result.py new file mode 100644 index 000000000000..a6f6c98716a6 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement_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 AgreementListResult(Model): + """Result of listing agreements. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of agreements. + :vartype value: list[~azure.mgmt.billing.models.Agreement] + :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': '[Agreement]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AgreementListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement_list_result_py3.py new file mode 100644 index 000000000000..901473f2cb25 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement_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 AgreementListResult(Model): + """Result of listing agreements. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of agreements. + :vartype value: list[~azure.mgmt.billing.models.Agreement] + :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': '[Agreement]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AgreementListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement_py3.py new file mode 100644 index 000000000000..d8728de106f1 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/agreement_py3.py @@ -0,0 +1,66 @@ +# 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 Agreement(Resource): + """An agreement 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 agreement_link: The link to the agreement. + :vartype agreement_link: str + :ivar effective_date: Effective date. + :vartype effective_date: datetime + :ivar expiration_date: Expiration date. + :vartype expiration_date: datetime + :param participants: Participants or signer of the agreement. + :type participants: list[~azure.mgmt.billing.models.Participants] + :ivar status: The agreement status + :vartype status: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'agreement_link': {'readonly': True}, + 'effective_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'agreement_link': {'key': 'properties.agreementLink', 'type': 'str'}, + 'effective_date': {'key': 'properties.effectiveDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'participants': {'key': 'properties.participants', 'type': '[Participants]'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, *, participants=None, **kwargs) -> None: + super(Agreement, self).__init__(**kwargs) + self.agreement_link = None + self.effective_date = None + self.expiration_date = None + self.participants = participants + self.status = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/amount.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/amount.py new file mode 100644 index 000000000000..5bf8558f645b --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/amount.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 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 + :param value: Amount value. + :type value: float + """ + + _validation = { + 'currency': {'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 = kwargs.get('value', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/amount_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/amount_py3.py new file mode 100644 index 000000000000..6e74a174f35b --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/amount_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 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 + :param value: Amount value. + :type value: float + """ + + _validation = { + 'currency': {'readonly': True}, + } + + _attribute_map = { + 'currency': {'key': 'currency', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, *, value: float=None, **kwargs) -> None: + super(Amount, self).__init__(**kwargs) + self.currency = None + self.value = value diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_period.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/available_balance.py similarity index 50% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_period.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/available_balance.py index a8a38c17d40f..61b66201e156 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_period.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/available_balance.py @@ -12,8 +12,8 @@ from .resource import Resource -class BillingPeriod(Resource): - """A billing period 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. @@ -24,36 +24,24 @@ 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] + :ivar amount: Balance Amount. + :vartype amount: ~azure.mgmt.billing.models.Amount """ _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}, + 'amount': {'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]'}, + 'amount': {'key': 'properties.amount', 'type': 'Amount'}, } - def __init__(self): - super(BillingPeriod, self).__init__() - self.billing_period_start_date = None - self.billing_period_end_date = None - self.invoice_ids = None + def __init__(self, **kwargs): + super(AvailableBalance, self).__init__(**kwargs) + self.amount = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/available_balance_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/available_balance_py3.py new file mode 100644 index 000000000000..e4c17832fbee --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/azure_plan.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/azure_plan.py new file mode 100644 index 000000000000..35f94d6c4bb5 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/azure_plan.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 AzurePlan(Model): + """Details about the azure plan. + + 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(AzurePlan, self).__init__(**kwargs) + self.sku_id = kwargs.get('sku_id', None) + self.sku_description = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/azure_plan_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/azure_plan_py3.py new file mode 100644 index 000000000000..cfc19829051c --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/azure_plan_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 AzurePlan(Model): + """Details about the azure plan. + + 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(AzurePlan, self).__init__(**kwargs) + self.sku_id = sku_id + self.sku_description = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py new file mode 100644 index 000000000000..16a130bce1d6 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py @@ -0,0 +1,91 @@ +# 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 + :param address: The address associated with billing account. + :type address: ~azure.mgmt.billing.models.AddressDetails + :ivar agreement_type: The type of agreement. Possible values include: + 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', + 'MicrosoftOnlineServicesProgram' + :vartype agreement_type: str or ~azure.mgmt.billing.models.AgreementType + :ivar customer_type: The type of customer. Possible values include: + 'Enterprise', 'Individual', 'Partner' + :vartype customer_type: str or ~azure.mgmt.billing.models.CustomerType + :param billing_profiles: The billing profiles associated to the billing + account. By default this is not populated, unless it's specified in + $expand. + :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] + :ivar organization_id: Organization id. + :vartype organization_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'agreement_type': {'readonly': True}, + 'customer_type': {'readonly': True}, + 'enrollment_details': {'readonly': True}, + 'organization_id': {'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'}, + 'address': {'key': 'properties.address', 'type': 'AddressDetails'}, + 'agreement_type': {'key': 'properties.agreementType', 'type': 'str'}, + 'customer_type': {'key': 'properties.customerType', 'type': 'str'}, + 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, + 'enrollment_details': {'key': 'properties.enrollmentDetails', 'type': 'Enrollment'}, + 'departments': {'key': 'properties.departments', 'type': '[Department]'}, + 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, + 'organization_id': {'key': 'properties.organizationId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingAccount, self).__init__(**kwargs) + self.display_name = None + self.address = kwargs.get('address', None) + self.agreement_type = None + self.customer_type = None + self.billing_profiles = kwargs.get('billing_profiles', None) + self.enrollment_details = None + self.departments = kwargs.get('departments', None) + self.enrollment_accounts = kwargs.get('enrollment_accounts', None) + self.organization_id = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result.py new file mode 100644 index 000000000000..311bed43f801 --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_list_result_py3.py new file mode 100644 index 000000000000..fa94c0d30857 --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py new file mode 100644 index 000000000000..952411134ac6 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py @@ -0,0 +1,91 @@ +# 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 + :param address: The address associated with billing account. + :type address: ~azure.mgmt.billing.models.AddressDetails + :ivar agreement_type: The type of agreement. Possible values include: + 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', + 'MicrosoftOnlineServicesProgram' + :vartype agreement_type: str or ~azure.mgmt.billing.models.AgreementType + :ivar customer_type: The type of customer. Possible values include: + 'Enterprise', 'Individual', 'Partner' + :vartype customer_type: str or ~azure.mgmt.billing.models.CustomerType + :param billing_profiles: The billing profiles associated to the billing + account. By default this is not populated, unless it's specified in + $expand. + :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] + :ivar organization_id: Organization id. + :vartype organization_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'agreement_type': {'readonly': True}, + 'customer_type': {'readonly': True}, + 'enrollment_details': {'readonly': True}, + 'organization_id': {'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'}, + 'address': {'key': 'properties.address', 'type': 'AddressDetails'}, + 'agreement_type': {'key': 'properties.agreementType', 'type': 'str'}, + 'customer_type': {'key': 'properties.customerType', 'type': 'str'}, + 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, + 'enrollment_details': {'key': 'properties.enrollmentDetails', 'type': 'Enrollment'}, + 'departments': {'key': 'properties.departments', 'type': '[Department]'}, + 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, + 'organization_id': {'key': 'properties.organizationId', 'type': 'str'}, + } + + def __init__(self, *, address=None, billing_profiles=None, departments=None, enrollment_accounts=None, **kwargs) -> None: + super(BillingAccount, self).__init__(**kwargs) + self.display_name = None + self.address = address + self.agreement_type = None + self.customer_type = None + self.billing_profiles = billing_profiles + self.enrollment_details = None + self.departments = departments + self.enrollment_accounts = enrollment_accounts + self.organization_id = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request.py new file mode 100644 index 000000000000..4640cd3ace9b --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request.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 BillingAccountUpdateRequest(Model): + """The request properties of the billing account that can be updated. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar display_name: The billing account name. + :vartype display_name: str + :param address: The address associated with billing account. + :type address: ~azure.mgmt.billing.models.AddressDetails + :ivar agreement_type: The type of agreement. Possible values include: + 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', + 'MicrosoftOnlineServicesProgram' + :vartype agreement_type: str or ~azure.mgmt.billing.models.AgreementType + :ivar customer_type: The type of customer. Possible values include: + 'Enterprise', 'Individual', 'Partner' + :vartype customer_type: str or ~azure.mgmt.billing.models.CustomerType + :param billing_profiles: The billing profiles associated to the billing + account. By default this is not populated, unless it's specified in + $expand. + :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] + :ivar organization_id: Organization id. + :vartype organization_id: str + """ + + _validation = { + 'display_name': {'readonly': True}, + 'agreement_type': {'readonly': True}, + 'customer_type': {'readonly': True}, + 'enrollment_details': {'readonly': True}, + 'organization_id': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'address': {'key': 'properties.address', 'type': 'AddressDetails'}, + 'agreement_type': {'key': 'properties.agreementType', 'type': 'str'}, + 'customer_type': {'key': 'properties.customerType', 'type': 'str'}, + 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, + 'enrollment_details': {'key': 'properties.enrollmentDetails', 'type': 'Enrollment'}, + 'departments': {'key': 'properties.departments', 'type': '[Department]'}, + 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, + 'organization_id': {'key': 'properties.organizationId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingAccountUpdateRequest, self).__init__(**kwargs) + self.display_name = None + self.address = kwargs.get('address', None) + self.agreement_type = None + self.customer_type = None + self.billing_profiles = kwargs.get('billing_profiles', None) + self.enrollment_details = None + self.departments = kwargs.get('departments', None) + self.enrollment_accounts = kwargs.get('enrollment_accounts', None) + self.organization_id = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request_py3.py new file mode 100644 index 000000000000..66743e347ee1 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_update_request_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 BillingAccountUpdateRequest(Model): + """The request properties of the billing account that can be updated. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar display_name: The billing account name. + :vartype display_name: str + :param address: The address associated with billing account. + :type address: ~azure.mgmt.billing.models.AddressDetails + :ivar agreement_type: The type of agreement. Possible values include: + 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', + 'MicrosoftOnlineServicesProgram' + :vartype agreement_type: str or ~azure.mgmt.billing.models.AgreementType + :ivar customer_type: The type of customer. Possible values include: + 'Enterprise', 'Individual', 'Partner' + :vartype customer_type: str or ~azure.mgmt.billing.models.CustomerType + :param billing_profiles: The billing profiles associated to the billing + account. By default this is not populated, unless it's specified in + $expand. + :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] + :ivar organization_id: Organization id. + :vartype organization_id: str + """ + + _validation = { + 'display_name': {'readonly': True}, + 'agreement_type': {'readonly': True}, + 'customer_type': {'readonly': True}, + 'enrollment_details': {'readonly': True}, + 'organization_id': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'address': {'key': 'properties.address', 'type': 'AddressDetails'}, + 'agreement_type': {'key': 'properties.agreementType', 'type': 'str'}, + 'customer_type': {'key': 'properties.customerType', 'type': 'str'}, + 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, + 'enrollment_details': {'key': 'properties.enrollmentDetails', 'type': 'Enrollment'}, + 'departments': {'key': 'properties.departments', 'type': '[Department]'}, + 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, + 'organization_id': {'key': 'properties.organizationId', 'type': 'str'}, + } + + def __init__(self, *, address=None, billing_profiles=None, departments=None, enrollment_accounts=None, **kwargs) -> None: + super(BillingAccountUpdateRequest, self).__init__(**kwargs) + self.display_name = None + self.address = address + self.agreement_type = None + self.customer_type = None + self.billing_profiles = billing_profiles + self.enrollment_details = None + self.departments = departments + self.enrollment_accounts = enrollment_accounts + self.organization_id = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py new file mode 100644 index 000000000000..d261a13b3646 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py @@ -0,0 +1,182 @@ +# 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 AddressValidationStatus(str, Enum): + + valid = "Valid" + invalid = "Invalid" + + +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 SubscriptionTransferValidationErrorCode(str, Enum): + + invalid_source = "InvalidSource" + subscription_not_active = "SubscriptionNotActive" + insufficient_permission_on_source = "InsufficientPermissionOnSource" + insufficient_permission_on_destination = "InsufficientPermissionOnDestination" + destination_billing_profile_past_due = "DestinationBillingProfilePastDue" + subscription_type_not_supported = "SubscriptionTypeNotSupported" + cross_billing_account_not_allowed = "CrossBillingAccountNotAllowed" + not_available_for_destination_market = "NotAvailableForDestinationMarket" + + +class AgreementType(str, Enum): + + microsoft_customer_agreement = "MicrosoftCustomerAgreement" + enterprise_agreement = "EnterpriseAgreement" + microsoft_online_services_program = "MicrosoftOnlineServicesProgram" + + +class CustomerType(str, Enum): + + enterprise = "Enterprise" + individual = "Individual" + partner = "Partner" + + +class InvoiceStatus(str, Enum): + + past_due = "PastDue" + due = "Due" + paid = "Paid" + void = "Void" + + +class DocumentType(str, Enum): + + invoice = "Invoice" + void_note = "VoidNote" + receipt = "Receipt" + credit_note = "CreditNote" + + +class ProductStatusType(str, Enum): + + active = "Active" + 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 ProductTransferValidationErrorCode(str, Enum): + + invalid_source = "InvalidSource" + product_not_active = "ProductNotActive" + insufficient_permission_on_source = "InsufficientPermissionOnSource" + insufficient_permission_on_destination = "InsufficientPermissionOnDestination" + destination_billing_profile_past_due = "DestinationBillingProfilePastDue" + product_type_not_supported = "ProductTypeNotSupported" + cross_billing_account_not_allowed = "CrossBillingAccountNotAllowed" + not_available_for_destination_market = "NotAvailableForDestinationMarket" + one_time_purchase_product_transfer_not_allowed = "OneTimePurchaseProductTransferNotAllowed" + + +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 MarketplacePurchasesPolicy(str, Enum): + + all_allowed = "AllAllowed" + free_allowed = "FreeAllowed" + not_allowed = "NotAllowed" + + +class ReservationPurchasesPolicy(str, Enum): + + allowed = "Allowed" + not_allowed = "NotAllowed" + + +class ViewChargesPolicy(str, Enum): + + none = "None" + subscription_owner = "SubscriptionOwner" + + +class PaymentMethodType(str, Enum): + + credits = "Credits" + cheque_wire = "ChequeWire" + + +class UpdateAutoRenew(str, Enum): + + true = "true" + false = "false" + + +class Status(str, Enum): + + approved = "Approved" + rejected = "Rejected" diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.py new file mode 100644 index 000000000000..c60d01df406b --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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.BillingPermissionsProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingPermissionsProperties]'}, + } + + def __init__(self, **kwargs): + super(BillingPermissionsListResult, self).__init__(**kwargs) + self.value = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_py3.py new file mode 100644 index 000000000000..5870154ed2ee --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_list_result_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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.BillingPermissionsProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingPermissionsProperties]'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingPermissionsListResult, self).__init__(**kwargs) + self.value = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_properties.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_properties.py new file mode 100644 index 000000000000..037d3b84b190 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_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 BillingPermissionsProperties(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(BillingPermissionsProperties, self).__init__(**kwargs) + self.actions = None + self.not_actions = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_properties_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_properties_py3.py new file mode 100644 index 000000000000..0f0fd8a3848f --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_permissions_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 BillingPermissionsProperties(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(BillingPermissionsProperties, self).__init__(**kwargs) + self.actions = None + self.not_actions = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py new file mode 100644 index 000000000000..8b8100a4641c --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.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 .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 address: Billing address. + :type address: ~azure.mgmt.billing.models.AddressDetails + :ivar invoice_email_opt_in: If the billing profile is opted in to receive + invoices via email. + :vartype invoice_email_opt_in: bool + :ivar invoice_day: Invoice day. + :vartype invoice_day: int + :ivar currency: The currency associated with the billing profile. + :vartype currency: str + :param enabled_azure_plans: Information about the enabled azure plans. + :type enabled_azure_plans: list[~azure.mgmt.billing.models.AzurePlan] + :param invoice_sections: The invoice sections associated to the billing + profile. + :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'invoice_email_opt_in': {'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'}, + 'address': {'key': 'properties.address', 'type': 'AddressDetails'}, + 'invoice_email_opt_in': {'key': 'properties.invoiceEmailOptIn', 'type': 'bool'}, + 'invoice_day': {'key': 'properties.invoiceDay', 'type': 'int'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'enabled_azure_plans': {'key': 'properties.enabledAzurePlans', 'type': '[AzurePlan]'}, + '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.address = kwargs.get('address', None) + self.invoice_email_opt_in = None + self.invoice_day = None + self.currency = None + self.enabled_azure_plans = kwargs.get('enabled_azure_plans', None) + self.invoice_sections = kwargs.get('invoice_sections', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request.py new file mode 100644 index 000000000000..1da011a5243f --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request.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 BillingProfileCreationRequest(Model): + """The request parameters for creating a new billing profile. + + :param display_name: The billing profile name. + :type display_name: str + :param po_number: Purchase order number. + :type po_number: str + :param address: Billing address. + :type address: ~azure.mgmt.billing.models.AddressDetails + :param invoice_email_opt_in: If the billing profile is opted in to receive + invoices via email. + :type invoice_email_opt_in: bool + :param enabled_azure_plans: Enabled azure plans for this billing profile. + :type enabled_azure_plans: list[~azure.mgmt.billing.models.AzurePlan] + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'po_number': {'key': 'poNumber', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'AddressDetails'}, + 'invoice_email_opt_in': {'key': 'invoiceEmailOptIn', 'type': 'bool'}, + 'enabled_azure_plans': {'key': 'enabledAzurePlans', 'type': '[AzurePlan]'}, + } + + def __init__(self, **kwargs): + super(BillingProfileCreationRequest, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.po_number = kwargs.get('po_number', None) + self.address = kwargs.get('address', None) + self.invoice_email_opt_in = kwargs.get('invoice_email_opt_in', None) + self.enabled_azure_plans = kwargs.get('enabled_azure_plans', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request_py3.py new file mode 100644 index 000000000000..b6e47446e5d5 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_creation_request_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 BillingProfileCreationRequest(Model): + """The request parameters for creating a new billing profile. + + :param display_name: The billing profile name. + :type display_name: str + :param po_number: Purchase order number. + :type po_number: str + :param address: Billing address. + :type address: ~azure.mgmt.billing.models.AddressDetails + :param invoice_email_opt_in: If the billing profile is opted in to receive + invoices via email. + :type invoice_email_opt_in: bool + :param enabled_azure_plans: Enabled azure plans for this billing profile. + :type enabled_azure_plans: list[~azure.mgmt.billing.models.AzurePlan] + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'po_number': {'key': 'poNumber', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'AddressDetails'}, + 'invoice_email_opt_in': {'key': 'invoiceEmailOptIn', 'type': 'bool'}, + 'enabled_azure_plans': {'key': 'enabledAzurePlans', 'type': '[AzurePlan]'}, + } + + def __init__(self, *, display_name: str=None, po_number: str=None, address=None, invoice_email_opt_in: bool=None, enabled_azure_plans=None, **kwargs) -> None: + super(BillingProfileCreationRequest, self).__init__(**kwargs) + self.display_name = display_name + self.po_number = po_number + self.address = address + self.invoice_email_opt_in = invoice_email_opt_in + self.enabled_azure_plans = enabled_azure_plans diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result.py new file mode 100644 index 000000000000..3a117e471cab --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_list_result_py3.py new file mode 100644 index 000000000000..470cb7f349c8 --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py new file mode 100644 index 000000000000..4becac1c070e --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_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 .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 address: Billing address. + :type address: ~azure.mgmt.billing.models.AddressDetails + :ivar invoice_email_opt_in: If the billing profile is opted in to receive + invoices via email. + :vartype invoice_email_opt_in: bool + :ivar invoice_day: Invoice day. + :vartype invoice_day: int + :ivar currency: The currency associated with the billing profile. + :vartype currency: str + :param enabled_azure_plans: Information about the enabled azure plans. + :type enabled_azure_plans: list[~azure.mgmt.billing.models.AzurePlan] + :param invoice_sections: The invoice sections associated to the billing + profile. + :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'invoice_email_opt_in': {'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'}, + 'address': {'key': 'properties.address', 'type': 'AddressDetails'}, + 'invoice_email_opt_in': {'key': 'properties.invoiceEmailOptIn', 'type': 'bool'}, + 'invoice_day': {'key': 'properties.invoiceDay', 'type': 'int'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'enabled_azure_plans': {'key': 'properties.enabledAzurePlans', 'type': '[AzurePlan]'}, + 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, + } + + def __init__(self, *, display_name: str=None, po_number: str=None, address=None, enabled_azure_plans=None, invoice_sections=None, **kwargs) -> None: + super(BillingProfile, self).__init__(**kwargs) + self.display_name = display_name + self.po_number = po_number + self.address = address + self.invoice_email_opt_in = None + self.invoice_day = None + self.currency = None + self.enabled_azure_plans = enabled_azure_plans + self.invoice_sections = invoice_sections diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.py new file mode 100644 index 000000000000..4d26452f52e9 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_property.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. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BillingProperty(Resource): + """A billing property 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_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_display_name: Billing account display name. + :vartype billing_account_display_name: str + :ivar billing_profile_id: Billing profile Id. + :vartype billing_profile_id: str + :ivar billing_profile_display_name: Billing profile display name. + :vartype billing_profile_display_name: str + :ivar cost_center: Cost center name. + :vartype cost_center: str + :ivar invoice_section_id: Invoice Section Id. + :vartype invoice_section_id: str + :ivar invoice_section_display_name: Invoice Section display name. + :vartype invoice_section_display_name: str + :ivar product_id: Product Id. + :vartype product_id: str + :ivar product_name: Product name. + :vartype product_name: str + :ivar sku_id: SKU Id. + :vartype sku_id: str + :ivar sku_description: SKU description. + :vartype sku_description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'billing_tenant_id': {'readonly': True}, + 'billing_account_id': {'readonly': True}, + 'billing_account_display_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, + 'cost_center': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_display_name': {'readonly': True}, + 'product_id': {'readonly': True}, + 'product_name': {'readonly': True}, + 'sku_id': {'readonly': True}, + 'sku_description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'billing_tenant_id': {'key': 'properties.billingTenantId', 'type': 'str'}, + 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, + 'billing_account_display_name': {'key': 'properties.billingAccountDisplayName', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_display_name': {'key': 'properties.invoiceSectionDisplayName', 'type': 'str'}, + 'product_id': {'key': 'properties.productId', 'type': 'str'}, + 'product_name': {'key': 'properties.productName', 'type': 'str'}, + 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingProperty, self).__init__(**kwargs) + self.billing_tenant_id = None + self.billing_account_id = None + self.billing_account_display_name = None + self.billing_profile_id = None + self.billing_profile_display_name = None + self.cost_center = None + self.invoice_section_id = None + self.invoice_section_display_name = None + self.product_id = None + self.product_name = None + self.sku_id = None + self.sku_description = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.py new file mode 100644 index 000000000000..a57550f087de --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_property_py3.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. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class BillingProperty(Resource): + """A billing property 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_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_display_name: Billing account display name. + :vartype billing_account_display_name: str + :ivar billing_profile_id: Billing profile Id. + :vartype billing_profile_id: str + :ivar billing_profile_display_name: Billing profile display name. + :vartype billing_profile_display_name: str + :ivar cost_center: Cost center name. + :vartype cost_center: str + :ivar invoice_section_id: Invoice Section Id. + :vartype invoice_section_id: str + :ivar invoice_section_display_name: Invoice Section display name. + :vartype invoice_section_display_name: str + :ivar product_id: Product Id. + :vartype product_id: str + :ivar product_name: Product name. + :vartype product_name: str + :ivar sku_id: SKU Id. + :vartype sku_id: str + :ivar sku_description: SKU description. + :vartype sku_description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'billing_tenant_id': {'readonly': True}, + 'billing_account_id': {'readonly': True}, + 'billing_account_display_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, + 'cost_center': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_display_name': {'readonly': True}, + 'product_id': {'readonly': True}, + 'product_name': {'readonly': True}, + 'sku_id': {'readonly': True}, + 'sku_description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'billing_tenant_id': {'key': 'properties.billingTenantId', 'type': 'str'}, + 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, + 'billing_account_display_name': {'key': 'properties.billingAccountDisplayName', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_display_name': {'key': 'properties.invoiceSectionDisplayName', 'type': 'str'}, + 'product_id': {'key': 'properties.productId', 'type': 'str'}, + 'product_name': {'key': 'properties.productName', 'type': 'str'}, + 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingProperty, self).__init__(**kwargs) + self.billing_tenant_id = None + self.billing_account_id = None + self.billing_account_display_name = None + self.billing_profile_id = None + self.billing_profile_display_name = None + self.cost_center = None + self.invoice_section_id = None + self.invoice_section_display_name = None + self.product_id = None + self.product_name = None + self.sku_id = None + self.sku_description = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment.py new file mode 100644 index 000000000000..c626a9811a31 --- /dev/null +++ b/sdk/billing/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 definition 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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result.py new file mode 100644 index 000000000000..e0bd17aae8cc --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_list_result_py3.py new file mode 100644 index 000000000000..ff36c26cf4dd --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.py new file mode 100644 index 000000000000..2236f8c559f6 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.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 BillingRoleAssignmentPayload(Model): + """The payload use to update role assignment on a scope. + + :param principal_id: The user's principal id that the role gets assigned + to + :type principal_id: str + :param billing_role_definition_id: The role definition id + :type billing_role_definition_id: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'billing_role_definition_id': {'key': 'billingRoleDefinitionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingRoleAssignmentPayload, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.billing_role_definition_id = kwargs.get('billing_role_definition_id', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py new file mode 100644 index 000000000000..83f716d25768 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_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 BillingRoleAssignmentPayload(Model): + """The payload use to update role assignment on a scope. + + :param principal_id: The user's principal id that the role gets assigned + to + :type principal_id: str + :param billing_role_definition_id: The role definition id + :type billing_role_definition_id: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'billing_role_definition_id': {'key': 'billingRoleDefinitionId', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str=None, billing_role_definition_id: str=None, **kwargs) -> None: + super(BillingRoleAssignmentPayload, self).__init__(**kwargs) + self.principal_id = principal_id + self.billing_role_definition_id = billing_role_definition_id diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_py3.py new file mode 100644 index 000000000000..05dcf924e246 --- /dev/null +++ b/sdk/billing/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 definition 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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py new file mode 100644 index 000000000000..f13b0415a2dd --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition.py @@ -0,0 +1,59 @@ +# 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.BillingPermissionsProperties] + :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': '[BillingPermissionsProperties]'}, + '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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result.py new file mode 100644 index 000000000000..c49aa86ed9c8 --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_list_result_py3.py new file mode 100644 index 000000000000..6132318aaed1 --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py new file mode 100644 index 000000000000..a38206d5408e --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_definition_py3.py @@ -0,0 +1,59 @@ +# 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.BillingPermissionsProperties] + :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': '[BillingPermissionsProperties]'}, + '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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription.py new file mode 100644 index 000000000000..ec190474d48c --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription.py @@ -0,0 +1,117 @@ +# 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 BillingSubscription(Resource): + """A billing Subscription 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 billing_profile_id: Billing Profile id to which this product + belongs. + :vartype billing_profile_id: str + :ivar billing_profile_display_name: Billing Profile display name to which + this product belongs. + :vartype billing_profile_display_name: str + :ivar customer_id: Customer id to which this product belongs. + :vartype customer_id: str + :ivar customer_display_name: Display name of customer to which this + product belongs. + :vartype customer_display_name: str + :ivar invoice_section_id: Invoice section id to which this product + belongs. + :vartype invoice_section_id: str + :ivar invoice_section_display_name: Invoice section display name to which + this product belongs. + :vartype invoice_section_display_name: str + :ivar reseller: Reseller for this subscription. + :vartype reseller: ~azure.mgmt.billing.models.Reseller + :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}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, + 'customer_id': {'readonly': True}, + 'customer_display_name': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_display_name': {'readonly': True}, + 'reseller': {'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'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, + 'customer_id': {'key': 'properties.customerId', 'type': 'str'}, + 'customer_display_name': {'key': 'properties.customerDisplayName', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_display_name': {'key': 'properties.invoiceSectionDisplayName', 'type': 'str'}, + 'reseller': {'key': 'properties.reseller', 'type': 'Reseller'}, + 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingSubscription, self).__init__(**kwargs) + self.display_name = None + self.subscription_id = None + self.subscription_billing_status = kwargs.get('subscription_billing_status', None) + self.last_month_charges = None + self.month_to_date_charges = None + self.billing_profile_id = None + self.billing_profile_display_name = None + self.customer_id = None + self.customer_display_name = None + self.invoice_section_id = None + self.invoice_section_display_name = None + self.reseller = None + self.sku_id = kwargs.get('sku_id', None) + self.sku_description = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_period_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_paged.py similarity index 73% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_period_paged.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_paged.py index 54fd2546182b..a92e57cfd52c 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_period_paged.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class BillingPeriodPaged(Paged): +class BillingSubscriptionPaged(Paged): """ - A paging container for iterating over a list of :class:`BillingPeriod ` object + A paging container for iterating over a list of :class:`BillingSubscription ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[BillingPeriod]'} + 'current_page': {'key': 'value', 'type': '[BillingSubscription]'} } def __init__(self, *args, **kwargs): - super(BillingPeriodPaged, self).__init__(*args, **kwargs) + super(BillingSubscriptionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_py3.py new file mode 100644 index 000000000000..0588b67f5595 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_py3.py @@ -0,0 +1,117 @@ +# 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 BillingSubscription(Resource): + """A billing Subscription 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 billing_profile_id: Billing Profile id to which this product + belongs. + :vartype billing_profile_id: str + :ivar billing_profile_display_name: Billing Profile display name to which + this product belongs. + :vartype billing_profile_display_name: str + :ivar customer_id: Customer id to which this product belongs. + :vartype customer_id: str + :ivar customer_display_name: Display name of customer to which this + product belongs. + :vartype customer_display_name: str + :ivar invoice_section_id: Invoice section id to which this product + belongs. + :vartype invoice_section_id: str + :ivar invoice_section_display_name: Invoice section display name to which + this product belongs. + :vartype invoice_section_display_name: str + :ivar reseller: Reseller for this subscription. + :vartype reseller: ~azure.mgmt.billing.models.Reseller + :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}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, + 'customer_id': {'readonly': True}, + 'customer_display_name': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_display_name': {'readonly': True}, + 'reseller': {'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'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, + 'customer_id': {'key': 'properties.customerId', 'type': 'str'}, + 'customer_display_name': {'key': 'properties.customerDisplayName', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_display_name': {'key': 'properties.invoiceSectionDisplayName', 'type': 'str'}, + 'reseller': {'key': 'properties.reseller', 'type': 'Reseller'}, + '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(BillingSubscription, self).__init__(**kwargs) + self.display_name = None + self.subscription_id = None + self.subscription_billing_status = subscription_billing_status + self.last_month_charges = None + self.month_to_date_charges = None + self.billing_profile_id = None + self.billing_profile_display_name = None + self.customer_id = None + self.customer_display_name = None + self.invoice_section_id = None + self.invoice_section_display_name = None + self.reseller = None + self.sku_id = sku_id + self.sku_description = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py new file mode 100644 index 000000000000..c0cd95f08a17 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_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 BillingSubscriptionsListResult(Model): + """Result of listing billing subscriptions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of billing subscriptions. + :vartype value: list[~azure.mgmt.billing.models.BillingSubscription] + :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': '[BillingSubscription]'}, + '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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py new file mode 100644 index 000000000000..cd24113e7cb7 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_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 BillingSubscriptionsListResult(Model): + """Result of listing billing subscriptions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of billing subscriptions. + :vartype value: list[~azure.mgmt.billing.models.BillingSubscription] + :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': '[BillingSubscription]'}, + '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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/customer.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/customer.py new file mode 100644 index 000000000000..de4f86f64204 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/customer.py @@ -0,0 +1,55 @@ +# 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 Customer(Resource): + """A partner's customer. + + 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 customer. + :type display_name: str + :param enabled_azure_plans: Information about the product. + :type enabled_azure_plans: list[~azure.mgmt.billing.models.AzurePlan] + :param resellers: The resellers which are allowed to provide service to + this customer. + :type resellers: list[~azure.mgmt.billing.models.Reseller] + """ + + _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'}, + 'enabled_azure_plans': {'key': 'properties.enabledAzurePlans', 'type': '[AzurePlan]'}, + 'resellers': {'key': 'properties.resellers', 'type': '[Reseller]'}, + } + + def __init__(self, **kwargs): + super(Customer, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.enabled_azure_plans = kwargs.get('enabled_azure_plans', None) + self.resellers = kwargs.get('resellers', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/customer_paged.py similarity index 67% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_paged.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/customer_paged.py index bf852a37e1b1..a0fc9a405887 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_paged.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/customer_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class EnrollmentAccountPaged(Paged): +class CustomerPaged(Paged): """ - A paging container for iterating over a list of :class:`EnrollmentAccount ` object + A paging container for iterating over a list of :class:`Customer ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[EnrollmentAccount]'} + 'current_page': {'key': 'value', 'type': '[Customer]'} } def __init__(self, *args, **kwargs): - super(EnrollmentAccountPaged, self).__init__(*args, **kwargs) + super(CustomerPaged, self).__init__(*args, **kwargs) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/customer_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/customer_py3.py new file mode 100644 index 000000000000..791294f68b8c --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/customer_py3.py @@ -0,0 +1,55 @@ +# 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 Customer(Resource): + """A partner's customer. + + 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 customer. + :type display_name: str + :param enabled_azure_plans: Information about the product. + :type enabled_azure_plans: list[~azure.mgmt.billing.models.AzurePlan] + :param resellers: The resellers which are allowed to provide service to + this customer. + :type resellers: list[~azure.mgmt.billing.models.Reseller] + """ + + _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'}, + 'enabled_azure_plans': {'key': 'properties.enabledAzurePlans', 'type': '[AzurePlan]'}, + 'resellers': {'key': 'properties.resellers', 'type': '[Reseller]'}, + } + + def __init__(self, *, display_name: str=None, enabled_azure_plans=None, resellers=None, **kwargs) -> None: + super(Customer, self).__init__(**kwargs) + self.display_name = display_name + self.enabled_azure_plans = enabled_azure_plans + self.resellers = resellers diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/department.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/department.py new file mode 100644 index 000000000000..dce10c23e9ab --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result.py new file mode 100644 index 000000000000..0ddf8650748c --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/department_list_result_py3.py new file mode 100644 index 000000000000..13d02e2a6581 --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/department_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/department_py3.py new file mode 100644 index 000000000000..e794a716e58d --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status.py new file mode 100644 index 000000000000..a63309cd238f --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/detailed_transfer_status_py3.py new file mode 100644 index 000000000000..3c2cf121483e --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document.py new file mode 100644 index 000000000000..7ab0b8866b26 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document.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 Document(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.DocumentType + :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(Document, self).__init__(**kwargs) + self.kind = None + self.url = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document_py3.py new file mode 100644 index 000000000000..0775ca7dc086 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/document_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 Document(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.DocumentType + :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(Document, self).__init__(**kwargs) + self.kind = None + self.url = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_url.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_url.py index 175264024ae9..ffddaf71dfca 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_url.py +++ b/sdk/billing/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 @@ -35,7 +35,7 @@ class DownloadUrl(Model): 'url': {'key': 'url', 'type': 'str'}, } - def __init__(self): - super(DownloadUrl, self).__init__() + def __init__(self, **kwargs): + super(DownloadUrl, self).__init__(**kwargs) self.expiry_time = None self.url = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_url_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_url_py3.py new file mode 100644 index 000000000000..a5dd985ca819 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_url_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 DownloadUrl(Model): + """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 + sending a request. + + :ivar expiry_time: The time in UTC at which this download URL will expire. + :vartype expiry_time: datetime + :ivar url: The URL to the PDF file. + :vartype url: str + """ + + _validation = { + 'expiry_time': {'readonly': True}, + 'url': {'readonly': True}, + } + + _attribute_map = { + 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DownloadUrl, self).__init__(**kwargs) + self.expiry_time = None + self.url = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment.py new file mode 100644 index 000000000000..f72863ab2de9 --- /dev/null +++ b/sdk/billing/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_cycle: Enrollment billing cycle + :vartype billing_cycle: str + """ + + _validation = { + 'currency': {'readonly': True}, + 'channel': {'readonly': True}, + 'policies': {'readonly': True}, + 'language': {'readonly': True}, + 'country_code': {'readonly': True}, + 'status': {'readonly': True}, + 'billing_cycle': {'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_cycle': {'key': 'billingCycle', '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_cycle = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py index 3e8e6cb69204..abfb121b9551 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.py +++ b/sdk/billing/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): - super(EnrollmentAccount, self).__init__() - self.principal_name = None + def __init__(self, **kwargs): + super(EnrollmentAccount, self).__init__(**kwargs) + 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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context.py new file mode 100644 index 000000000000..ef7372a0c02e --- /dev/null +++ b/sdk/billing/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_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_name': {'key': 'enrollmentAccountName', '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_name = kwargs.get('enrollment_account_name', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_context_py3.py new file mode 100644 index 000000000000..10dd1f3d0236 --- /dev/null +++ b/sdk/billing/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_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_name': {'key': 'enrollmentAccountName', 'type': 'str'}, + } + + 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_name = enrollment_account_name diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result.py new file mode 100644 index 000000000000..54c13d580c59 --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_list_result_py3.py new file mode 100644 index 000000000000..1108506a24f3 --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py new file mode 100644 index 000000000000..69e19f8db3c2 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account_py3.py @@ -0,0 +1,71 @@ +# 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 EnrollmentAccount(Resource): + """An 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 + :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}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', '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, *, 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.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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies.py new file mode 100644 index 000000000000..1d85db932e8f --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_policies_py3.py new file mode 100644 index 000000000000..171c895e3374 --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_py3.py new file mode 100644 index 000000000000..1c1a8618c379 --- /dev/null +++ b/sdk/billing/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_cycle: Enrollment billing cycle + :vartype billing_cycle: str + """ + + _validation = { + 'currency': {'readonly': True}, + 'channel': {'readonly': True}, + 'policies': {'readonly': True}, + 'language': {'readonly': True}, + 'country_code': {'readonly': True}, + 'status': {'readonly': True}, + 'billing_cycle': {'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_cycle': {'key': 'billingCycle', '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_cycle = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error.py new file mode 100644 index 000000000000..dd81e5a5b953 --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_details.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_details.py index 91d77d6df46b..ebdc3b5e9aaf 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_details.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_details.py @@ -38,8 +38,8 @@ class ErrorDetails(Model): 'target': {'key': 'target', 'type': 'str'}, } - def __init__(self): - super(ErrorDetails, self).__init__() + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) self.code = None self.message = None self.target = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_details_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_details_py3.py new file mode 100644 index 000000000000..08aeaf2b35a5 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_details_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 ErrorDetails(Model): + """The details of the error. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + :ivar target: The target of the particular error. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_py3.py new file mode 100644 index 000000000000..d510f6b409ab --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_response.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_response.py index 06441e8c4e75..97452d9adf1c 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_response.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_response.py @@ -25,9 +25,9 @@ class ErrorResponse(Model): 'error': {'key': 'error', 'type': 'ErrorDetails'}, } - def __init__(self, error=None): - super(ErrorResponse, self).__init__() - self.error = error + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) class ErrorResponseException(HttpOperationError): diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_response_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_response_py3.py new file mode 100644 index 000000000000..6449a49ab342 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_response_py3.py @@ -0,0 +1,42 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error response indicates that the service is not able to process the + incoming request. The reason is provided in the error message. + + :param error: The details of the error. + :type error: ~azure.mgmt.billing.models.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request.py new file mode 100644 index 000000000000..f973636f1bed --- /dev/null +++ b/sdk/billing/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 recipient_email_id: Email Id of recipient for transfer. + :type recipient_email_id: str + :param reseller_id: Optional reseller Id for transfer. + :type reseller_id: str + """ + + _attribute_map = { + 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, + 'reseller_id': {'key': 'properties.resellerId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(InitiateTransferRequest, self).__init__(**kwargs) + self.recipient_email_id = kwargs.get('recipient_email_id', None) + self.reseller_id = kwargs.get('reseller_id', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py new file mode 100644 index 000000000000..9e66f618c29e --- /dev/null +++ b/sdk/billing/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 recipient_email_id: Email Id of recipient for transfer. + :type recipient_email_id: str + :param reseller_id: Optional reseller Id for transfer. + :type reseller_id: str + """ + + _attribute_map = { + 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, + 'reseller_id': {'key': 'properties.resellerId', 'type': 'str'}, + } + + def __init__(self, *, recipient_email_id: str=None, reseller_id: str=None, **kwargs) -> None: + super(InitiateTransferRequest, self).__init__(**kwargs) + self.recipient_email_id = recipient_email_id + self.reseller_id = reseller_id diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py index c97af83790a2..46ec34f15a55 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice.py @@ -13,7 +13,7 @@ class Invoice(Resource): - """An invoice resource can be used download a PDF version of an invoice. + """An invoice resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -24,42 +24,82 @@ class Invoice(Resource): :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 perdiod ids that the invoice is - attributed to. - :vartype billing_period_ids: list[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.InvoiceStatus + :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_id: The billing profile id this invoice belongs to. + :vartype billing_profile_id: str + :ivar billing_profile_display_name: The billing profile display name this + invoice belongs to. + :vartype billing_profile_display_name: str + :ivar purchase_order_number: The purchase identifier for the invoice. + :vartype purchase_order_number: str + :ivar documents: List of documents available to download including invoice + and tax documents. + :vartype documents: list[~azure.mgmt.billing.models.Document] + :ivar payments: List of payments. + :vartype payments: list[~azure.mgmt.billing.models.PaymentProperties] """ _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_period_ids': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, + 'purchase_order_number': {'readonly': True}, + 'documents': {'readonly': True}, + 'payments': {'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]'}, + '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_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, + 'purchase_order_number': {'key': 'properties.purchaseOrderNumber', 'type': 'str'}, + 'documents': {'key': 'properties.documents', 'type': '[Document]'}, + 'payments': {'key': 'properties.payments', 'type': '[PaymentProperties]'}, } - def __init__(self, download_url=None): - super(Invoice, self).__init__() - self.download_url = download_url + def __init__(self, **kwargs): + super(Invoice, 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_period_ids = None + self.billing_profile_id = None + self.billing_profile_display_name = None + self.purchase_order_number = None + self.documents = None + self.payments = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result.py new file mode 100644 index 000000000000..3be6cc257137 --- /dev/null +++ b/sdk/billing/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.Invoice] + :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': '[Invoice]'}, + '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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_list_result_py3.py new file mode 100644 index 000000000000..76446f395e68 --- /dev/null +++ b/sdk/billing/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.Invoice] + :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': '[Invoice]'}, + '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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_py3.py new file mode 100644 index 000000000000..b564e05d5a27 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_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 Invoice(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.InvoiceStatus + :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_id: The billing profile id this invoice belongs to. + :vartype billing_profile_id: str + :ivar billing_profile_display_name: The billing profile display name this + invoice belongs to. + :vartype billing_profile_display_name: str + :ivar purchase_order_number: The purchase identifier for the invoice. + :vartype purchase_order_number: str + :ivar documents: List of documents available to download including invoice + and tax documents. + :vartype documents: list[~azure.mgmt.billing.models.Document] + :ivar payments: List of payments. + :vartype payments: list[~azure.mgmt.billing.models.PaymentProperties] + """ + + _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_id': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, + 'purchase_order_number': {'readonly': True}, + 'documents': {'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_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, + 'purchase_order_number': {'key': 'properties.purchaseOrderNumber', 'type': 'str'}, + 'documents': {'key': 'properties.documents', 'type': '[Document]'}, + 'payments': {'key': 'properties.payments', 'type': '[PaymentProperties]'}, + } + + def __init__(self, **kwargs) -> None: + super(Invoice, 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_id = None + self.billing_profile_display_name = None + self.purchase_order_number = None + self.documents = None + self.payments = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py new file mode 100644 index 000000000000..ea78f2d1985e --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py @@ -0,0 +1,46 @@ +# 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 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 + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(InvoiceSection, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_creation_request.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_creation_request.py new file mode 100644 index 000000000000..e7339f87d4aa --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_creation_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 InvoiceSectionCreationRequest(Model): + """The properties of an InvoiceSection. + + :param display_name: The name of the InvoiceSection. + :type display_name: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(InvoiceSectionCreationRequest, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_creation_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_creation_request_py3.py new file mode 100644 index 000000000000..b355141f09b0 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_creation_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 InvoiceSectionCreationRequest(Model): + """The properties of an InvoiceSection. + + :param display_name: The name of the InvoiceSection. + :type display_name: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, **kwargs) -> None: + super(InvoiceSectionCreationRequest, self).__init__(**kwargs) + self.display_name = display_name diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result.py new file mode 100644 index 000000000000..cf43e8aede6a --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_list_result_py3.py new file mode 100644 index 000000000000..91d43ba0544d --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py new file mode 100644 index 000000000000..13c336c2ef4b --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py @@ -0,0 +1,46 @@ +# 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 + """ + + _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'}, + } + + def __init__(self, *, display_name: str=None, **kwargs) -> None: + super(InvoiceSection, self).__init__(**kwargs) + self.display_name = display_name diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit.py new file mode 100644 index 000000000000..e9ca78556fe3 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LineOfCredit(Resource): + """Line of credit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param credit_limit: The current credit limit. + :type credit_limit: ~azure.mgmt.billing.models.Amount + :ivar reason: The reason for the line of credit status when not approved. + :vartype reason: str + :ivar remaining_balance: Remaining balance. + :vartype remaining_balance: ~azure.mgmt.billing.models.Amount + :param status: The line of credit status. Possible values include: + 'Approved', 'Rejected' + :type status: str or ~azure.mgmt.billing.models.Status + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'reason': {'readonly': True}, + 'remaining_balance': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'credit_limit': {'key': 'properties.creditLimit', 'type': 'Amount'}, + 'reason': {'key': 'properties.reason', 'type': 'str'}, + 'remaining_balance': {'key': 'properties.remainingBalance', 'type': 'Amount'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LineOfCredit, self).__init__(**kwargs) + self.credit_limit = kwargs.get('credit_limit', None) + self.reason = None + self.remaining_balance = None + self.status = kwargs.get('status', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit_py3.py new file mode 100644 index 000000000000..c066a5d22454 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/line_of_credit_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class LineOfCredit(Resource): + """Line of credit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param credit_limit: The current credit limit. + :type credit_limit: ~azure.mgmt.billing.models.Amount + :ivar reason: The reason for the line of credit status when not approved. + :vartype reason: str + :ivar remaining_balance: Remaining balance. + :vartype remaining_balance: ~azure.mgmt.billing.models.Amount + :param status: The line of credit status. Possible values include: + 'Approved', 'Rejected' + :type status: str or ~azure.mgmt.billing.models.Status + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'reason': {'readonly': True}, + 'remaining_balance': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'credit_limit': {'key': 'properties.creditLimit', 'type': 'Amount'}, + 'reason': {'key': 'properties.reason', 'type': 'str'}, + 'remaining_balance': {'key': 'properties.remainingBalance', 'type': 'Amount'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, *, credit_limit=None, status=None, **kwargs) -> None: + super(LineOfCredit, self).__init__(**kwargs) + self.credit_limit = credit_limit + self.reason = None + self.remaining_balance = None + self.status = status diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation.py index c2aae214fd34..0e458f6ea690 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation.py @@ -33,7 +33,7 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, } - def __init__(self, display=None): - super(Operation, self).__init__() + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) self.name = None - self.display = display + self.display = kwargs.get('display', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_display.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_display.py index 0dcad2d20d02..ef6f1093f01a 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_display.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_display.py @@ -39,8 +39,8 @@ class OperationDisplay(Model): 'operation': {'key': 'operation', 'type': 'str'}, } - def __init__(self): - super(OperationDisplay, self).__init__() + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) self.provider = None self.resource = None self.operation = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_display_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_display_py3.py new file mode 100644 index 000000000000..4ff84a2893e2 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_display_py3.py @@ -0,0 +1,46 @@ +# 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 OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.Billing. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Invoice, + etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_py3.py new file mode 100644 index 000000000000..6006624920fe --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_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 Operation(Model): + """A Billing REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.billing.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/participants.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/participants.py new file mode 100644 index 000000000000..8377492ad1d6 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/participants.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 Participants(Model): + """Details about the participant or signer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The signing status + :vartype status: str + :ivar status_date: The date when status got changed. + :vartype status_date: datetime + :ivar email: The email address of the participant or signer. + :vartype email: str + """ + + _validation = { + 'status': {'readonly': True}, + 'status_date': {'readonly': True}, + 'email': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'status_date': {'key': 'statusDate', 'type': 'iso-8601'}, + 'email': {'key': 'email', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Participants, self).__init__(**kwargs) + self.status = None + self.status_date = None + self.email = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/participants_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/participants_py3.py new file mode 100644 index 000000000000..53a2573b44c6 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/participants_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 Participants(Model): + """Details about the participant or signer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The signing status + :vartype status: str + :ivar status_date: The date when status got changed. + :vartype status_date: datetime + :ivar email: The email address of the participant or signer. + :vartype email: str + """ + + _validation = { + 'status': {'readonly': True}, + 'status_date': {'readonly': True}, + 'email': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'status_date': {'key': 'statusDate', 'type': 'iso-8601'}, + 'email': {'key': 'email', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Participants, self).__init__(**kwargs) + self.status = None + self.status_date = None + self.email = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py new file mode 100644 index 000000000000..f5e5e53ae3f5 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method.py @@ -0,0 +1,63 @@ +# 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 payment_method_type: Payment method type. Possible values include: + 'Credits', 'ChequeWire' + :type payment_method_type: str or + ~azure.mgmt.billing.models.PaymentMethodType + :ivar details: Details about the payment method. + :vartype details: str + :ivar expiration: Expiration month and year. + :vartype expiration: str + :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'}, + 'payment_method_type': {'key': 'properties.paymentMethodType', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + 'expiration': {'key': 'properties.expiration', 'type': 'str'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PaymentMethod, self).__init__(**kwargs) + self.payment_method_type = kwargs.get('payment_method_type', None) + self.details = None + self.expiration = None + self.currency = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_paged.py new file mode 100644 index 000000000000..ff52f6b8b2b7 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_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 PaymentMethodPaged(Paged): + """ + 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': '[PaymentMethod]'} + } + + def __init__(self, *args, **kwargs): + + super(PaymentMethodPaged, self).__init__(*args, **kwargs) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py new file mode 100644 index 000000000000..e4176955e527 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_method_py3.py @@ -0,0 +1,63 @@ +# 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 payment_method_type: Payment method type. Possible values include: + 'Credits', 'ChequeWire' + :type payment_method_type: str or + ~azure.mgmt.billing.models.PaymentMethodType + :ivar details: Details about the payment method. + :vartype details: str + :ivar expiration: Expiration month and year. + :vartype expiration: str + :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'}, + 'payment_method_type': {'key': 'properties.paymentMethodType', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + 'expiration': {'key': 'properties.expiration', 'type': 'str'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + } + + def __init__(self, *, payment_method_type=None, **kwargs) -> None: + super(PaymentMethod, self).__init__(**kwargs) + self.payment_method_type = payment_method_type + self.details = None + self.expiration = None + self.currency = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties.py new file mode 100644 index 000000000000..8b5251d71703 --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/payment_properties_py3.py new file mode 100644 index 000000000000..76ebc09376af --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy.py new file mode 100644 index 000000000000..5a55d57edd6c --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy.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 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 marketplace_purchases: The marketplace purchases are free, allowed + or not allowed. Possible values include: 'AllAllowed', 'FreeAllowed', + 'NotAllowed' + :type marketplace_purchases: str or + ~azure.mgmt.billing.models.MarketplacePurchasesPolicy + :param reservation_purchases: The reservation purchases allowed or not. + Possible values include: 'Allowed', 'NotAllowed' + :type reservation_purchases: str or + ~azure.mgmt.billing.models.ReservationPurchasesPolicy + :param view_charges: Who can view charges. Possible values include: + 'None', 'SubscriptionOwner' + :type view_charges: str or ~azure.mgmt.billing.models.ViewChargesPolicy + """ + + _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'}, + 'marketplace_purchases': {'key': 'properties.marketplacePurchases', 'type': 'str'}, + 'reservation_purchases': {'key': 'properties.reservationPurchases', 'type': 'str'}, + 'view_charges': {'key': 'properties.viewCharges', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Policy, self).__init__(**kwargs) + self.marketplace_purchases = kwargs.get('marketplace_purchases', None) + self.reservation_purchases = kwargs.get('reservation_purchases', None) + self.view_charges = kwargs.get('view_charges', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py new file mode 100644 index 000000000000..cf316ef3eda0 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy_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 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 marketplace_purchases: The marketplace purchases are free, allowed + or not allowed. Possible values include: 'AllAllowed', 'FreeAllowed', + 'NotAllowed' + :type marketplace_purchases: str or + ~azure.mgmt.billing.models.MarketplacePurchasesPolicy + :param reservation_purchases: The reservation purchases allowed or not. + Possible values include: 'Allowed', 'NotAllowed' + :type reservation_purchases: str or + ~azure.mgmt.billing.models.ReservationPurchasesPolicy + :param view_charges: Who can view charges. Possible values include: + 'None', 'SubscriptionOwner' + :type view_charges: str or ~azure.mgmt.billing.models.ViewChargesPolicy + """ + + _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'}, + 'marketplace_purchases': {'key': 'properties.marketplacePurchases', 'type': 'str'}, + 'reservation_purchases': {'key': 'properties.reservationPurchases', 'type': 'str'}, + 'view_charges': {'key': 'properties.viewCharges', 'type': 'str'}, + } + + def __init__(self, *, marketplace_purchases=None, reservation_purchases=None, view_charges=None, **kwargs) -> None: + super(Policy, self).__init__(**kwargs) + self.marketplace_purchases = marketplace_purchases + self.reservation_purchases = reservation_purchases + self.view_charges = view_charges diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product.py new file mode 100644 index 000000000000..b3375dd6e300 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product.py @@ -0,0 +1,154 @@ +# 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 Product(Resource): + """A product 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_display_name: Invoice section display name to which + this product belongs. + :vartype invoice_section_display_name: str + :ivar billing_profile_id: Billing Profile id to which this product + belongs. + :vartype billing_profile_id: str + :ivar billing_profile_display_name: Billing Profile display name to which + this product belongs. + :vartype billing_profile_display_name: str + :ivar customer_id: Customer id to which this product belongs. + :vartype customer_id: str + :ivar customer_display_name: Display name of customer to which this + product belongs. + :vartype customer_display_name: str + :ivar reseller: Reseller for this product. + :vartype reseller: ~azure.mgmt.billing.models.Reseller + """ + + _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_display_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, + 'customer_id': {'readonly': True}, + 'customer_display_name': {'readonly': True}, + 'reseller': {'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_display_name': {'key': 'properties.invoiceSectionDisplayName', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, + 'customer_id': {'key': 'properties.customerId', 'type': 'str'}, + 'customer_display_name': {'key': 'properties.customerDisplayName', 'type': 'str'}, + 'reseller': {'key': 'properties.reseller', 'type': 'Reseller'}, + } + + def __init__(self, **kwargs): + super(Product, 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_display_name = None + self.billing_profile_id = None + self.billing_profile_display_name = None + self.customer_id = None + self.customer_display_name = None + self.reseller = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_details.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_details.py new file mode 100644 index 000000000000..5a2e7d3c3453 --- /dev/null +++ b/sdk/billing/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 product 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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_details_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_details_py3.py new file mode 100644 index 000000000000..c5810331f74a --- /dev/null +++ b/sdk/billing/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 product 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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_paged.py similarity index 71% rename from sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_paged.py rename to sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_paged.py index 500bcafab923..ba946bdaee1c 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_paged.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class InvoicePaged(Paged): +class ProductPaged(Paged): """ - A paging container for iterating over a list of :class:`Invoice ` object + A paging container for iterating over a list of :class:`Product ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Invoice]'} + 'current_page': {'key': 'value', 'type': '[Product]'} } def __init__(self, *args, **kwargs): - super(InvoicePaged, self).__init__(*args, **kwargs) + super(ProductPaged, self).__init__(*args, **kwargs) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_py3.py new file mode 100644 index 000000000000..3b9d423c1f6d --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_py3.py @@ -0,0 +1,154 @@ +# 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 Product(Resource): + """A product 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_display_name: Invoice section display name to which + this product belongs. + :vartype invoice_section_display_name: str + :ivar billing_profile_id: Billing Profile id to which this product + belongs. + :vartype billing_profile_id: str + :ivar billing_profile_display_name: Billing Profile display name to which + this product belongs. + :vartype billing_profile_display_name: str + :ivar customer_id: Customer id to which this product belongs. + :vartype customer_id: str + :ivar customer_display_name: Display name of customer to which this + product belongs. + :vartype customer_display_name: str + :ivar reseller: Reseller for this product. + :vartype reseller: ~azure.mgmt.billing.models.Reseller + """ + + _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_display_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, + 'customer_id': {'readonly': True}, + 'customer_display_name': {'readonly': True}, + 'reseller': {'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_display_name': {'key': 'properties.invoiceSectionDisplayName', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, + 'customer_id': {'key': 'properties.customerId', 'type': 'str'}, + 'customer_display_name': {'key': 'properties.customerDisplayName', 'type': 'str'}, + 'reseller': {'key': 'properties.reseller', 'type': 'Reseller'}, + } + + def __init__(self, *, status=None, billing_frequency=None, **kwargs) -> None: + super(Product, 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_display_name = None + self.billing_profile_id = None + self.billing_profile_display_name = None + self.customer_id = None + self.customer_display_name = None + self.reseller = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result.py new file mode 100644 index 000000000000..2d6fe9c52f56 --- /dev/null +++ b/sdk/billing/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. 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. + :vartype value: list[~azure.mgmt.billing.models.Product] + :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': '[Product]'}, + '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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/products_list_result_py3.py new file mode 100644 index 000000000000..9eb9cce28107 --- /dev/null +++ b/sdk/billing/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. 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. + :vartype value: list[~azure.mgmt.billing.models.Product] + :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': '[Product]'}, + '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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py new file mode 100644 index 000000000000..294905389363 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.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. +# -------------------------------------------------------------------------- + +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 reseller_id: Reseller Id for transfer. + :vartype reseller_id: str + :ivar reseller_name: Reseller name for transfer. + :vartype reseller_name: str + :ivar initiator_customer_type: Customer type of the initiator. + :vartype initiator_customer_type: str + :ivar canceled_by: Email Id who user canceled the transfer. + :vartype canceled_by: str + :ivar last_modified_time: Transfer last modification time. + :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}, + 'reseller_id': {'readonly': True}, + 'reseller_name': {'readonly': True}, + 'initiator_customer_type': {'readonly': True}, + 'canceled_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'detailed_transfer_status': {'readonly': True}, + } + + _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'}, + 'reseller_id': {'key': 'properties.resellerId', 'type': 'str'}, + 'reseller_name': {'key': 'properties.resellerName', 'type': 'str'}, + 'initiator_customer_type': {'key': 'properties.initiatorCustomerType', 'type': 'str'}, + 'canceled_by': {'key': 'properties.canceledBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'detailed_transfer_status': {'key': 'properties.detailedTransferStatus', 'type': '[DetailedTransferStatus]'}, + } + + 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.reseller_id = None + self.reseller_name = None + self.initiator_customer_type = None + self.canceled_by = None + self.last_modified_time = None + self.detailed_transfer_status = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_paged.py new file mode 100644 index 000000000000..28cd6d360efd --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py new file mode 100644 index 000000000000..189d600f1e12 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.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. +# -------------------------------------------------------------------------- + +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 reseller_id: Reseller Id for transfer. + :vartype reseller_id: str + :ivar reseller_name: Reseller name for transfer. + :vartype reseller_name: str + :ivar initiator_customer_type: Customer type of the initiator. + :vartype initiator_customer_type: str + :ivar canceled_by: Email Id who user canceled the transfer. + :vartype canceled_by: str + :ivar last_modified_time: Transfer last modification time. + :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}, + 'reseller_id': {'readonly': True}, + 'reseller_name': {'readonly': True}, + 'initiator_customer_type': {'readonly': True}, + 'canceled_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'detailed_transfer_status': {'readonly': True}, + } + + _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'}, + 'reseller_id': {'key': 'properties.resellerId', 'type': 'str'}, + 'reseller_name': {'key': 'properties.resellerName', 'type': 'str'}, + 'initiator_customer_type': {'key': 'properties.initiatorCustomerType', 'type': 'str'}, + 'canceled_by': {'key': 'properties.canceledBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'detailed_transfer_status': {'key': 'properties.detailedTransferStatus', 'type': '[DetailedTransferStatus]'}, + } + + 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.reseller_id = None + self.reseller_name = None + self.initiator_customer_type = None + self.canceled_by = None + self.last_modified_time = None + self.detailed_transfer_status = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/reseller.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/reseller.py new file mode 100644 index 000000000000..2e2362939ba8 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/reseller.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 Reseller(Model): + """Details about a reseller. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar reseller_id: The reseller id. + :vartype reseller_id: str + :ivar description: A description of the reseller. + :vartype description: str + """ + + _validation = { + 'reseller_id': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'reseller_id': {'key': 'resellerId', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Reseller, self).__init__(**kwargs) + self.reseller_id = None + self.description = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/reseller_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/reseller_py3.py new file mode 100644 index 000000000000..42ef09d210de --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/reseller_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 Reseller(Model): + """Details about a reseller. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar reseller_id: The reseller id. + :vartype reseller_id: str + :ivar description: A description of the reseller. + :vartype description: str + """ + + _validation = { + 'reseller_id': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'reseller_id': {'key': 'resellerId', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Reseller, self).__init__(**kwargs) + self.reseller_id = None + self.description = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/resource.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/resource.py index ff02c012b072..246fb19f8a1a 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/resource.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/resource.py @@ -38,8 +38,8 @@ class Resource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/resource_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/resource_py3.py new file mode 100644 index 000000000000..b4cf9627c55d --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/resource_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 Resource(Model): + """The Resource model definition. + + 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 + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction.py new file mode 100644 index 000000000000..8eae5338e46e --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction.py @@ -0,0 +1,147 @@ +# 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 Transaction(Resource): + """A reservation transaction 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_family: The product family. + :vartype product_family: 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_display_name: Invoice section display name to which + this product belongs. + :vartype invoice_section_display_name: str + :ivar billing_profile_id: Billing Profile id to which this product + belongs. + :vartype billing_profile_id: str + :ivar billing_profile_display_name: Billing Profile display name to which + this product belongs. + :vartype billing_profile_display_name: str + :ivar customer_id: Customer id to which this product belongs. + :vartype customer_id: str + :ivar customer_display_name: Display name of customer to which this + product belongs. + :vartype customer_display_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_family': {'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_display_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, + 'customer_id': {'readonly': True}, + 'customer_display_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_family': {'key': 'properties.productFamily', '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_display_name': {'key': 'properties.invoiceSectionDisplayName', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, + 'customer_id': {'key': 'properties.customerId', 'type': 'str'}, + 'customer_display_name': {'key': 'properties.customerDisplayName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Transaction, 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_family = 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_display_name = None + self.billing_profile_id = None + self.billing_profile_display_name = None + self.customer_id = None + self.customer_display_name = None + self.subscription_id = None + self.subscription_name = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_list_result.py new file mode 100644 index 000000000000..62d79a0def5a --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_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 TransactionListResult(Model): + """Result of listing reservation transactions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of reservation transactions. + :vartype value: list[~azure.mgmt.billing.models.Transaction] + :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': '[Transaction]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TransactionListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_list_result_py3.py new file mode 100644 index 000000000000..efc812413471 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_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 TransactionListResult(Model): + """Result of listing reservation transactions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of reservation transactions. + :vartype value: list[~azure.mgmt.billing.models.Transaction] + :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': '[Transaction]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TransactionListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_paged.py new file mode 100644 index 000000000000..47c6c3c8ac54 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_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 TransactionPaged(Paged): + """ + A paging container for iterating over a list of :class:`Transaction ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Transaction]'} + } + + def __init__(self, *args, **kwargs): + + super(TransactionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_py3.py new file mode 100644 index 000000000000..84a620180c84 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transaction_py3.py @@ -0,0 +1,147 @@ +# 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 Transaction(Resource): + """A reservation transaction 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_family: The product family. + :vartype product_family: 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_display_name: Invoice section display name to which + this product belongs. + :vartype invoice_section_display_name: str + :ivar billing_profile_id: Billing Profile id to which this product + belongs. + :vartype billing_profile_id: str + :ivar billing_profile_display_name: Billing Profile display name to which + this product belongs. + :vartype billing_profile_display_name: str + :ivar customer_id: Customer id to which this product belongs. + :vartype customer_id: str + :ivar customer_display_name: Display name of customer to which this + product belongs. + :vartype customer_display_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_family': {'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_display_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_display_name': {'readonly': True}, + 'customer_id': {'readonly': True}, + 'customer_display_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_family': {'key': 'properties.productFamily', '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_display_name': {'key': 'properties.invoiceSectionDisplayName', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_display_name': {'key': 'properties.billingProfileDisplayName', 'type': 'str'}, + 'customer_id': {'key': 'properties.customerId', 'type': 'str'}, + 'customer_display_name': {'key': 'properties.customerDisplayName', '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(Transaction, self).__init__(**kwargs) + self.kind = kind + self.date_property = None + self.invoice = None + self.order_id = None + self.order_name = None + self.product_family = 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_display_name = None + self.billing_profile_id = None + self.billing_profile_display_name = None + self.customer_id = None + self.customer_display_name = None + self.subscription_id = None + self.subscription_name = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py new file mode 100644 index 000000000000..3100b66a0a12 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_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 TransferBillingSubscriptionRequest(Model): + """Request parameters to transfer billing subscription. + + :param destination_invoice_section_id: The destination invoice section id. + :type destination_invoice_section_id: str + :param destination_billing_profile_id: The destination billing profile id. + :type destination_billing_profile_id: str + """ + + _attribute_map = { + 'destination_invoice_section_id': {'key': 'properties.destinationInvoiceSectionId', 'type': 'str'}, + 'destination_billing_profile_id': {'key': 'properties.destinationBillingProfileId', '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_billing_profile_id = kwargs.get('destination_billing_profile_id', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py new file mode 100644 index 000000000000..9d103278db5d --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.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 TransferBillingSubscriptionRequestProperties(Model): + """Request parameters to transfer billing subscription. + + :param destination_invoice_section_id: The destination invoice section id. + :type destination_invoice_section_id: str + :param destination_billing_profile_id: The destination billing profile id. + :type destination_billing_profile_id: str + """ + + _attribute_map = { + 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, + 'destination_billing_profile_id': {'key': 'destinationBillingProfileId', '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_billing_profile_id = kwargs.get('destination_billing_profile_id', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py new file mode 100644 index 000000000000..d364d1d807be --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_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 TransferBillingSubscriptionRequestProperties(Model): + """Request parameters to transfer billing subscription. + + :param destination_invoice_section_id: The destination invoice section id. + :type destination_invoice_section_id: str + :param destination_billing_profile_id: The destination billing profile id. + :type destination_billing_profile_id: str + """ + + _attribute_map = { + 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, + 'destination_billing_profile_id': {'key': 'destinationBillingProfileId', 'type': 'str'}, + } + + def __init__(self, *, destination_invoice_section_id: str=None, destination_billing_profile_id: str=None, **kwargs) -> None: + super(TransferBillingSubscriptionRequestProperties, self).__init__(**kwargs) + self.destination_invoice_section_id = destination_invoice_section_id + self.destination_billing_profile_id = destination_billing_profile_id diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py new file mode 100644 index 000000000000..77edcf3ac1aa --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_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 TransferBillingSubscriptionRequest(Model): + """Request parameters to transfer billing subscription. + + :param destination_invoice_section_id: The destination invoice section id. + :type destination_invoice_section_id: str + :param destination_billing_profile_id: The destination billing profile id. + :type destination_billing_profile_id: str + """ + + _attribute_map = { + 'destination_invoice_section_id': {'key': 'properties.destinationInvoiceSectionId', 'type': 'str'}, + 'destination_billing_profile_id': {'key': 'properties.destinationBillingProfileId', 'type': 'str'}, + } + + def __init__(self, *, destination_invoice_section_id: str=None, destination_billing_profile_id: str=None, **kwargs) -> None: + super(TransferBillingSubscriptionRequest, self).__init__(**kwargs) + self.destination_invoice_section_id = destination_invoice_section_id + self.destination_billing_profile_id = destination_billing_profile_id diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result.py new file mode 100644 index 000000000000..a606c5260389 --- /dev/null +++ b/sdk/billing/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_name: The destination billing subscription id. + :type billing_subscription_name: str + """ + + _attribute_map = { + 'billing_subscription_name': {'key': 'properties.billingSubscriptionName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TransferBillingSubscriptionResult, self).__init__(**kwargs) + self.billing_subscription_name = kwargs.get('billing_subscription_name', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_result_py3.py new file mode 100644 index 000000000000..116dbe42cef3 --- /dev/null +++ b/sdk/billing/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_name: The destination billing subscription id. + :type billing_subscription_name: str + """ + + _attribute_map = { + 'billing_subscription_name': {'key': 'properties.billingSubscriptionName', 'type': 'str'}, + } + + def __init__(self, *, billing_subscription_name: str=None, **kwargs) -> None: + super(TransferBillingSubscriptionResult, self).__init__(**kwargs) + self.billing_subscription_name = billing_subscription_name diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py new file mode 100644 index 000000000000..736d836b3b48 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.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. +# -------------------------------------------------------------------------- + +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 section Id. + :vartype invoice_section_id: str + :ivar billing_account_id: Target billing account Id. + :vartype billing_account_id: str + :ivar reseller_id: Reseller Id for transfer. + :vartype reseller_id: str + :ivar reseller_name: Reseller name for transfer. + :vartype reseller_name: str + :ivar initiator_customer_type: Customer type of the initiator. + :vartype initiator_customer_type: str + :ivar billing_profile_id: Target billing profile Id. + :vartype billing_profile_id: str + :ivar transfer_status: Overall transfer status. Possible values include: + '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}, + 'reseller_id': {'readonly': True}, + 'reseller_name': {'readonly': True}, + 'initiator_customer_type': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'transfer_status': {'readonly': True}, + 'recipient_email_id': {'readonly': True}, + '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'}, + 'reseller_id': {'key': 'properties.resellerId', 'type': 'str'}, + 'reseller_name': {'key': 'properties.resellerName', 'type': 'str'}, + 'initiator_customer_type': {'key': 'properties.initiatorCustomerType', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'transfer_status': {'key': 'properties.transferStatus', 'type': 'str'}, + 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, + '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.reseller_id = None + self.reseller_name = None + self.initiator_customer_type = None + self.billing_profile_id = None + self.transfer_status = None + self.recipient_email_id = None + self.initiator_email_id = None + self.canceled_by = None + self.last_modified_time = None + self.detailed_transfer_status = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_paged.py new file mode 100644 index 000000000000..868739480a54 --- /dev/null +++ b/sdk/billing/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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py new file mode 100644 index 000000000000..c2f092c861c0 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.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. +# -------------------------------------------------------------------------- + +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 section Id. + :vartype invoice_section_id: str + :ivar billing_account_id: Target billing account Id. + :vartype billing_account_id: str + :ivar reseller_id: Reseller Id for transfer. + :vartype reseller_id: str + :ivar reseller_name: Reseller name for transfer. + :vartype reseller_name: str + :ivar initiator_customer_type: Customer type of the initiator. + :vartype initiator_customer_type: str + :ivar billing_profile_id: Target billing profile Id. + :vartype billing_profile_id: str + :ivar transfer_status: Overall transfer status. Possible values include: + '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}, + 'reseller_id': {'readonly': True}, + 'reseller_name': {'readonly': True}, + 'initiator_customer_type': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'transfer_status': {'readonly': True}, + 'recipient_email_id': {'readonly': True}, + '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'}, + 'reseller_id': {'key': 'properties.resellerId', 'type': 'str'}, + 'reseller_name': {'key': 'properties.resellerName', 'type': 'str'}, + 'initiator_customer_type': {'key': 'properties.initiatorCustomerType', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'transfer_status': {'key': 'properties.transferStatus', 'type': 'str'}, + 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, + '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.reseller_id = None + self.reseller_name = None + self.initiator_customer_type = None + self.billing_profile_id = None + self.transfer_status = None + self.recipient_email_id = None + self.initiator_email_id = None + self.canceled_by = None + self.last_modified_time = None + self.detailed_transfer_status = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py new file mode 100644 index 000000000000..c697a28aee13 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.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 TransferProductRequestProperties(Model): + """The properties of the product to initiate a transfer. + + :param destination_invoice_section_id: The destination invoice section id. + :type destination_invoice_section_id: str + :param destination_billing_profile_id: The destination billing profile id. + :type destination_billing_profile_id: str + """ + + _attribute_map = { + 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, + 'destination_billing_profile_id': {'key': 'destinationBillingProfileId', '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_billing_profile_id = kwargs.get('destination_billing_profile_id', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py new file mode 100644 index 000000000000..f819e622f7e0 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_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 TransferProductRequestProperties(Model): + """The properties of the product to initiate a transfer. + + :param destination_invoice_section_id: The destination invoice section id. + :type destination_invoice_section_id: str + :param destination_billing_profile_id: The destination billing profile id. + :type destination_billing_profile_id: str + """ + + _attribute_map = { + 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, + 'destination_billing_profile_id': {'key': 'destinationBillingProfileId', 'type': 'str'}, + } + + def __init__(self, *, destination_invoice_section_id: str=None, destination_billing_profile_id: str=None, **kwargs) -> None: + super(TransferProductRequestProperties, self).__init__(**kwargs) + self.destination_invoice_section_id = destination_invoice_section_id + self.destination_billing_profile_id = destination_billing_profile_id diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation.py new file mode 100644 index 000000000000..50984bf843c8 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation.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 UpdateAutoRenewOperation(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(UpdateAutoRenewOperation, self).__init__(**kwargs) + self.end_date = kwargs.get('end_date', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_py3.py new file mode 100644 index 000000000000..8a3f6622fcb0 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_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 UpdateAutoRenewOperation(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(UpdateAutoRenewOperation, self).__init__(**kwargs) + self.end_date = end_date diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request.py new file mode 100644 index 000000000000..80db81d894c6 --- /dev/null +++ b/sdk/billing/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 product. + + :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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_request_py3.py new file mode 100644 index 000000000000..5f99c7657109 --- /dev/null +++ b/sdk/billing/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 product. + + :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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response.py new file mode 100644 index 000000000000..2ec17fe1e0c6 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ValidateAddressResponse(Model): + """Result of the address validation. + + :param status: status of the address validation. Possible values include: + 'Valid', 'Invalid' + :type status: str or ~azure.mgmt.billing.models.AddressValidationStatus + :param suggested_addresses: list of suggested addresses. + :type suggested_addresses: list[~azure.mgmt.billing.models.AddressDetails] + :param validation_message: Validation error message. + :type validation_message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'suggested_addresses': {'key': 'suggestedAddresses', 'type': '[AddressDetails]'}, + 'validation_message': {'key': 'validationMessage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ValidateAddressResponse, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.suggested_addresses = kwargs.get('suggested_addresses', None) + self.validation_message = kwargs.get('validation_message', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response_py3.py new file mode 100644 index 000000000000..8fb0a294a607 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ValidateAddressResponse(Model): + """Result of the address validation. + + :param status: status of the address validation. Possible values include: + 'Valid', 'Invalid' + :type status: str or ~azure.mgmt.billing.models.AddressValidationStatus + :param suggested_addresses: list of suggested addresses. + :type suggested_addresses: list[~azure.mgmt.billing.models.AddressDetails] + :param validation_message: Validation error message. + :type validation_message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'suggested_addresses': {'key': 'suggestedAddresses', 'type': '[AddressDetails]'}, + 'validation_message': {'key': 'validationMessage', 'type': 'str'}, + } + + def __init__(self, *, status=None, suggested_addresses=None, validation_message: str=None, **kwargs) -> None: + super(ValidateAddressResponse, self).__init__(**kwargs) + self.status = status + self.suggested_addresses = suggested_addresses + self.validation_message = validation_message diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_product_transfer_eligibility_error.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_product_transfer_eligibility_error.py new file mode 100644 index 000000000000..020f0bb1b2a2 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_product_transfer_eligibility_error.py @@ -0,0 +1,42 @@ +# 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 ValidateProductTransferEligibilityError(Model): + """Error details of the product transfer eligibility validation. + + :param code: Error code for the product transfer validation. Possible + values include: 'InvalidSource', 'ProductNotActive', + 'InsufficientPermissionOnSource', 'InsufficientPermissionOnDestination', + 'DestinationBillingProfilePastDue', 'ProductTypeNotSupported', + 'CrossBillingAccountNotAllowed', 'NotAvailableForDestinationMarket', + 'OneTimePurchaseProductTransferNotAllowed' + :type code: str or + ~azure.mgmt.billing.models.ProductTransferValidationErrorCode + :param message: The error message. + :type message: str + :param details: Detailed error message explaining the error. + :type details: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ValidateProductTransferEligibilityError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_product_transfer_eligibility_error_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_product_transfer_eligibility_error_py3.py new file mode 100644 index 000000000000..d30e8ee13908 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_product_transfer_eligibility_error_py3.py @@ -0,0 +1,42 @@ +# 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 ValidateProductTransferEligibilityError(Model): + """Error details of the product transfer eligibility validation. + + :param code: Error code for the product transfer validation. Possible + values include: 'InvalidSource', 'ProductNotActive', + 'InsufficientPermissionOnSource', 'InsufficientPermissionOnDestination', + 'DestinationBillingProfilePastDue', 'ProductTypeNotSupported', + 'CrossBillingAccountNotAllowed', 'NotAvailableForDestinationMarket', + 'OneTimePurchaseProductTransferNotAllowed' + :type code: str or + ~azure.mgmt.billing.models.ProductTransferValidationErrorCode + :param message: The error message. + :type message: str + :param details: Detailed error message explaining the error. + :type details: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'str'}, + } + + def __init__(self, *, code=None, message: str=None, details: str=None, **kwargs) -> None: + super(ValidateProductTransferEligibilityError, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_product_transfer_eligibility_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_product_transfer_eligibility_result.py new file mode 100644 index 000000000000..9523d690342c --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_product_transfer_eligibility_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 ValidateProductTransferEligibilityResult(Model): + """Result of the product transfer eligibility validation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar is_transfer_eligible: Specifies whether the transfer is eligible or + not. + :vartype is_transfer_eligible: bool + :param error_details: Validation error details. + :type error_details: + ~azure.mgmt.billing.models.ValidateProductTransferEligibilityError + """ + + _validation = { + 'is_transfer_eligible': {'readonly': True}, + } + + _attribute_map = { + 'is_transfer_eligible': {'key': 'isTransferEligible', 'type': 'bool'}, + 'error_details': {'key': 'errorDetails', 'type': 'ValidateProductTransferEligibilityError'}, + } + + def __init__(self, **kwargs): + super(ValidateProductTransferEligibilityResult, self).__init__(**kwargs) + self.is_transfer_eligible = None + self.error_details = kwargs.get('error_details', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_product_transfer_eligibility_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_product_transfer_eligibility_result_py3.py new file mode 100644 index 000000000000..c369e6170046 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_product_transfer_eligibility_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 ValidateProductTransferEligibilityResult(Model): + """Result of the product transfer eligibility validation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar is_transfer_eligible: Specifies whether the transfer is eligible or + not. + :vartype is_transfer_eligible: bool + :param error_details: Validation error details. + :type error_details: + ~azure.mgmt.billing.models.ValidateProductTransferEligibilityError + """ + + _validation = { + 'is_transfer_eligible': {'readonly': True}, + } + + _attribute_map = { + 'is_transfer_eligible': {'key': 'isTransferEligible', 'type': 'bool'}, + 'error_details': {'key': 'errorDetails', 'type': 'ValidateProductTransferEligibilityError'}, + } + + def __init__(self, *, error_details=None, **kwargs) -> None: + super(ValidateProductTransferEligibilityResult, self).__init__(**kwargs) + self.is_transfer_eligible = None + self.error_details = error_details diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_subscription_transfer_eligibility_error.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_subscription_transfer_eligibility_error.py new file mode 100644 index 000000000000..c1f1645580e0 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_subscription_transfer_eligibility_error.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 ValidateSubscriptionTransferEligibilityError(Model): + """Error details of the transfer eligibility validation. + + :param code: Error code for the product transfer validation. Possible + values include: 'InvalidSource', 'SubscriptionNotActive', + 'InsufficientPermissionOnSource', 'InsufficientPermissionOnDestination', + 'DestinationBillingProfilePastDue', 'SubscriptionTypeNotSupported', + 'CrossBillingAccountNotAllowed', 'NotAvailableForDestinationMarket' + :type code: str or + ~azure.mgmt.billing.models.SubscriptionTransferValidationErrorCode + :param message: The error message. + :type message: str + :param details: Detailed error message explaining the error. + :type details: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ValidateSubscriptionTransferEligibilityError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_subscription_transfer_eligibility_error_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_subscription_transfer_eligibility_error_py3.py new file mode 100644 index 000000000000..c866f4bba0c0 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_subscription_transfer_eligibility_error_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 ValidateSubscriptionTransferEligibilityError(Model): + """Error details of the transfer eligibility validation. + + :param code: Error code for the product transfer validation. Possible + values include: 'InvalidSource', 'SubscriptionNotActive', + 'InsufficientPermissionOnSource', 'InsufficientPermissionOnDestination', + 'DestinationBillingProfilePastDue', 'SubscriptionTypeNotSupported', + 'CrossBillingAccountNotAllowed', 'NotAvailableForDestinationMarket' + :type code: str or + ~azure.mgmt.billing.models.SubscriptionTransferValidationErrorCode + :param message: The error message. + :type message: str + :param details: Detailed error message explaining the error. + :type details: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'str'}, + } + + def __init__(self, *, code=None, message: str=None, details: str=None, **kwargs) -> None: + super(ValidateSubscriptionTransferEligibilityError, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_subscription_transfer_eligibility_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_subscription_transfer_eligibility_result.py new file mode 100644 index 000000000000..6e2cec88f059 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_subscription_transfer_eligibility_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 ValidateSubscriptionTransferEligibilityResult(Model): + """Result of the transfer eligibility validation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar is_transfer_eligible: Specifies whether the transfer is eligible or + not. + :vartype is_transfer_eligible: bool + :param error_details: Validation error details. + :type error_details: + ~azure.mgmt.billing.models.ValidateSubscriptionTransferEligibilityError + """ + + _validation = { + 'is_transfer_eligible': {'readonly': True}, + } + + _attribute_map = { + 'is_transfer_eligible': {'key': 'isTransferEligible', 'type': 'bool'}, + 'error_details': {'key': 'errorDetails', 'type': 'ValidateSubscriptionTransferEligibilityError'}, + } + + def __init__(self, **kwargs): + super(ValidateSubscriptionTransferEligibilityResult, self).__init__(**kwargs) + self.is_transfer_eligible = None + self.error_details = kwargs.get('error_details', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_subscription_transfer_eligibility_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_subscription_transfer_eligibility_result_py3.py new file mode 100644 index 000000000000..c45765e323b6 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_subscription_transfer_eligibility_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 ValidateSubscriptionTransferEligibilityResult(Model): + """Result of the transfer eligibility validation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar is_transfer_eligible: Specifies whether the transfer is eligible or + not. + :vartype is_transfer_eligible: bool + :param error_details: Validation error details. + :type error_details: + ~azure.mgmt.billing.models.ValidateSubscriptionTransferEligibilityError + """ + + _validation = { + 'is_transfer_eligible': {'readonly': True}, + } + + _attribute_map = { + 'is_transfer_eligible': {'key': 'isTransferEligible', 'type': 'bool'}, + 'error_details': {'key': 'errorDetails', 'type': 'ValidateSubscriptionTransferEligibilityError'}, + } + + def __init__(self, *, error_details=None, **kwargs) -> None: + super(ValidateSubscriptionTransferEligibilityResult, self).__init__(**kwargs) + self.is_transfer_eligible = None + self.error_details = error_details diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_transfer_list_response.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_transfer_list_response.py new file mode 100644 index 000000000000..29704a4e055c --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_transfer_list_response.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 ValidateTransferListResponse(Model): + """Result of transfer validation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of transfer validation results. + :vartype value: list[~azure.mgmt.billing.models.ValidateTransferResponse] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ValidateTransferResponse]'}, + } + + def __init__(self, **kwargs): + super(ValidateTransferListResponse, self).__init__(**kwargs) + self.value = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_transfer_list_response_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_transfer_list_response_py3.py new file mode 100644 index 000000000000..88e2f5588148 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_transfer_list_response_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 ValidateTransferListResponse(Model): + """Result of transfer validation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of transfer validation results. + :vartype value: list[~azure.mgmt.billing.models.ValidateTransferResponse] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ValidateTransferResponse]'}, + } + + def __init__(self, **kwargs) -> None: + super(ValidateTransferListResponse, self).__init__(**kwargs) + self.value = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_transfer_response.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_transfer_response.py new file mode 100644 index 000000000000..6d7006eb04db --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_transfer_response.py @@ -0,0 +1,44 @@ +# 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 ValidateTransferResponse(Model): + """Transfer validation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The status of validation + :vartype status: str + :ivar product_id: The product id for which this result applies. + :vartype product_id: str + :param results: Array of validation results. + :type results: list[~azure.mgmt.billing.models.ValidationResultProperties] + """ + + _validation = { + 'status': {'readonly': True}, + 'product_id': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'properties.status', 'type': 'str'}, + 'product_id': {'key': 'properties.productId', 'type': 'str'}, + 'results': {'key': 'properties.results', 'type': '[ValidationResultProperties]'}, + } + + def __init__(self, **kwargs): + super(ValidateTransferResponse, self).__init__(**kwargs) + self.status = None + self.product_id = None + self.results = kwargs.get('results', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_transfer_response_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_transfer_response_py3.py new file mode 100644 index 000000000000..f9b2c97ab9f1 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_transfer_response_py3.py @@ -0,0 +1,44 @@ +# 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 ValidateTransferResponse(Model): + """Transfer validation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The status of validation + :vartype status: str + :ivar product_id: The product id for which this result applies. + :vartype product_id: str + :param results: Array of validation results. + :type results: list[~azure.mgmt.billing.models.ValidationResultProperties] + """ + + _validation = { + 'status': {'readonly': True}, + 'product_id': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'properties.status', 'type': 'str'}, + 'product_id': {'key': 'properties.productId', 'type': 'str'}, + 'results': {'key': 'properties.results', 'type': '[ValidationResultProperties]'}, + } + + def __init__(self, *, results=None, **kwargs) -> None: + super(ValidateTransferResponse, self).__init__(**kwargs) + self.status = None + self.product_id = None + self.results = results diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validation_result_properties.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validation_result_properties.py new file mode 100644 index 000000000000..b9085ac85ca6 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validation_result_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 ValidationResultProperties(Model): + """The properties of the validation result. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar level: Result Level. + :vartype level: str + :ivar code: Result Code. + :vartype code: str + :ivar message: The validation message. + :vartype message: str + """ + + _validation = { + 'level': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ValidationResultProperties, self).__init__(**kwargs) + self.level = None + self.code = None + self.message = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validation_result_properties_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validation_result_properties_py3.py new file mode 100644 index 000000000000..0ecc612d4219 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validation_result_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 ValidationResultProperties(Model): + """The properties of the validation result. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar level: Result Level. + :vartype level: str + :ivar code: Result Code. + :vartype code: str + :ivar message: The validation message. + :vartype message: str + """ + + _validation = { + 'level': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ValidationResultProperties, self).__init__(**kwargs) + self.level = None + self.code = None + self.message = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py index c3d1d198514e..b2620e729e34 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py @@ -9,14 +9,58 @@ # regenerated. # -------------------------------------------------------------------------- +from .billing_accounts_operations import BillingAccountsOperations +from .payment_methods_operations import PaymentMethodsOperations +from .address_operations import AddressOperations +from .available_balances_operations import AvailableBalancesOperations +from .billing_profiles_operations import BillingProfilesOperations +from .customers_operations import CustomersOperations +from .invoice_sections_operations import InvoiceSectionsOperations +from .billing_permissions_operations import BillingPermissionsOperations +from .billing_subscriptions_operations import BillingSubscriptionsOperations +from .products_operations import ProductsOperations +from .transactions_operations import TransactionsOperations +from .departments_operations import DepartmentsOperations from .enrollment_accounts_operations import EnrollmentAccountsOperations -from .billing_periods_operations import BillingPeriodsOperations from .invoices_operations import InvoicesOperations +from .price_sheet_operations import PriceSheetOperations +from .policies_operations import PoliciesOperations +from .billing_property_operations import BillingPropertyOperations +from .transfers_operations import TransfersOperations +from .partner_transfers_operations import PartnerTransfersOperations +from .partner_transfers_transfers_operations import PartnerTransfersTransfersOperations +from .recipient_transfers_operations import RecipientTransfersOperations from .operations import Operations +from .billing_role_definitions_operations import BillingRoleDefinitionsOperations +from .billing_role_assignments_operations import BillingRoleAssignmentsOperations +from .agreements_operations import AgreementsOperations +from .line_of_credits_operations import LineOfCreditsOperations __all__ = [ + 'BillingAccountsOperations', + 'PaymentMethodsOperations', + 'AddressOperations', + 'AvailableBalancesOperations', + 'BillingProfilesOperations', + 'CustomersOperations', + 'InvoiceSectionsOperations', + 'BillingPermissionsOperations', + 'BillingSubscriptionsOperations', + 'ProductsOperations', + 'TransactionsOperations', + 'DepartmentsOperations', 'EnrollmentAccountsOperations', - 'BillingPeriodsOperations', 'InvoicesOperations', + 'PriceSheetOperations', + 'PoliciesOperations', + 'BillingPropertyOperations', + 'TransfersOperations', + 'PartnerTransfersOperations', + 'PartnerTransfersTransfersOperations', + 'RecipientTransfersOperations', 'Operations', + 'BillingRoleDefinitionsOperations', + 'BillingRoleAssignmentsOperations', + 'AgreementsOperations', + 'LineOfCreditsOperations', ] diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/address_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/address_operations.py new file mode 100644 index 000000000000..8406fa17e200 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/address_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 AddressOperations(object): + """AddressOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def validate( + self, address, custom_headers=None, raw=False, **operation_config): + """Validates the address. + + :param address: + :type address: ~azure.mgmt.billing.models.AddressDetails + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ValidateAddressResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.ValidateAddressResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.validate.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(address, 'AddressDetails') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ValidateAddressResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + validate.metadata = {'url': '/providers/Microsoft.Billing/validateAddress'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/agreements_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/agreements_operations.py new file mode 100644 index 000000000000..e7be5dd5737e --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/agreements_operations.py @@ -0,0 +1,162 @@ +# 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 AgreementsOperations(object): + """AgreementsOperations 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 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def list_by_billing_account( + self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all agreements for a billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param expand: May be used to expand the participants. + :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: AgreementListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.AgreementListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_billing_account.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') + 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('AgreementListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements'} + + def get( + self, billing_account_name, agreement_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the agreement by name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param agreement_name: Agreement Id. + :type agreement_name: str + :param expand: May be used to expand the participants. + :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: Agreement or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.Agreement 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'), + 'agreementName': self._serialize.url("agreement_name", agreement_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Agreement', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements/{agreementName}'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/available_balances_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/available_balances_operations.py new file mode 100644 index 000000000000..69b543cd0b1d --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/available_balances_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 AvailableBalancesOperations(object): + """AvailableBalancesOperations 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 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def get_by_billing_profile( + 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 + :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_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/availableBalance/default'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py new file mode 100644 index 000000000000..f7fb5e9c1e21 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py @@ -0,0 +1,253 @@ +# 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 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 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-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 address, 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_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the billing account by id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param expand: May be used to expand the address, invoiceSections and + billingProfiles. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :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 = { + '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') + 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/{billingAccountName}'} + + + def _update_initial( + self, billing_account_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.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, 'BillingAccountUpdateRequest') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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 + + def update( + self, billing_account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to update a billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param parameters: Request parameters supplied to the update billing + account operation. + :type parameters: + ~azure.mgmt.billing.models.BillingAccountUpdateRequest + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BillingAccount or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.BillingAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.BillingAccount]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._update_initial( + billing_account_name=billing_account_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('BillingAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + 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/{billingAccountName}'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_periods_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_periods_operations.py deleted file mode 100644 index 7f382587610d..000000000000 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_periods_operations.py +++ /dev/null @@ -1,184 +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['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 and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, 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['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 and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, 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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py new file mode 100644 index 000000000000..c3c62b317396 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py @@ -0,0 +1,277 @@ +# 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 BillingPermissionsOperations(object): + """BillingPermissionsOperations 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 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def list_by_customer( + self, billing_account_name, customer_name, custom_headers=None, raw=False, **operation_config): + """Lists all billing permissions the caller has for a customer. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param customer_name: Customer name. + :type customer_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingPermissionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingPermissionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_customer.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'customerName': self._serialize.url("customer_name", customer_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_by_customer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingPermissions'} + + def list_by_billing_account( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """Lists all billing permissions for the caller under 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_by_billing_account.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_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingPermissions'} + + def list_by_invoice_sections( + self, billing_account_name, billing_profile_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Lists all billing permissions for the caller under invoice section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param dict custom_headers: headers that will be added to the request + :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_by_invoice_sections.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # 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_by_invoice_sections.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingPermissions'} + + def list_by_billing_profile( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """Lists all billing permissions 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_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingPermissions'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py new file mode 100644 index 000000000000..ebb175f0ca2c --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py @@ -0,0 +1,385 @@ +# 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 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def list_by_billing_account( + 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_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 + :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_by_billing_account.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') + 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_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles'} + + def get( + self, billing_account_name, billing_profile_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the billing profile by id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param expand: May be used to expand the invoiceSections. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingProfile or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingProfile or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingProfile', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}'} + + + def _create_initial( + self, billing_account_name, billing_profile_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + '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, 'BillingProfileCreationRequest') + + # 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': 'int', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def create( + self, billing_account_name, billing_profile_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to create a BillingProfile. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param parameters: Request parameters supplied to the Create + BillingProfile operation. + :type parameters: + ~azure.mgmt.billing.models.BillingProfileCreationRequest + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :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._create_initial( + billing_account_name=billing_account_name, + billing_profile_name=billing_profile_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + } + 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) + create.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}'} + + + def _update_initial( + 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 = { + '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, 'BillingProfile') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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_name, billing_profile_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to update 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 parameters: Request parameters supplied to the update billing + profile operation. + :type parameters: ~azure.mgmt.billing.models.BillingProfile + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + 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_name=billing_account_name, + billing_profile_name=billing_profile_name, + 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/{billingAccountName}/billingProfiles/{billingProfileName}'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_property_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_property_operations.py new file mode 100644 index 000000000000..8af44a766c15 --- /dev/null +++ b/sdk/billing/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 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py new file mode 100644 index 000000000000..eccbd21f94bc --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py @@ -0,0 +1,814 @@ +# 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 BillingRoleAssignmentsOperations(object): + """BillingRoleAssignmentsOperations 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 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def get_by_billing_account( + 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_by_billing_account.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_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}'} + + def delete_by_billing_account( + 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_by_billing_account.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_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}'} + + def get_by_invoice_section( + self, billing_account_name, billing_profile_name, invoice_section_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignment for the caller on the invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_role_assignment_name: role assignment id. + :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_by_invoice_section.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + } + 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_by_invoice_section.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}'} + + def delete_by_invoice_section( + self, billing_account_name, billing_profile_name, invoice_section_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Delete the role assignment on the invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_role_assignment_name: role assignment id. + :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_by_invoice_section.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + } + 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_by_invoice_section.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}'} + + def get_by_billing_profile( + 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_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + '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_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}'} + + def delete_by_billing_profile( + 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_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + '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_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}'} + + def list_by_billing_account( + 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_by_billing_account.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_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments'} + + def add_by_billing_account( + self, billing_account_name, principal_id=None, billing_role_definition_id=None, custom_headers=None, raw=False, **operation_config): + """The operation to add a role assignment to a billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param principal_id: The user's principal id that the role gets + assigned to + :type principal_id: str + :param billing_role_definition_id: The role definition id + :type billing_role_definition_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: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.BillingRoleAssignmentPayload(principal_id=principal_id, billing_role_definition_id=billing_role_definition_id) + + # Construct URL + url = self.add_by_billing_account.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_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/createBillingRoleAssignment'} + + def list_by_invoice_section( + self, billing_account_name, billing_profile_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignments on the invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param dict custom_headers: headers that will be added to the request + :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_by_invoice_section.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # 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_by_invoice_section.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments'} + + def add_by_invoice_section( + self, billing_account_name, billing_profile_name, invoice_section_name, principal_id=None, billing_role_definition_id=None, custom_headers=None, raw=False, **operation_config): + """The operation to add a role assignment to a invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param principal_id: The user's principal id that the role gets + assigned to + :type principal_id: str + :param billing_role_definition_id: The role definition id + :type billing_role_definition_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: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.BillingRoleAssignmentPayload(principal_id=principal_id, billing_role_definition_id=billing_role_definition_id) + + # Construct URL + url = self.add_by_invoice_section.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # 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_by_invoice_section.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/createBillingRoleAssignment'} + + def list_by_billing_profile( + 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_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments'} + + def add_by_billing_profile( + self, billing_account_name, billing_profile_name, principal_id=None, billing_role_definition_id=None, custom_headers=None, raw=False, **operation_config): + """The operation to add a role assignment to a 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 principal_id: The user's principal id that the role gets + assigned to + :type principal_id: str + :param billing_role_definition_id: The role definition id + :type billing_role_definition_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: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.BillingRoleAssignmentPayload(principal_id=principal_id, billing_role_definition_id=billing_role_definition_id) + + # Construct URL + url = self.add_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/createBillingRoleAssignment'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_definitions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_definitions_operations.py new file mode 100644 index 000000000000..672f2831ad61 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_definitions_operations.py @@ -0,0 +1,409 @@ +# 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 BillingRoleDefinitionsOperations(object): + """BillingRoleDefinitionsOperations 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 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def get_by_billing_account( + 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_by_billing_account.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_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/{billingRoleDefinitionName}'} + + def get_by_invoice_section( + self, billing_account_name, billing_profile_name, invoice_section_name, billing_role_definition_name, custom_headers=None, raw=False, **operation_config): + """Gets the role definition for a role. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_role_definition_name: role definition id. + :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_by_invoice_section.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingRoleDefinitionName': self._serialize.url("billing_role_definition_name", billing_role_definition_name, 'str') + } + 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_by_invoice_section.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/{billingRoleDefinitionName}'} + + def get_by_billing_profile( + 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_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + '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_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions/{billingRoleDefinitionName}'} + + def list_by_billing_account( + 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_by_billing_account.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_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions'} + + def list_by_invoice_section( + self, billing_account_name, billing_profile_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Lists the role definition for an invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param dict custom_headers: headers that will be added to the request + :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_by_invoice_section.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # 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_by_invoice_section.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions'} + + def list_by_billing_profile( + 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_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_operations.py new file mode 100644 index 000000000000..18a590aa5ca7 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_operations.py @@ -0,0 +1,631 @@ +# 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 BillingSubscriptionsOperations(object): + """BillingSubscriptionsOperations 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 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def list_by_customer( + self, billing_account_name, customer_name, custom_headers=None, raw=False, **operation_config): + """Lists billing subscription by customer id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param customer_name: Customer name. + :type customer_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of BillingSubscription + :rtype: + ~azure.mgmt.billing.models.BillingSubscriptionPaged[~azure.mgmt.billing.models.BillingSubscription] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_customer.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'customerName': self._serialize.url("customer_name", customer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.BillingSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BillingSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_customer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingSubscriptions'} + + def get_by_customer( + self, billing_account_name, customer_name, billing_subscription_name, custom_headers=None, raw=False, **operation_config): + """Get a single billing subscription by id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param customer_name: Customer name. + :type customer_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingSubscription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingSubscription or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_customer.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'customerName': self._serialize.url("customer_name", customer_name, 'str'), + 'billingSubscriptionName': self._serialize.url("billing_subscription_name", billing_subscription_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('BillingSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_customer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingSubscriptions/{billingSubscriptionName}'} + + def list_by_billing_account( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """Lists billing subscriptions by billing account name. + + :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: An iterator like instance of BillingSubscription + :rtype: + ~azure.mgmt.billing.models.BillingSubscriptionPaged[~azure.mgmt.billing.models.BillingSubscription] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_billing_account.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.BillingSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BillingSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions'} + + def list_by_billing_profile( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """Lists billing subscriptions by billing profile name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param 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_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingSubscriptions'} + + def list_by_invoice_section( + self, billing_account_name, billing_profile_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Lists billing subscription by invoice section name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param dict custom_headers: headers that will be added to the request + :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_by_invoice_section.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # 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_by_invoice_section.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions'} + + def get( + self, billing_account_name, billing_profile_name, invoice_section_name, billing_subscription_name, custom_headers=None, raw=False, **operation_config): + """Get a single billing subscription by name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_subscription_name: Billing Subscription Id. + :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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingSubscription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingSubscription or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingSubscriptionName': self._serialize.url("billing_subscription_name", billing_subscription_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('BillingSubscription', 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}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}'} + + + def _transfer_initial( + self, billing_account_name, billing_profile_name, invoice_section_name, billing_subscription_name, destination_invoice_section_id=None, destination_billing_profile_id=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TransferBillingSubscriptionRequestProperties(destination_invoice_section_id=destination_invoice_section_id, destination_billing_profile_id=destination_billing_profile_id) + + # Construct URL + url = self.transfer.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingSubscriptionName': self._serialize.url("billing_subscription_name", billing_subscription_name, 'str') + } + 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', + } + + 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_name, billing_profile_name, invoice_section_name, billing_subscription_name, destination_invoice_section_id=None, destination_billing_profile_id=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Transfers the subscription from one invoice section to another within a + billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_subscription_name: Billing Subscription Id. + :type billing_subscription_name: str + :param destination_invoice_section_id: The destination invoice section + id. + :type destination_invoice_section_id: str + :param destination_billing_profile_id: The destination billing profile + id. + :type destination_billing_profile_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + 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_name=billing_account_name, + billing_profile_name=billing_profile_name, + invoice_section_name=invoice_section_name, + billing_subscription_name=billing_subscription_name, + destination_invoice_section_id=destination_invoice_section_id, + destination_billing_profile_id=destination_billing_profile_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + } + deserialized = self._deserialize('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/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/transfer'} + + def validate_transfer( + self, billing_account_name, billing_profile_name, invoice_section_name, billing_subscription_name, destination_invoice_section_id=None, destination_billing_profile_id=None, custom_headers=None, raw=False, **operation_config): + """Validates the transfer of billing subscriptions across invoice + sections. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_subscription_name: Billing Subscription Id. + :type billing_subscription_name: str + :param destination_invoice_section_id: The destination invoice section + id. + :type destination_invoice_section_id: str + :param destination_billing_profile_id: The destination billing profile + id. + :type destination_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: ValidateSubscriptionTransferEligibilityResult or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.billing.models.ValidateSubscriptionTransferEligibilityResult + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.TransferBillingSubscriptionRequestProperties(destination_invoice_section_id=destination_invoice_section_id, destination_billing_profile_id=destination_billing_profile_id) + + # Construct URL + url = self.validate_transfer.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingSubscriptionName': self._serialize.url("billing_subscription_name", billing_subscription_name, 'str') + } + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ValidateSubscriptionTransferEligibilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + validate_transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/validateTransferEligibility'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/customers_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/customers_operations.py new file mode 100644 index 000000000000..ab3de9481969 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/customers_operations.py @@ -0,0 +1,258 @@ +# 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 CustomersOperations(object): + """CustomersOperations 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 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def list_by_billing_profile( + self, billing_account_name, billing_profile_name, filter=None, skiptoken=None, custom_headers=None, raw=False, **operation_config): + """Lists customers by billing profile which the current user can work with + on-behalf of a partner. + + :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 filter: May be used to filter the list of customers. + :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 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 Customer + :rtype: + ~azure.mgmt.billing.models.CustomerPaged[~azure.mgmt.billing.models.Customer] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + 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') + + 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.CustomerPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.CustomerPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers'} + + def list_by_billing_account( + self, billing_account_name, filter=None, skiptoken=None, custom_headers=None, raw=False, **operation_config): + """Lists customers which the current user can work with on-behalf of a + partner. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param filter: May be used to filter the list of customers. + :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 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 Customer + :rtype: + ~azure.mgmt.billing.models.CustomerPaged[~azure.mgmt.billing.models.Customer] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_billing_account.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') + 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') + + 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.CustomerPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.CustomerPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers'} + + def get( + self, billing_account_name, customer_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets a customer by its id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param customer_name: Customer name. + :type customer_name: str + :param expand: May be used to expand enabledAzurePlans, resellers. + :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: Customer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.Customer 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'), + 'customerName': self._serialize.url("customer_name", customer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Customer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py new file mode 100644 index 000000000000..20a0c90af6b7 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/departments_operations.py @@ -0,0 +1,176 @@ +# 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 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def list_by_billing_account_name( + 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_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 + '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_by_billing_account_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + 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_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments'} + + def get( + 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_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 + '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 = { + '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) + + # 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/{billingAccountName}/departments/{departmentName}'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py index 071d1ce3c75c..89ac4d1e7f8b 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_operations.py @@ -22,7 +22,7 @@ class EnrollmentAccountsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-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 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -32,76 +32,93 @@ 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 = "2019-10-01-preview" self.config = config - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists the enrollment accounts the caller has access to. - + def list_by_billing_account_name( + 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_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 + '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 EnrollmentAccount - :rtype: - ~azure.mgmt.billing.models.EnrollmentAccountPaged[~azure.mgmt.billing.models.EnrollmentAccount] + :return: EnrollmentAccountListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.EnrollmentAccountListResult or + ~msrest.pipeline.ClientRawResponse :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') + # Construct URL + url = self.list_by_billing_account_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) - else: - url = next_link - query_parameters = {} + # 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['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 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) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + # 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) + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) - return response + deserialized = None - # Deserialize response - deserialized = models.EnrollmentAccountPaged(internal_paging, self._deserialize.dependencies) + if response.status_code == 200: + deserialized = self._deserialize('EnrollmentAccountListResult', response) if raw: - header_dict = {} - client_raw_response = models.EnrollmentAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) 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 + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts'} + + def get_by_enrollment_account_id( + 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_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 + '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 @@ -114,19 +131,24 @@ def get( :class:`ErrorResponseException` """ # Construct URL - url = self.get.metadata['url'] + url = self.get_by_enrollment_account_id.metadata['url'] path_format_arguments = { - 'name': self._serialize.url("name", name, '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) # 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['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -135,8 +157,8 @@ def get( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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) @@ -151,4 +173,4 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Billing/enrollmentAccounts/{name}'} + get_by_enrollment_account_id.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py new file mode 100644 index 000000000000..681939b435e7 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py @@ -0,0 +1,445 @@ +# 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 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def list_by_billing_profile( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """Lists all invoice sections for a user which he has access to. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: InvoiceSectionListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceSectionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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('InvoiceSectionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections'} + + def get( + self, billing_account_name, billing_profile_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Get the InvoiceSection by id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: 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 = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}'} + + + def _create_initial( + self, billing_account_name, billing_profile_name, invoice_section_name, display_name=None, custom_headers=None, raw=False, **operation_config): + parameters = models.InvoiceSectionCreationRequest(display_name=display_name) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'InvoiceSectionCreationRequest') + + # Construct and send request + request = self._client.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': 'int', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def create( + self, billing_account_name, billing_profile_name, invoice_section_name, display_name=None, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to create an invoice section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param display_name: The name of the InvoiceSection. + :type display_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns InvoiceSection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.InvoiceSection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.InvoiceSection]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_initial( + billing_account_name=billing_account_name, + billing_profile_name=billing_profile_name, + invoice_section_name=invoice_section_name, + display_name=display_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + } + deserialized = self._deserialize('InvoiceSection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}'} + + + def _update_initial( + self, billing_account_name, billing_profile_name, invoice_section_name, display_name=None, custom_headers=None, raw=False, **operation_config): + parameters = models.InvoiceSection(display_name=display_name) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # 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.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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_name, billing_profile_name, invoice_section_name, display_name=None, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to update a InvoiceSection. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param display_name: The name of the InvoiceSection. + :type display_name: str + :param 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_name=billing_account_name, + billing_profile_name=billing_profile_name, + invoice_section_name=invoice_section_name, + display_name=display_name, + 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/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}'} + + def elevate_to_billing_profile( + self, billing_account_name, billing_profile_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Elevates the caller's access to match their billing profile access. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.elevate_to_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + 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 [204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + elevate_to_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/elevate'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py index e56ced653ad8..06ba09c882da 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py @@ -22,7 +22,7 @@ class InvoicesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-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 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -32,141 +32,113 @@ 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 = "2019-10-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 + def list_by_billing_account( + 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_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. + :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: An iterator like instance of Invoice - :rtype: - ~azure.mgmt.billing.models.InvoicePaged[~azure.mgmt.billing.models.Invoice] + :return: InvoiceListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceListResult or + ~msrest.pipeline.ClientRawResponse :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['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 and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, 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) + # Construct URL + url = self.list_by_billing_account.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') + 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: - header_dict = {} - client_raw_response = models.InvoicePaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) 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 + list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices'} + + def list_by_billing_profile( + 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_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. + :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: Invoice or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.billing.models.Invoice or + :return: InvoiceListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceListResult or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.get.metadata['url'] + url = self.list_by_billing_profile.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') + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['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['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -175,8 +147,8 @@ def get( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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) @@ -184,23 +156,25 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Invoice', response) + deserialized = self._deserialize('InvoiceListResult', 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. + list_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices'} + def get( + self, billing_account_name, billing_profile_name, invoice_name, custom_headers=None, raw=False, **operation_config): + """Get the invoice by name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_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 deserialized response @@ -213,9 +187,11 @@ def get_latest( :class:`ErrorResponseException` """ # Construct URL - url = self.get_latest.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_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) @@ -225,7 +201,7 @@ def get_latest( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -234,8 +210,8 @@ def get_latest( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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) @@ -250,4 +226,4 @@ def get_latest( return client_raw_response return deserialized - get_latest.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/invoices/latest'} + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py new file mode 100644 index 000000000000..a12de7c70440 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py @@ -0,0 +1,202 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class LineOfCreditsOperations(object): + """LineOfCreditsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def get( + self, custom_headers=None, raw=False, **operation_config): + """Get the current line of credit. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LineOfCredit or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.LineOfCredit or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LineOfCredit', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingAccounts/default/lineOfCredit/default'} + + + def _update_initial( + self, credit_limit=None, status=None, custom_headers=None, raw=False, **operation_config): + parameters = models.LineOfCredit(credit_limit=credit_limit, status=status) + + # Construct URL + url = self.update.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' + 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, 'LineOfCredit') + + # 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('LineOfCredit', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def update( + self, credit_limit=None, status=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Increase the current line of credit. + + :param credit_limit: The current credit limit. + :type credit_limit: ~azure.mgmt.billing.models.Amount + :param status: The line of credit status. Possible values include: + 'Approved', 'Rejected' + :type status: str or ~azure.mgmt.billing.models.Status + :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 LineOfCredit or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.LineOfCredit] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.LineOfCredit]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._update_initial( + credit_limit=credit_limit, + status=status, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + } + deserialized = self._deserialize('LineOfCredit', 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': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingAccounts/default/lineOfCredit/default'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py index 5d38dd4b2ce2..7beab7125226 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2018-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 2019-10-01-preview. Constant value: "2019-10-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-03-01-preview" + self.api_version = "2019-10-01-preview" self.config = config @@ -67,7 +67,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -76,9 +76,8 @@ def internal_paging(next_link=None, raw=False): 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) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/partner_transfers_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/partner_transfers_operations.py new file mode 100644 index 000000000000..9d1bbc10f077 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/partner_transfers_operations.py @@ -0,0 +1,237 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class PartnerTransfersOperations(object): + """PartnerTransfersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def initiate( + self, billing_account_name, billing_profile_name, customer_name, recipient_email_id=None, reseller_id=None, custom_headers=None, raw=False, **operation_config): + """Initiates the request to transfer the legacy subscriptions or RIs. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param customer_name: Customer name. + :type customer_name: str + :param recipient_email_id: Email Id of recipient for transfer. + :type recipient_email_id: str + :param reseller_id: Optional reseller Id for transfer. + :type reseller_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.InitiateTransferRequest(recipient_email_id=recipient_email_id, reseller_id=reseller_id) + + # Construct URL + url = self.initiate.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'customerName': self._serialize.url("customer_name", customer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'InitiateTransferRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransferDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + initiate.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/initiateTransfer'} + + def get( + self, billing_account_name, billing_profile_name, customer_name, transfer_name, custom_headers=None, raw=False, **operation_config): + """Gets the transfer details for given transfer Id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param customer_name: Customer name. + :type customer_name: str + :param transfer_name: Transfer Name. + :type transfer_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'customerName': self._serialize.url("customer_name", customer_name, 'str'), + 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransferDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/transfers/{transferName}'} + + def cancel( + self, billing_account_name, billing_profile_name, customer_name, transfer_name, custom_headers=None, raw=False, **operation_config): + """Cancels the transfer for given transfer Id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param customer_name: Customer name. + :type customer_name: str + :param transfer_name: Transfer Name. + :type transfer_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.cancel.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'customerName': self._serialize.url("customer_name", customer_name, 'str'), + 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransferDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + cancel.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/transfers/{transferName}'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/partner_transfers_transfers_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/partner_transfers_transfers_operations.py new file mode 100644 index 000000000000..98cd89aa354d --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/partner_transfers_transfers_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class PartnerTransfersTransfersOperations(object): + """PartnerTransfersTransfersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def list( + self, billing_account_name, billing_profile_name, customer_name, custom_headers=None, raw=False, **operation_config): + """Lists all transfer's details initiated from given invoice section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param customer_name: Customer name. + :type customer_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TransferDetails + :rtype: + ~azure.mgmt.billing.models.TransferDetailsPaged[~azure.mgmt.billing.models.TransferDetails] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'customerName': self._serialize.url("customer_name", customer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.TransferDetailsPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TransferDetailsPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/transfers'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_operations.py new file mode 100644 index 000000000000..8ca3cd614c60 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/payment_methods_operations.py @@ -0,0 +1,170 @@ +# 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 PaymentMethodsOperations(object): + """PaymentMethodsOperations 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 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def list_by_billing_account( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """Lists the Payment Methods by billing account Id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :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_by_billing_account.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.PaymentMethodPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PaymentMethodPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/paymentMethods'} + + def list_by_billing_profile( + 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_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: 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_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.PaymentMethodPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PaymentMethodPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/paymentMethods'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/policies_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/policies_operations.py new file mode 100644 index 000000000000..09b579225e90 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/policies_operations.py @@ -0,0 +1,163 @@ +# 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 PoliciesOperations(object): + """PoliciesOperations 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 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def get_by_billing_profile( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """The policy for a given billing account name and billing profile name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param 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 = { + '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('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/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default'} + + def update( + self, billing_account_name, billing_profile_name, parameters, custom_headers=None, raw=False, **operation_config): + """The operation to update a policy. + + :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 policy operation. + :type parameters: ~azure.mgmt.billing.models.Policy + :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.update.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + 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/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py new file mode 100644 index 000000000000..dfb35b938cd7 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py @@ -0,0 +1,251 @@ +# 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 PriceSheetOperations(object): + """PriceSheetOperations 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 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + + def _download_initial( + self, billing_account_name, billing_profile_name, invoice_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.download.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceName': self._serialize.url("invoice_name", invoice_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('DownloadUrl', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + 'OData-EntityId': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def download( + self, billing_account_name, billing_profile_name, invoice_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Download price sheet for an invoice. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_name: Invoice Id. + :type invoice_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + 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_name=billing_account_name, + billing_profile_name=billing_profile_name, + 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', + '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/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}/pricesheet/default/download'} + + + def _download_by_billing_profile_initial( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.download_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('DownloadUrl', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + 'OData-EntityId': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def download_by_billing_profile( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Download price sheet for a billing profile. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DownloadUrl or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.DownloadUrl] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.DownloadUrl]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._download_by_billing_profile_initial( + billing_account_name=billing_account_name, + billing_profile_name=billing_profile_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + 'OData-EntityId': 'str', + } + deserialized = self._deserialize('DownloadUrl', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + download_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/pricesheet/default/download'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py new file mode 100644 index 000000000000..807af14a13ff --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py @@ -0,0 +1,682 @@ +# 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 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def list_by_customer( + self, billing_account_name, customer_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists products by customer id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param customer_name: Customer name. + :type customer_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 + 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_by_customer.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'customerName': self._serialize.url("customer_name", customer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if 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_by_customer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/products'} + + def get_by_customer( + self, billing_account_name, customer_name, product_name, custom_headers=None, raw=False, **operation_config): + """Get a customer's product by name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param customer_name: Customer name. + :type customer_name: str + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Product or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.Product or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_customer.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'customerName': self._serialize.url("customer_name", customer_name, '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('Product', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_customer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/products/{productName}'} + + def list_by_billing_account( + self, billing_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists products by billing account name. + + :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 + 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 Product + :rtype: + ~azure.mgmt.billing.models.ProductPaged[~azure.mgmt.billing.models.Product] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_billing_account.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') + 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.ProductPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ProductPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products'} + + def list_by_invoice_section( + self, billing_account_name, billing_profile_name, invoice_section_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists products by invoice section name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param filter: May be used to filter by product type. The filter + 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_by_invoice_section.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # 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_by_invoice_section.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products'} + + def get( + self, billing_account_name, billing_profile_name, invoice_section_name, product_name, custom_headers=None, raw=False, **operation_config): + """Get a single product by name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param product_name: Invoice Id. + :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: Product or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.Product or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + '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('Product', 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}/invoiceSections/{invoiceSectionName}/products/{productName}'} + + def transfer( + self, billing_account_name, billing_profile_name, invoice_section_name, product_name, destination_invoice_section_id=None, destination_billing_profile_id=None, custom_headers=None, raw=False, **operation_config): + """The operation to transfer a Product to another invoice section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param product_name: Invoice Id. + :type product_name: str + :param destination_invoice_section_id: The destination invoice section + id. + :type destination_invoice_section_id: str + :param destination_billing_profile_id: The destination billing profile + id. + :type destination_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: Product or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.Product or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.TransferProductRequestProperties(destination_invoice_section_id=destination_invoice_section_id, destination_billing_profile_id=destination_billing_profile_id) + + # Construct URL + url = self.transfer.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + '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('Product', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products/{productName}/transfer'} + + def validate_transfer( + self, billing_account_name, billing_profile_name, invoice_section_name, product_name, destination_invoice_section_id=None, destination_billing_profile_id=None, custom_headers=None, raw=False, **operation_config): + """Validates the transfer of products across invoice sections. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param product_name: Invoice Id. + :type product_name: str + :param destination_invoice_section_id: The destination invoice section + id. + :type destination_invoice_section_id: str + :param destination_billing_profile_id: The destination billing profile + id. + :type destination_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: ValidateProductTransferEligibilityResult or ClientRawResponse + if raw=true + :rtype: + ~azure.mgmt.billing.models.ValidateProductTransferEligibilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.TransferProductRequestProperties(destination_invoice_section_id=destination_invoice_section_id, destination_billing_profile_id=destination_billing_profile_id) + + # Construct URL + url = self.validate_transfer.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'productName': self._serialize.url("product_name", product_name, 'str') + } + 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, '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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ValidateProductTransferEligibilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + validate_transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products/{productName}/validateTransferEligibility'} + + def update_auto_renew_by_billing_account( + self, billing_account_name, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): + """Cancel auto renew for product by product id and billing account name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :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' + :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: UpdateAutoRenewOperation or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.UpdateAutoRenewOperation or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + body = models.UpdateAutoRenewRequest(auto_renew=auto_renew) + + # Construct URL + url = self.update_auto_renew_by_billing_account.metadata['url'] + path_format_arguments = { + '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) + + # 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('UpdateAutoRenewOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_auto_renew_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/updateAutoRenew'} + + def update_auto_renew_by_invoice_section( + self, billing_account_name, billing_profile_name, invoice_section_name, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): + """Cancel auto renew for product by product id and invoice section name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param product_name: Invoice Id. + :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: UpdateAutoRenewOperation or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.UpdateAutoRenewOperation or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + body = models.UpdateAutoRenewRequest(auto_renew=auto_renew) + + # Construct URL + url = self.update_auto_renew_by_invoice_section.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'productName': self._serialize.url("product_name", product_name, 'str') + } + 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('UpdateAutoRenewOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_auto_renew_by_invoice_section.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products/{productName}/updateAutoRenew'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py new file mode 100644 index 000000000000..f1fbb6eb99cf --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py @@ -0,0 +1,334 @@ +# 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 RecipientTransfersOperations(object): + """RecipientTransfersOperations 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 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` + """ + parameters = 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(parameters, '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 validate( + self, transfer_name, product_details=None, custom_headers=None, raw=False, **operation_config): + """Validates if the products can be transferred in the context of the + given transfer name. + + :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: ValidateTransferListResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.ValidateTransferListResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.AcceptTransferRequest(product_details=product_details) + + # Construct URL + url = self.validate.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(parameters, '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('ValidateTransferListResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + validate.metadata = {'url': '/providers/Microsoft.Billing/transfers/{transferName}/validateTransfer'} + + 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'} + + 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/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py new file mode 100644 index 000000000000..f9b162903961 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py @@ -0,0 +1,418 @@ +# 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 TransactionsOperations(object): + """TransactionsOperations 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 2019-10-01-preview. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def list_by_customer( + self, billing_account_name, customer_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the transactions by customer id for given start date and end + date. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param customer_name: Customer name. + :type customer_name: str + :param start_date: Start date + :type start_date: str + :param end_date: End date + :type end_date: str + :param filter: May be used to filter by transaction kind. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Transaction + :rtype: + ~azure.mgmt.billing.models.TransactionPaged[~azure.mgmt.billing.models.Transaction] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_customer.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'customerName': self._serialize.url("customer_name", customer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + 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.TransactionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TransactionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_customer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/transactions'} + + def list_by_billing_account( + self, billing_account_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the transactions by billing account name for given start and end + date. + + :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 + :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 Transaction + :rtype: + ~azure.mgmt.billing.models.TransactionPaged[~azure.mgmt.billing.models.Transaction] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_billing_account.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') + 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.TransactionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TransactionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_billing_account.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/transactions'} + + def list_by_billing_profile( + self, billing_account_name, billing_profile_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the transactions by billing profile name for given start date and + end date. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param 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: TransactionListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransactionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_billing_profile.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransactionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_billing_profile.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/transactions'} + + def list_by_invoice_section( + self, billing_account_name, billing_profile_name, invoice_section_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the transactions by invoice section name for given start date and + end date. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param start_date: Start date + :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: TransactionListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransactionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_invoice_section.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # 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('TransactionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_invoice_section.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transactions'} + + def get( + self, billing_account_name, billing_profile_name, transaction_name, start_date, end_date, custom_headers=None, raw=False, **operation_config): + """Get the transaction. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param transaction_name: Transaction name. + :type transaction_name: str + :param start_date: Start date + :type start_date: str + :param end_date: End date + :type end_date: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Transaction or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.Transaction or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + 'transactionName': self._serialize.url("transaction_name", transaction_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Transaction', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/transactions/{transactionName}'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py new file mode 100644 index 000000000000..d9d1ac6c0c87 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py @@ -0,0 +1,307 @@ +# 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 initiate( + self, billing_account_name, billing_profile_name, invoice_section_name, recipient_email_id=None, reseller_id=None, custom_headers=None, raw=False, **operation_config): + """Initiates the request to transfer the legacy subscriptions or RIs. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param recipient_email_id: Email Id of recipient for transfer. + :type recipient_email_id: str + :param reseller_id: Optional reseller Id for transfer. + :type reseller_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.InitiateTransferRequest(recipient_email_id=recipient_email_id, reseller_id=reseller_id) + + # Construct URL + url = self.initiate.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + '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(parameters, 'InitiateTransferRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransferDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + initiate.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/initiateTransfer'} + + def get( + self, billing_account_name, billing_profile_name, invoice_section_name, transfer_name, custom_headers=None, raw=False, **operation_config): + """Gets the transfer details for given transfer Id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param transfer_name: Transfer Name. + :type transfer_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + '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}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}'} + + def cancel( + self, billing_account_name, billing_profile_name, invoice_section_name, transfer_name, custom_headers=None, raw=False, **operation_config): + """Cancels the transfer for given transfer Id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param transfer_name: Transfer Name. + :type transfer_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.cancel.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + '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}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}'} + + def list( + self, billing_account_name, billing_profile_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Lists all transfer's details initiated from given invoice section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TransferDetails + :rtype: + ~azure.mgmt.billing.models.TransferDetailsPaged[~azure.mgmt.billing.models.TransferDetails] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + '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}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/version.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/version.py index 9bd1dfac7ecb..3e682bbd5fb1 100644 --- a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/version.py +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.2.0" +VERSION = "0.3.0" diff --git a/sdk/billing/azure-mgmt-billing/setup.py b/sdk/billing/azure-mgmt-billing/setup.py index f1e8b973210f..4672b0c8abd6 100644 --- a/sdk/billing/azure-mgmt-billing/setup.py +++ b/sdk/billing/azure-mgmt-billing/setup.py @@ -64,7 +64,6 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7',