diff --git a/sdk/billing/azure-mgmt-billing/HISTORY.rst b/sdk/billing/azure-mgmt-billing/HISTORY.rst new file mode 100644 index 000000000000..8924d5d6c445 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (1970-01-01) +++++++++++++++++++ + +* Initial Release diff --git a/sdk/billing/azure-mgmt-billing/MANIFEST.in b/sdk/billing/azure-mgmt-billing/MANIFEST.in new file mode 100644 index 000000000000..e4884efef41b --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include tests *.py *.yaml +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/sdk/billing/azure-mgmt-billing/README.rst b/sdk/billing/azure-mgmt-billing/README.rst new file mode 100644 index 000000000000..6b85fb2289e3 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/README.rst @@ -0,0 +1,33 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure MyService Management 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. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Usage +===== + +For code examples, see `MyService Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-billing%2FREADME.png diff --git a/sdk/billing/azure-mgmt-billing/azure/__init__.py b/sdk/billing/azure-mgmt-billing/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/__init__.py new file mode 100644 index 000000000000..e66d83da6d0e --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .billing_management_client import BillingManagementClient +from .version import VERSION + +__all__ = ['BillingManagementClient'] + +__version__ = VERSION + 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 new file mode 100644 index 000000000000..d04e5f0d8297 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/billing_management_client.py @@ -0,0 +1,191 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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.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.billing_accounts_validate_address_operations import BillingAccountsValidateAddressOperations +from .operations.available_balances_operations import AvailableBalancesOperations +from .operations.billing_profiles_operations import BillingProfilesOperations +from .operations.invoice_sections_operations import InvoiceSectionsOperations +from .operations.departments_operations import DepartmentsOperations +from .operations.enrollment_accounts_operations import EnrollmentAccountsOperations +from .operations.invoices_operations import InvoicesOperations +from .operations.price_sheet_operations import PriceSheetOperations +from .operations.billing_subscriptions_operations import BillingSubscriptionsOperations +from .operations.products_operations import ProductsOperations +from .operations.transactions_operations import TransactionsOperations +from .operations.policies_operations import PoliciesOperations +from .operations.billing_property_operations import BillingPropertyOperations +from .operations.transfers_operations import TransfersOperations +from .operations.recipient_transfers_operations import RecipientTransfersOperations +from .operations.operations import Operations +from .operations.billing_permissions_operations import BillingPermissionsOperations +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 + + +class BillingManagementClientConfiguration(AzureConfiguration): + """Configuration for BillingManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Azure Subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(BillingManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-billing/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +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 billing_accounts_validate_address: BillingAccountsValidateAddress operations + :vartype billing_accounts_validate_address: azure.mgmt.billing.operations.BillingAccountsValidateAddressOperations + :ivar available_balances: AvailableBalances operations + :vartype available_balances: azure.mgmt.billing.operations.AvailableBalancesOperations + :ivar billing_profiles: BillingProfiles operations + :vartype billing_profiles: azure.mgmt.billing.operations.BillingProfilesOperations + :ivar invoice_sections: InvoiceSections operations + :vartype invoice_sections: azure.mgmt.billing.operations.InvoiceSectionsOperations + :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 invoices: Invoices operations + :vartype invoices: azure.mgmt.billing.operations.InvoicesOperations + :ivar price_sheet: PriceSheet operations + :vartype price_sheet: azure.mgmt.billing.operations.PriceSheetOperations + :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 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 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_permissions: BillingPermissions operations + :vartype billing_permissions: azure.mgmt.billing.operations.BillingPermissionsOperations + :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 + object` + :param subscription_id: Azure Subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = BillingManagementClientConfiguration(credentials, subscription_id, base_url) + super(BillingManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-11-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + 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.billing_accounts_validate_address = BillingAccountsValidateAddressOperations( + self._client, self.config, self._serialize, self._deserialize) + self.available_balances = AvailableBalancesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_profiles = BillingProfilesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invoice_sections = InvoiceSectionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.departments = DepartmentsOperations( + self._client, self.config, self._serialize, self._deserialize) + 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.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.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.recipient_transfers = RecipientTransfersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.billing_permissions = BillingPermissionsOperations( + 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 new file mode 100644 index 000000000000..b61f94ae0772 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/__init__.py @@ -0,0 +1,247 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from .initiate_transfer_request_py3 import InitiateTransferRequest + from .address_py3 import Address + from .validate_address_response_py3 import ValidateAddressResponse + from .product_details_py3 import ProductDetails + from .accept_transfer_request_py3 import AcceptTransferRequest + from .error_py3 import Error + 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 .update_auto_renew_operation_summary_py3 import UpdateAutoRenewOperationSummary + from .enabled_azure_sk_us_py3 import EnabledAzureSKUs + from .billing_profile_py3 import BillingProfile + from .invoice_section_properties_py3 import InvoiceSectionProperties + from .invoice_section_py3 import InvoiceSection + from .enrollment_policies_py3 import EnrollmentPolicies + from .enrollment_py3 import Enrollment + from .enrollment_account_py3 import EnrollmentAccount + from .department_py3 import Department + from .billing_account_py3 import BillingAccount + from .billing_account_list_result_py3 import BillingAccountListResult + from .billing_property_py3 import BillingProperty + from .department_list_result_py3 import DepartmentListResult + from .enrollment_account_list_result_py3 import EnrollmentAccountListResult + from .billing_profile_list_result_py3 import BillingProfileListResult + from .invoice_section_list_result_py3 import InvoiceSectionListResult + from .operation_status_py3 import OperationStatus + from .download_url_py3 import DownloadUrl + from .error_details_py3 import ErrorDetails + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .resource_py3 import Resource + from .amount_py3 import Amount + from .download_properties_py3 import DownloadProperties + from .payment_properties_py3 import PaymentProperties + from .invoice_summary_py3 import InvoiceSummary + from .invoice_list_result_py3 import InvoiceListResult + from .product_summary_py3 import ProductSummary + from .products_list_result_py3 import ProductsListResult + from .billing_subscription_summary_py3 import BillingSubscriptionSummary + from .billing_subscriptions_list_result_py3 import BillingSubscriptionsListResult + from .enrollment_account_context_py3 import EnrollmentAccountContext + from .transactions_summary_py3 import TransactionsSummary + from .transactions_list_result_py3 import TransactionsListResult + from .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 .line_of_credit_py3 import LineOfCredit +except (SyntaxError, ImportError): + from .initiate_transfer_request import InitiateTransferRequest + from .address import Address + from .validate_address_response import ValidateAddressResponse + from .product_details import ProductDetails + from .accept_transfer_request import AcceptTransferRequest + from .error import Error + 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 .update_auto_renew_operation_summary import UpdateAutoRenewOperationSummary + from .enabled_azure_sk_us import EnabledAzureSKUs + from .billing_profile import BillingProfile + from .invoice_section_properties import InvoiceSectionProperties + from .invoice_section import InvoiceSection + from .enrollment_policies import EnrollmentPolicies + from .enrollment import Enrollment + from .enrollment_account import EnrollmentAccount + from .department import Department + from .billing_account import BillingAccount + from .billing_account_list_result import BillingAccountListResult + from .billing_property import BillingProperty + from .department_list_result import DepartmentListResult + from .enrollment_account_list_result import EnrollmentAccountListResult + from .billing_profile_list_result import BillingProfileListResult + from .invoice_section_list_result import InvoiceSectionListResult + from .operation_status import OperationStatus + from .download_url import DownloadUrl + from .error_details import ErrorDetails + from .error_response import ErrorResponse, ErrorResponseException + from .resource import Resource + from .amount import Amount + from .download_properties import DownloadProperties + from .payment_properties import PaymentProperties + from .invoice_summary import InvoiceSummary + from .invoice_list_result import InvoiceListResult + from .product_summary import ProductSummary + from .products_list_result import ProductsListResult + from .billing_subscription_summary import BillingSubscriptionSummary + from .billing_subscriptions_list_result import BillingSubscriptionsListResult + from .enrollment_account_context import EnrollmentAccountContext + from .transactions_summary import TransactionsSummary + from .transactions_list_result import TransactionsListResult + from .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 .line_of_credit import LineOfCredit +from .payment_method_paged import PaymentMethodPaged +from .billing_subscription_summary_paged import BillingSubscriptionSummaryPaged +from .product_summary_paged import ProductSummaryPaged +from .transactions_summary_paged import TransactionsSummaryPaged +from .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, + ProductStatusType, + BillingFrequency, + BillingSubscriptionStatusType, + TransactionTypeKind, + ReservationType, + PaymentMethodType, + UpdateAutoRenew, + Status, +) + +__all__ = [ + 'InitiateTransferRequest', + 'Address', + 'ValidateAddressResponse', + 'ProductDetails', + 'AcceptTransferRequest', + 'Error', + 'DetailedTransferStatus', + 'TransferDetails', + 'RecipientTransferDetails', + 'TransferProductRequestProperties', + 'TransferBillingSubscriptionResult', + 'TransferBillingSubscriptionRequestProperties', + 'TransferBillingSubscriptionRequest', + 'UpdateAutoRenewOperationSummary', + 'EnabledAzureSKUs', + 'BillingProfile', + 'InvoiceSectionProperties', + 'InvoiceSection', + 'EnrollmentPolicies', + 'Enrollment', + 'EnrollmentAccount', + 'Department', + 'BillingAccount', + 'BillingAccountListResult', + 'BillingProperty', + 'DepartmentListResult', + 'EnrollmentAccountListResult', + 'BillingProfileListResult', + 'InvoiceSectionListResult', + 'OperationStatus', + 'DownloadUrl', + 'ErrorDetails', + 'ErrorResponse', 'ErrorResponseException', + 'Resource', + 'Amount', + 'DownloadProperties', + 'PaymentProperties', + 'InvoiceSummary', + 'InvoiceListResult', + 'ProductSummary', + 'ProductsListResult', + 'BillingSubscriptionSummary', + 'BillingSubscriptionsListResult', + 'EnrollmentAccountContext', + 'TransactionsSummary', + 'TransactionsListResult', + 'Policy', + 'AvailableBalance', + 'PaymentMethod', + 'UpdateAutoRenewRequest', + 'OperationDisplay', + 'Operation', + 'BillingRoleAssignmentPayload', + 'BillingRoleAssignment', + 'BillingRoleAssignmentListResult', + 'BillingPermissionsProperties', + 'BillingPermissionsListResult', + 'BillingRoleDefinition', + 'BillingRoleDefinitionListResult', + 'Participants', + 'Agreement', + 'AgreementListResult', + 'LineOfCredit', + 'PaymentMethodPaged', + 'BillingSubscriptionSummaryPaged', + 'ProductSummaryPaged', + 'TransactionsSummaryPaged', + 'TransferDetailsPaged', + 'RecipientTransferDetailsPaged', + 'OperationPaged', + 'AddressValidationStatus', + 'ProductType', + 'TransferStatus', + 'ProductTransferStatus', + 'EligibleProductType', + 'ProductStatusType', + 'BillingFrequency', + 'BillingSubscriptionStatusType', + 'TransactionTypeKind', + 'ReservationType', + '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.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address.py new file mode 100644 index 000000000000..062465328263 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Address(Model): + """Address details. + + :param first_name: First Name. + :type first_name: str + :param last_name: Last Name. + :type last_name: str + :param company_name: Company Name. + :type company_name: str + :param address_line1: Address Line1. + :type address_line1: str + :param address_line2: Address Line2. + :type address_line2: str + :param address_line3: Address Line3. + :type address_line3: str + :param city: Address City. + :type city: str + :param region: Address Region. + :type region: str + :param country: Country code uses ISO2, 2-digit format. + :type country: str + :param postal_code: Address Postal Code. + :type postal_code: str + """ + + _attribute_map = { + 'first_name': {'key': 'firstName', 'type': 'str'}, + 'last_name': {'key': 'lastName', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'address_line1': {'key': 'addressLine1', 'type': 'str'}, + 'address_line2': {'key': 'addressLine2', 'type': 'str'}, + 'address_line3': {'key': 'addressLine3', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Address, self).__init__(**kwargs) + self.first_name = kwargs.get('first_name', None) + self.last_name = kwargs.get('last_name', None) + self.company_name = kwargs.get('company_name', None) + self.address_line1 = kwargs.get('address_line1', None) + self.address_line2 = kwargs.get('address_line2', None) + self.address_line3 = kwargs.get('address_line3', None) + self.city = kwargs.get('city', None) + self.region = kwargs.get('region', None) + self.country = kwargs.get('country', None) + self.postal_code = kwargs.get('postal_code', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_py3.py new file mode 100644 index 000000000000..df46f07863f2 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/address_py3.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Address(Model): + """Address details. + + :param first_name: First Name. + :type first_name: str + :param last_name: Last Name. + :type last_name: str + :param company_name: Company Name. + :type company_name: str + :param address_line1: Address Line1. + :type address_line1: str + :param address_line2: Address Line2. + :type address_line2: str + :param address_line3: Address Line3. + :type address_line3: str + :param city: Address City. + :type city: str + :param region: Address Region. + :type region: str + :param country: Country code uses ISO2, 2-digit format. + :type country: str + :param postal_code: Address Postal Code. + :type postal_code: str + """ + + _attribute_map = { + 'first_name': {'key': 'firstName', 'type': 'str'}, + 'last_name': {'key': 'lastName', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'address_line1': {'key': 'addressLine1', 'type': 'str'}, + 'address_line2': {'key': 'addressLine2', 'type': 'str'}, + 'address_line3': {'key': 'addressLine3', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + } + + def __init__(self, *, first_name: str=None, last_name: str=None, company_name: str=None, address_line1: str=None, address_line2: str=None, address_line3: str=None, city: str=None, region: str=None, country: str=None, postal_code: str=None, **kwargs) -> None: + super(Address, self).__init__(**kwargs) + self.first_name = first_name + self.last_name = last_name + self.company_name = company_name + self.address_line1 = address_line1 + self.address_line2 = address_line2 + self.address_line3 = address_line3 + self.city = city + self.region = region + self.country = country + self.postal_code = postal_code diff --git a/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..2707d55dcac7 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/amount.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Amount(Model): + """The Amount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar currency: The currency for the amount value. + :vartype currency: str + :ivar value: Amount value. + :vartype value: float + """ + + _validation = { + 'currency': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'currency': {'key': 'currency', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(Amount, self).__init__(**kwargs) + self.currency = None + self.value = None diff --git a/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..2f992f1c63c5 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/amount_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Amount(Model): + """The Amount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar currency: The currency for the amount value. + :vartype currency: str + :ivar value: Amount value. + :vartype value: float + """ + + _validation = { + 'currency': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'currency': {'key': 'currency', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(Amount, self).__init__(**kwargs) + self.currency = None + self.value = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/available_balance.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/available_balance.py new file mode 100644 index 000000000000..61b66201e156 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/available_balance.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class AvailableBalance(Resource): + """Latest available balance on Monetary Credit PI. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar amount: Balance Amount. + :vartype amount: ~azure.mgmt.billing.models.Amount + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'amount': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'amount': {'key': 'properties.amount', 'type': 'Amount'}, + } + + def __init__(self, **kwargs): + super(AvailableBalance, self).__init__(**kwargs) + self.amount = None diff --git a/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/billing_account.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py new file mode 100644 index 000000000000..2f36b5ce3732 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BillingAccount(Resource): + """A billing account resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: The billing account name. + :vartype display_name: str + :ivar account_type: The billing account Type. Possible values include: + 'Organization', 'Enrollment' + :vartype account_type: str or ~azure.mgmt.billing.models.enum + :param address: The address associated with billing account. + :type address: ~azure.mgmt.billing.models.Address + :ivar company: Company Name. + :vartype company: str + :ivar country: Country Name. + :vartype country: str + :param invoice_sections: The invoice sections associated to the billing + account. By default this is not populated, unless it's specified in + $expand. + :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] + :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 has_read_access: Specifies whether the user has read access on + billing account. + :vartype has_read_access: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'account_type': {'readonly': True}, + 'company': {'readonly': True}, + 'country': {'readonly': True}, + 'enrollment_details': {'readonly': True}, + 'has_read_access': {'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'}, + 'account_type': {'key': 'properties.accountType', 'type': 'str'}, + 'address': {'key': 'properties.address', 'type': 'Address'}, + 'company': {'key': 'properties.company', 'type': 'str'}, + 'country': {'key': 'properties.country', 'type': 'str'}, + 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, + 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, + 'enrollment_details': {'key': 'properties.enrollmentDetails', 'type': 'Enrollment'}, + 'departments': {'key': 'properties.departments', 'type': '[Department]'}, + 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, + 'has_read_access': {'key': 'properties.hasReadAccess', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(BillingAccount, self).__init__(**kwargs) + self.display_name = None + self.account_type = None + self.address = kwargs.get('address', None) + self.company = None + self.country = None + self.invoice_sections = kwargs.get('invoice_sections', None) + self.billing_profiles = kwargs.get('billing_profiles', None) + self.enrollment_details = None + self.departments = kwargs.get('departments', None) + self.enrollment_accounts = kwargs.get('enrollment_accounts', None) + self.has_read_access = None 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..5ecccfed7272 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_account_py3.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class BillingAccount(Resource): + """A billing account resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: The billing account name. + :vartype display_name: str + :ivar account_type: The billing account Type. Possible values include: + 'Organization', 'Enrollment' + :vartype account_type: str or ~azure.mgmt.billing.models.enum + :param address: The address associated with billing account. + :type address: ~azure.mgmt.billing.models.Address + :ivar company: Company Name. + :vartype company: str + :ivar country: Country Name. + :vartype country: str + :param invoice_sections: The invoice sections associated to the billing + account. By default this is not populated, unless it's specified in + $expand. + :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] + :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 has_read_access: Specifies whether the user has read access on + billing account. + :vartype has_read_access: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'account_type': {'readonly': True}, + 'company': {'readonly': True}, + 'country': {'readonly': True}, + 'enrollment_details': {'readonly': True}, + 'has_read_access': {'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'}, + 'account_type': {'key': 'properties.accountType', 'type': 'str'}, + 'address': {'key': 'properties.address', 'type': 'Address'}, + 'company': {'key': 'properties.company', 'type': 'str'}, + 'country': {'key': 'properties.country', 'type': 'str'}, + 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, + 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, + 'enrollment_details': {'key': 'properties.enrollmentDetails', 'type': 'Enrollment'}, + 'departments': {'key': 'properties.departments', 'type': '[Department]'}, + 'enrollment_accounts': {'key': 'properties.enrollmentAccounts', 'type': '[EnrollmentAccount]'}, + 'has_read_access': {'key': 'properties.hasReadAccess', 'type': 'bool'}, + } + + def __init__(self, *, address=None, invoice_sections=None, billing_profiles=None, departments=None, enrollment_accounts=None, **kwargs) -> None: + super(BillingAccount, self).__init__(**kwargs) + self.display_name = None + self.account_type = None + self.address = address + self.company = None + self.country = None + self.invoice_sections = invoice_sections + self.billing_profiles = billing_profiles + self.enrollment_details = None + self.departments = departments + self.enrollment_accounts = enrollment_accounts + self.has_read_access = 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..99813d1714b1 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_management_client_enums.py @@ -0,0 +1,108 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +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 ProductStatusType(str, Enum): + + active = "Active" + inactive = "Inactive" + past_due = "PastDue" + expiring = "Expiring" + expired = "Expired" + disabled = "Disabled" + cancelled = "Cancelled" + auto_renew = "AutoRenew" + + +class BillingFrequency(str, Enum): + + one_time = "OneTime" + monthly = "Monthly" + usage_based = "UsageBased" + + +class BillingSubscriptionStatusType(str, Enum): + + active = "Active" + inactive = "Inactive" + abandoned = "Abandoned" + deleted = "Deleted" + warning = "Warning" + + +class TransactionTypeKind(str, Enum): + + all = "all" + reservation = "reservation" + + +class ReservationType(str, Enum): + + purchase = "Purchase" + usage_charge = "Usage Charge" + + +class PaymentMethodType(str, Enum): + + credits = "Credits" + cheque_wire = "ChequeWire" + + +class UpdateAutoRenew(str, Enum): + + true = "true" + false = "false" + + +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..d260a69513d0 --- /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..8a8ccfb428cf --- /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..daf0f24078cc --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile.py @@ -0,0 +1,85 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BillingProfile(Resource): + """A billing profile resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: The billing profile name. + :type display_name: str + :param po_number: Purchase order number. + :type po_number: str + :param address: Billing address. + :type address: ~azure.mgmt.billing.models.Address + :ivar invoice_email_opt_in: If the billing profile is opted in to receive + invoices via email. + :vartype invoice_email_opt_in: bool + :ivar is_classic: Is OMS bootstrapped billing profile. + :vartype is_classic: bool + :ivar invoice_day: Invoice day. + :vartype invoice_day: int + :ivar currency: The currency associated with the billing profile. + :vartype currency: str + :param enabled_azure_sk_us: Information about the product. + :type enabled_azure_sk_us: + list[~azure.mgmt.billing.models.EnabledAzureSKUs] + :param invoice_sections: The invoice sections associated to the billing + profile. + :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'invoice_email_opt_in': {'readonly': True}, + 'is_classic': {'readonly': True}, + 'invoice_day': {'readonly': True}, + 'currency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'po_number': {'key': 'properties.poNumber', 'type': 'str'}, + 'address': {'key': 'properties.address', 'type': 'Address'}, + 'invoice_email_opt_in': {'key': 'properties.invoiceEmailOptIn', 'type': 'bool'}, + 'is_classic': {'key': 'properties.isClassic', 'type': 'bool'}, + 'invoice_day': {'key': 'properties.invoiceDay', 'type': 'int'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'enabled_azure_sk_us': {'key': 'properties.enabledAzureSKUs', 'type': '[EnabledAzureSKUs]'}, + '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.is_classic = None + self.invoice_day = None + self.currency = None + self.enabled_azure_sk_us = kwargs.get('enabled_azure_sk_us', None) + self.invoice_sections = kwargs.get('invoice_sections', None) diff --git a/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..4e1feba37af7 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_profile_py3.py @@ -0,0 +1,85 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class BillingProfile(Resource): + """A billing profile resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: The billing profile name. + :type display_name: str + :param po_number: Purchase order number. + :type po_number: str + :param address: Billing address. + :type address: ~azure.mgmt.billing.models.Address + :ivar invoice_email_opt_in: If the billing profile is opted in to receive + invoices via email. + :vartype invoice_email_opt_in: bool + :ivar is_classic: Is OMS bootstrapped billing profile. + :vartype is_classic: bool + :ivar invoice_day: Invoice day. + :vartype invoice_day: int + :ivar currency: The currency associated with the billing profile. + :vartype currency: str + :param enabled_azure_sk_us: Information about the product. + :type enabled_azure_sk_us: + list[~azure.mgmt.billing.models.EnabledAzureSKUs] + :param invoice_sections: The invoice sections associated to the billing + profile. + :type invoice_sections: list[~azure.mgmt.billing.models.InvoiceSection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'invoice_email_opt_in': {'readonly': True}, + 'is_classic': {'readonly': True}, + 'invoice_day': {'readonly': True}, + 'currency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'po_number': {'key': 'properties.poNumber', 'type': 'str'}, + 'address': {'key': 'properties.address', 'type': 'Address'}, + 'invoice_email_opt_in': {'key': 'properties.invoiceEmailOptIn', 'type': 'bool'}, + 'is_classic': {'key': 'properties.isClassic', 'type': 'bool'}, + 'invoice_day': {'key': 'properties.invoiceDay', 'type': 'int'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'enabled_azure_sk_us': {'key': 'properties.enabledAzureSKUs', 'type': '[EnabledAzureSKUs]'}, + 'invoice_sections': {'key': 'properties.invoiceSections', 'type': '[InvoiceSection]'}, + } + + def __init__(self, *, display_name: str=None, po_number: str=None, address=None, enabled_azure_sk_us=None, invoice_sections=None, **kwargs) -> None: + super(BillingProfile, self).__init__(**kwargs) + self.display_name = display_name + self.po_number = po_number + self.address = address + self.invoice_email_opt_in = None + self.is_classic = None + self.invoice_day = None + self.currency = None + self.enabled_azure_sk_us = enabled_azure_sk_us + self.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..bb89970c45a4 --- /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_name: Billing account name. + :vartype billing_account_name: str + :ivar billing_profile_id: Billing profile Id. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing profile name. + :vartype billing_profile_name: str + :ivar cost_center: Cost center name. + :vartype cost_center: str + :ivar invoice_section_id: Invoice Section Id. + :vartype invoice_section_id: str + :ivar invoice_section_name: Invoice Section name. + :vartype invoice_section_name: str + :ivar 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_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'cost_center': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_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_name': {'key': 'properties.billingAccountName', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + '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_name = None + self.billing_profile_id = None + self.billing_profile_name = None + self.cost_center = None + self.invoice_section_id = None + self.invoice_section_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..ab5bcfe3a8ca --- /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_name: Billing account name. + :vartype billing_account_name: str + :ivar billing_profile_id: Billing profile Id. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing profile name. + :vartype billing_profile_name: str + :ivar cost_center: Cost center name. + :vartype cost_center: str + :ivar invoice_section_id: Invoice Section Id. + :vartype invoice_section_id: str + :ivar invoice_section_name: Invoice Section name. + :vartype invoice_section_name: str + :ivar 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_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'cost_center': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_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_name': {'key': 'properties.billingAccountName', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + '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_name = None + self.billing_profile_id = None + self.billing_profile_name = None + self.cost_center = None + self.invoice_section_id = None + self.invoice_section_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..7cc47de28ff1 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BillingRoleAssignmentPayload(Model): + """The payload use to update role assignment on a scope. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The user's principal id that the role gets assigned to + :vartype principal_id: str + :ivar billing_role_definition_name: The role definition id + :vartype billing_role_definition_name: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'billing_role_definition_name': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'billing_role_definition_name': {'key': 'billingRoleDefinitionName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingRoleAssignmentPayload, self).__init__(**kwargs) + self.principal_id = None + self.billing_role_definition_name = None diff --git a/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..966a8fe639df --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_role_assignment_payload_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BillingRoleAssignmentPayload(Model): + """The payload use to update role assignment on a scope. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The user's principal id that the role gets assigned to + :vartype principal_id: str + :ivar billing_role_definition_name: The role definition id + :vartype billing_role_definition_name: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'billing_role_definition_name': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'billing_role_definition_name': {'key': 'billingRoleDefinitionName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingRoleAssignmentPayload, self).__init__(**kwargs) + self.principal_id = None + self.billing_role_definition_name = None diff --git a/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..ce3773364f39 --- /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..c20af66e272f --- /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_summary.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py new file mode 100644 index 000000000000..2bc957b75bd3 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BillingSubscriptionSummary(Resource): + """A billing Subscription summary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: display name. + :vartype display_name: str + :ivar subscription_id: Subscription Id. + :vartype subscription_id: str + :param subscription_billing_status: Subscription billing status. Possible + values include: 'Active', 'Inactive', 'Abandoned', 'Deleted', 'Warning' + :type subscription_billing_status: str or + ~azure.mgmt.billing.models.BillingSubscriptionStatusType + :ivar last_month_charges: Last month charges. + :vartype last_month_charges: ~azure.mgmt.billing.models.Amount + :ivar month_to_date_charges: Month to date charges. + :vartype month_to_date_charges: ~azure.mgmt.billing.models.Amount + :ivar billing_profile_id: Billing Profile id to which this product + belongs. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing Profile name to which this product + belongs. + :vartype billing_profile_name: str + :ivar invoice_section_id: Invoice section id to which this product + belongs. + :vartype invoice_section_id: str + :ivar invoice_section_name: Invoice section name to which this product + belongs. + :vartype invoice_section_name: str + :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_name': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'sku_description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'subscription_billing_status': {'key': 'properties.subscriptionBillingStatus', 'type': 'str'}, + 'last_month_charges': {'key': 'properties.lastMonthCharges', 'type': 'Amount'}, + 'month_to_date_charges': {'key': 'properties.monthToDateCharges', 'type': 'Amount'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingSubscriptionSummary, self).__init__(**kwargs) + self.display_name = None + self.subscription_id = None + self.subscription_billing_status = kwargs.get('subscription_billing_status', None) + self.last_month_charges = None + self.month_to_date_charges = None + self.billing_profile_id = None + self.billing_profile_name = None + self.invoice_section_id = None + self.invoice_section_name = None + self.sku_id = kwargs.get('sku_id', None) + self.sku_description = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_paged.py new file mode 100644 index 000000000000..9c32206b6654 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class BillingSubscriptionSummaryPaged(Paged): + """ + A paging container for iterating over a list of :class:`BillingSubscriptionSummary ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[BillingSubscriptionSummary]'} + } + + def __init__(self, *args, **kwargs): + + super(BillingSubscriptionSummaryPaged, self).__init__(*args, **kwargs) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py new file mode 100644 index 000000000000..be61f23b614f --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscription_summary_py3.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class BillingSubscriptionSummary(Resource): + """A billing Subscription summary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: display name. + :vartype display_name: str + :ivar subscription_id: Subscription Id. + :vartype subscription_id: str + :param subscription_billing_status: Subscription billing status. Possible + values include: 'Active', 'Inactive', 'Abandoned', 'Deleted', 'Warning' + :type subscription_billing_status: str or + ~azure.mgmt.billing.models.BillingSubscriptionStatusType + :ivar last_month_charges: Last month charges. + :vartype last_month_charges: ~azure.mgmt.billing.models.Amount + :ivar month_to_date_charges: Month to date charges. + :vartype month_to_date_charges: ~azure.mgmt.billing.models.Amount + :ivar billing_profile_id: Billing Profile id to which this product + belongs. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing Profile name to which this product + belongs. + :vartype billing_profile_name: str + :ivar invoice_section_id: Invoice section id to which this product + belongs. + :vartype invoice_section_id: str + :ivar invoice_section_name: Invoice section name to which this product + belongs. + :vartype invoice_section_name: str + :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_name': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'sku_description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'subscription_billing_status': {'key': 'properties.subscriptionBillingStatus', 'type': 'str'}, + 'last_month_charges': {'key': 'properties.lastMonthCharges', 'type': 'Amount'}, + 'month_to_date_charges': {'key': 'properties.monthToDateCharges', 'type': 'Amount'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, + } + + def __init__(self, *, subscription_billing_status=None, sku_id: str=None, **kwargs) -> None: + super(BillingSubscriptionSummary, self).__init__(**kwargs) + self.display_name = None + self.subscription_id = None + self.subscription_billing_status = subscription_billing_status + self.last_month_charges = None + self.month_to_date_charges = None + self.billing_profile_id = None + self.billing_profile_name = None + self.invoice_section_id = None + self.invoice_section_name = None + self.sku_id = sku_id + self.sku_description = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py new file mode 100644 index 000000000000..e6f539a0c3de --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BillingSubscriptionsListResult(Model): + """Result of listing billing subscriptions summary. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of billing subscriptions summary. + :vartype value: + list[~azure.mgmt.billing.models.BillingSubscriptionSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingSubscriptionSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingSubscriptionsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/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..b5b5de332d98 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/billing_subscriptions_list_result_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BillingSubscriptionsListResult(Model): + """Result of listing billing subscriptions summary. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of billing subscriptions summary. + :vartype value: + list[~azure.mgmt.billing.models.BillingSubscriptionSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingSubscriptionSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(BillingSubscriptionsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/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/download_properties.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_properties.py new file mode 100644 index 000000000000..f6b17398e035 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_properties.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DownloadProperties(Model): + """The properties of the invoice download. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar kind: Document type. Possible values include: 'Invoice', 'VoidNote', + 'Receipt', 'CreditNote' + :vartype kind: str or ~azure.mgmt.billing.models.enum + :ivar url: Document URL. + :vartype url: str + """ + + _validation = { + 'kind': {'readonly': True}, + 'url': {'readonly': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DownloadProperties, self).__init__(**kwargs) + self.kind = None + self.url = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_properties_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_properties_py3.py new file mode 100644 index 000000000000..b10a00755b25 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_properties_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DownloadProperties(Model): + """The properties of the invoice download. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar kind: Document type. Possible values include: 'Invoice', 'VoidNote', + 'Receipt', 'CreditNote' + :vartype kind: str or ~azure.mgmt.billing.models.enum + :ivar url: Document URL. + :vartype url: str + """ + + _validation = { + 'kind': {'readonly': True}, + 'url': {'readonly': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DownloadProperties, self).__init__(**kwargs) + self.kind = None + self.url = None diff --git a/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 new file mode 100644 index 000000000000..ffddaf71dfca --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/download_url.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): + 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/enabled_azure_sk_us.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.py new file mode 100644 index 000000000000..5eea898a7ca5 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us.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 EnabledAzureSKUs(Model): + """Details about the enabled azure sku. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar sku_id: The sku id. + :vartype sku_id: str + :ivar sku_description: The sku description. + :vartype sku_description: str + """ + + _validation = { + 'sku_id': {'readonly': True}, + 'sku_description': {'readonly': True}, + } + + _attribute_map = { + 'sku_id': {'key': 'skuId', 'type': 'str'}, + 'sku_description': {'key': 'skuDescription', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EnabledAzureSKUs, self).__init__(**kwargs) + self.sku_id = None + self.sku_description = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_py3.py new file mode 100644 index 000000000000..bd031bd7176a --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enabled_azure_sk_us_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 EnabledAzureSKUs(Model): + """Details about the enabled azure sku. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar sku_id: The sku id. + :vartype sku_id: str + :ivar sku_description: The sku description. + :vartype sku_description: str + """ + + _validation = { + 'sku_id': {'readonly': True}, + 'sku_description': {'readonly': True}, + } + + _attribute_map = { + 'sku_id': {'key': 'skuId', 'type': 'str'}, + 'sku_description': {'key': 'skuDescription', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(EnabledAzureSKUs, self).__init__(**kwargs) + self.sku_id = None + self.sku_description = 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 new file mode 100644 index 000000000000..abfb121b9551 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/enrollment_account.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 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, **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 new file mode 100644 index 000000000000..ebdc3b5e9aaf --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_details.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): + 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 new file mode 100644 index 000000000000..97452d9adf1c --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/error_response.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, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +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/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..726b8b201c15 --- /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 billing_profile_id: Target Usage context for devTest subscriptions. + :type billing_profile_id: str + :param recipient_email_id: Email Id of recipient for transfer. + :type recipient_email_id: str + """ + + _attribute_map = { + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(InitiateTransferRequest, self).__init__(**kwargs) + self.billing_profile_id = kwargs.get('billing_profile_id', None) + self.recipient_email_id = kwargs.get('recipient_email_id', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/initiate_transfer_request_py3.py new file mode 100644 index 000000000000..564bdd8fbbb0 --- /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 billing_profile_id: Target Usage context for devTest subscriptions. + :type billing_profile_id: str + :param recipient_email_id: Email Id of recipient for transfer. + :type recipient_email_id: str + """ + + _attribute_map = { + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, + } + + def __init__(self, *, billing_profile_id: str=None, recipient_email_id: str=None, **kwargs) -> None: + super(InitiateTransferRequest, self).__init__(**kwargs) + self.billing_profile_id = billing_profile_id + self.recipient_email_id = recipient_email_id diff --git a/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..0e0156b4eaa6 --- /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.InvoiceSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InvoiceSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(InvoiceListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/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..cc7db9c465d8 --- /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.InvoiceSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InvoiceSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(InvoiceListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/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..00342ac237f9 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class InvoiceSection(Resource): + """An InvoiceSection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: The name of the InvoiceSection. + :type display_name: str + :param billing_profiles: The billing profiles associated to the billing + account. + :type billing_profiles: list[~azure.mgmt.billing.models.BillingProfile] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, + } + + def __init__(self, **kwargs): + super(InvoiceSection, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.billing_profiles = kwargs.get('billing_profiles', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_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_properties.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties.py new file mode 100644 index 000000000000..0699364eac65 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InvoiceSectionProperties(Model): + """The properties of an InvoiceSection. + + :param display_name: The name of the InvoiceSection. + :type display_name: str + :param billing_profiles: The billing profiles associated to the billing + account. + :type billing_profiles: list[~azure.mgmt.billing.models.BillingProfile] + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'billing_profiles': {'key': 'billingProfiles', 'type': '[BillingProfile]'}, + } + + def __init__(self, **kwargs): + super(InvoiceSectionProperties, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.billing_profiles = kwargs.get('billing_profiles', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties_py3.py new file mode 100644 index 000000000000..27b07396070f --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_properties_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InvoiceSectionProperties(Model): + """The properties of an InvoiceSection. + + :param display_name: The name of the InvoiceSection. + :type display_name: str + :param billing_profiles: The billing profiles associated to the billing + account. + :type billing_profiles: list[~azure.mgmt.billing.models.BillingProfile] + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'billing_profiles': {'key': 'billingProfiles', 'type': '[BillingProfile]'}, + } + + def __init__(self, *, display_name: str=None, billing_profiles=None, **kwargs) -> None: + super(InvoiceSectionProperties, self).__init__(**kwargs) + self.display_name = display_name + self.billing_profiles = billing_profiles diff --git a/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..16420f33e703 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_section_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class InvoiceSection(Resource): + """An InvoiceSection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: The name of the InvoiceSection. + :type display_name: str + :param billing_profiles: The billing profiles associated to the billing + account. + :type billing_profiles: list[~azure.mgmt.billing.models.BillingProfile] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'billing_profiles': {'key': 'properties.billingProfiles', 'type': '[BillingProfile]'}, + } + + def __init__(self, *, display_name: str=None, billing_profiles=None, **kwargs) -> None: + super(InvoiceSection, self).__init__(**kwargs) + self.display_name = display_name + self.billing_profiles = billing_profiles diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py new file mode 100644 index 000000000000..ad984d6e6f83 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class InvoiceSummary(Resource): + """An invoice resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar due_date: The due date for invoice. + :vartype due_date: datetime + :ivar invoice_date: The date when invoice was created. + :vartype invoice_date: datetime + :ivar status: Invoice status. Possible values include: 'PastDue', 'Due', + 'Paid', 'Void' + :vartype status: str or ~azure.mgmt.billing.models.enum + :ivar amount_due: Amount due. + :vartype amount_due: ~azure.mgmt.billing.models.Amount + :ivar billed_amount: Amount billed. + :vartype billed_amount: ~azure.mgmt.billing.models.Amount + :ivar invoice_period_start_date: The start date of the billing period. + :vartype invoice_period_start_date: datetime + :ivar invoice_period_end_date: The end date of the billing period. + :vartype invoice_period_end_date: datetime + :ivar billing_profile_id: The billing profile id this invoice belongs to. + :vartype billing_profile_id: str + :ivar billing_profile_name: The profile name this invoice belongs to. + :vartype billing_profile_name: str + :ivar purchase_order_number: The purchase identifier for the invoice. + :vartype purchase_order_number: str + :ivar document_urls: List of document urls available to download including + invoice and tax documents. + :vartype document_urls: + list[~azure.mgmt.billing.models.DownloadProperties] + :ivar payments: List of payments. + :vartype payments: list[~azure.mgmt.billing.models.PaymentProperties] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'due_date': {'readonly': True}, + 'invoice_date': {'readonly': True}, + 'status': {'readonly': True}, + 'amount_due': {'readonly': True}, + 'billed_amount': {'readonly': True}, + 'invoice_period_start_date': {'readonly': True}, + 'invoice_period_end_date': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'purchase_order_number': {'readonly': True}, + 'document_urls': {'readonly': True}, + 'payments': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'due_date': {'key': 'properties.dueDate', 'type': 'iso-8601'}, + 'invoice_date': {'key': 'properties.invoiceDate', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'amount_due': {'key': 'properties.amountDue', 'type': 'Amount'}, + 'billed_amount': {'key': 'properties.billedAmount', 'type': 'Amount'}, + 'invoice_period_start_date': {'key': 'properties.invoicePeriodStartDate', 'type': 'iso-8601'}, + 'invoice_period_end_date': {'key': 'properties.invoicePeriodEndDate', 'type': 'iso-8601'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'purchase_order_number': {'key': 'properties.purchaseOrderNumber', 'type': 'str'}, + 'document_urls': {'key': 'properties.documentUrls', 'type': '[DownloadProperties]'}, + 'payments': {'key': 'properties.payments', 'type': '[PaymentProperties]'}, + } + + def __init__(self, **kwargs): + super(InvoiceSummary, self).__init__(**kwargs) + self.due_date = None + self.invoice_date = None + self.status = None + self.amount_due = None + self.billed_amount = None + self.invoice_period_start_date = None + self.invoice_period_end_date = None + self.billing_profile_id = None + self.billing_profile_name = None + self.purchase_order_number = None + self.document_urls = None + self.payments = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py new file mode 100644 index 000000000000..2c49b9a389fa --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/invoice_summary_py3.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class InvoiceSummary(Resource): + """An invoice resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar due_date: The due date for invoice. + :vartype due_date: datetime + :ivar invoice_date: The date when invoice was created. + :vartype invoice_date: datetime + :ivar status: Invoice status. Possible values include: 'PastDue', 'Due', + 'Paid', 'Void' + :vartype status: str or ~azure.mgmt.billing.models.enum + :ivar amount_due: Amount due. + :vartype amount_due: ~azure.mgmt.billing.models.Amount + :ivar billed_amount: Amount billed. + :vartype billed_amount: ~azure.mgmt.billing.models.Amount + :ivar invoice_period_start_date: The start date of the billing period. + :vartype invoice_period_start_date: datetime + :ivar invoice_period_end_date: The end date of the billing period. + :vartype invoice_period_end_date: datetime + :ivar billing_profile_id: The billing profile id this invoice belongs to. + :vartype billing_profile_id: str + :ivar billing_profile_name: The profile name this invoice belongs to. + :vartype billing_profile_name: str + :ivar purchase_order_number: The purchase identifier for the invoice. + :vartype purchase_order_number: str + :ivar document_urls: List of document urls available to download including + invoice and tax documents. + :vartype document_urls: + list[~azure.mgmt.billing.models.DownloadProperties] + :ivar payments: List of payments. + :vartype payments: list[~azure.mgmt.billing.models.PaymentProperties] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'due_date': {'readonly': True}, + 'invoice_date': {'readonly': True}, + 'status': {'readonly': True}, + 'amount_due': {'readonly': True}, + 'billed_amount': {'readonly': True}, + 'invoice_period_start_date': {'readonly': True}, + 'invoice_period_end_date': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'purchase_order_number': {'readonly': True}, + 'document_urls': {'readonly': True}, + 'payments': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'due_date': {'key': 'properties.dueDate', 'type': 'iso-8601'}, + 'invoice_date': {'key': 'properties.invoiceDate', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'amount_due': {'key': 'properties.amountDue', 'type': 'Amount'}, + 'billed_amount': {'key': 'properties.billedAmount', 'type': 'Amount'}, + 'invoice_period_start_date': {'key': 'properties.invoicePeriodStartDate', 'type': 'iso-8601'}, + 'invoice_period_end_date': {'key': 'properties.invoicePeriodEndDate', 'type': 'iso-8601'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'purchase_order_number': {'key': 'properties.purchaseOrderNumber', 'type': 'str'}, + 'document_urls': {'key': 'properties.documentUrls', 'type': '[DownloadProperties]'}, + 'payments': {'key': 'properties.payments', 'type': '[PaymentProperties]'}, + } + + def __init__(self, **kwargs) -> None: + super(InvoiceSummary, self).__init__(**kwargs) + self.due_date = None + self.invoice_date = None + self.status = None + self.amount_due = None + self.billed_amount = None + self.invoice_period_start_date = None + self.invoice_period_end_date = None + self.billing_profile_id = None + self.billing_profile_name = None + self.purchase_order_number = None + self.document_urls = None + self.payments = None 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 new file mode 100644 index 000000000000..0e458f6ea690 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation.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, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + 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 new file mode 100644 index 000000000000..ef6f1093f01a --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_display.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): + 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_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_paged.py new file mode 100644 index 000000000000..434d72d13b22 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_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 OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) 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/operation_status.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_status.py new file mode 100644 index 000000000000..b4bd9e976219 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_status.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationStatus(Model): + """status of the Billing POST/PUT operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The operation Id. + :vartype id: str + :param status: Status of the pending operation + :type status: str + :param status_detail: Status Detail of the pending operation + :type status_detail: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_detail': {'key': 'statusDetail', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationStatus, self).__init__(**kwargs) + self.id = None + self.status = kwargs.get('status', None) + self.status_detail = kwargs.get('status_detail', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py new file mode 100644 index 000000000000..325cee1d2b7e --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/operation_status_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationStatus(Model): + """status of the Billing POST/PUT operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The operation Id. + :vartype id: str + :param status: Status of the pending operation + :type status: str + :param status_detail: Status Detail of the pending operation + :type status_detail: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_detail': {'key': 'statusDetail', 'type': 'str'}, + } + + def __init__(self, *, status: str=None, status_detail: str=None, **kwargs) -> None: + super(OperationStatus, self).__init__(**kwargs) + self.id = None + self.status = status + self.status_detail = status_detail diff --git a/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..b2551b8f4fa2 --- /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 date. + :vartype expiration: datetime + :ivar currency: The currency associated with the payment method. + :vartype currency: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'details': {'readonly': True}, + 'expiration': {'readonly': True}, + 'currency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'payment_method_type': {'key': 'properties.paymentMethodType', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + 'expiration': {'key': 'properties.expiration', 'type': 'iso-8601'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PaymentMethod, self).__init__(**kwargs) + self.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..1c4ad14cd61a --- /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 date. + :vartype expiration: datetime + :ivar currency: The currency associated with the payment method. + :vartype currency: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'details': {'readonly': True}, + 'expiration': {'readonly': True}, + 'currency': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'payment_method_type': {'key': 'properties.paymentMethodType', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + 'expiration': {'key': 'properties.expiration', 'type': 'iso-8601'}, + '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..a153f1d3aa8c --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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_allowed: The marketplacePurchasesAllowed + flag. + :type marketplace_purchases_allowed: bool + :param reservation_purchases_allowed: The reservationPurchasesAllowed + flag. + :type reservation_purchases_allowed: bool + :param subscription_owner_can_view_charges: The + subscriptionOwnerCanViewCharges flag. + :type subscription_owner_can_view_charges: bool + """ + + _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_allowed': {'key': 'properties.marketplacePurchasesAllowed', 'type': 'bool'}, + 'reservation_purchases_allowed': {'key': 'properties.reservationPurchasesAllowed', 'type': 'bool'}, + 'subscription_owner_can_view_charges': {'key': 'properties.subscriptionOwnerCanViewCharges', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(Policy, self).__init__(**kwargs) + self.marketplace_purchases_allowed = kwargs.get('marketplace_purchases_allowed', None) + self.reservation_purchases_allowed = kwargs.get('reservation_purchases_allowed', None) + self.subscription_owner_can_view_charges = kwargs.get('subscription_owner_can_view_charges', None) 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..6fcb7d8b1561 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/policy_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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_allowed: The marketplacePurchasesAllowed + flag. + :type marketplace_purchases_allowed: bool + :param reservation_purchases_allowed: The reservationPurchasesAllowed + flag. + :type reservation_purchases_allowed: bool + :param subscription_owner_can_view_charges: The + subscriptionOwnerCanViewCharges flag. + :type subscription_owner_can_view_charges: bool + """ + + _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_allowed': {'key': 'properties.marketplacePurchasesAllowed', 'type': 'bool'}, + 'reservation_purchases_allowed': {'key': 'properties.reservationPurchasesAllowed', 'type': 'bool'}, + 'subscription_owner_can_view_charges': {'key': 'properties.subscriptionOwnerCanViewCharges', 'type': 'bool'}, + } + + def __init__(self, *, marketplace_purchases_allowed: bool=None, reservation_purchases_allowed: bool=None, subscription_owner_can_view_charges: bool=None, **kwargs) -> None: + super(Policy, self).__init__(**kwargs) + self.marketplace_purchases_allowed = marketplace_purchases_allowed + self.reservation_purchases_allowed = reservation_purchases_allowed + self.subscription_owner_can_view_charges = subscription_owner_can_view_charges 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/product_summary.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary.py new file mode 100644 index 000000000000..8ff4b299b84c --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary.py @@ -0,0 +1,138 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ProductSummary(Resource): + """A product summary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: The display name of the product. + :vartype display_name: str + :ivar purchase_date: The date of purchase. + :vartype purchase_date: datetime + :ivar product_type_id: The product type id. + :vartype product_type_id: str + :ivar product_type: The type of product. + :vartype product_type: str + :param status: Product status. Possible values include: 'Active', + 'Inactive', 'PastDue', 'Expiring', 'Expired', 'Disabled', 'Cancelled', + 'AutoRenew' + :type status: str or ~azure.mgmt.billing.models.ProductStatusType + :ivar end_date: end date. + :vartype end_date: datetime + :param billing_frequency: Billing frequency. Possible values include: + 'OneTime', 'Monthly', 'UsageBased' + :type billing_frequency: str or + ~azure.mgmt.billing.models.BillingFrequency + :ivar last_charge: Last month charges. + :vartype last_charge: ~azure.mgmt.billing.models.Amount + :ivar last_charge_date: The date of the last charge. + :vartype last_charge_date: datetime + :ivar quantity: The purchased product quantity. + :vartype quantity: float + :ivar sku_id: Sku Id. + :vartype sku_id: str + :ivar sku_description: Sku description. + :vartype sku_description: str + :ivar availability_id: Availability Id. + :vartype availability_id: str + :ivar parent_product_id: Parent Product Id. + :vartype parent_product_id: str + :ivar invoice_section_id: Invoice section id to which this product + belongs. + :vartype invoice_section_id: str + :ivar invoice_section_name: Invoice section name to which this product + belongs. + :vartype invoice_section_name: str + :ivar billing_profile_id: Billing Profile id to which this product + belongs. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing Profile name to which this product + belongs. + :vartype billing_profile_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'purchase_date': {'readonly': True}, + 'product_type_id': {'readonly': True}, + 'product_type': {'readonly': True}, + 'end_date': {'readonly': True}, + 'last_charge': {'readonly': True}, + 'last_charge_date': {'readonly': True}, + 'quantity': {'readonly': True}, + 'sku_id': {'readonly': True}, + 'sku_description': {'readonly': True}, + 'availability_id': {'readonly': True}, + 'parent_product_id': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'purchase_date': {'key': 'properties.purchaseDate', 'type': 'iso-8601'}, + 'product_type_id': {'key': 'properties.productTypeId', 'type': 'str'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, + 'billing_frequency': {'key': 'properties.billingFrequency', 'type': 'str'}, + 'last_charge': {'key': 'properties.lastCharge', 'type': 'Amount'}, + 'last_charge_date': {'key': 'properties.lastChargeDate', 'type': 'iso-8601'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, + 'availability_id': {'key': 'properties.availabilityId', 'type': 'str'}, + 'parent_product_id': {'key': 'properties.parentProductId', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProductSummary, self).__init__(**kwargs) + self.display_name = None + self.purchase_date = None + self.product_type_id = None + self.product_type = None + self.status = kwargs.get('status', None) + self.end_date = None + self.billing_frequency = kwargs.get('billing_frequency', None) + self.last_charge = None + self.last_charge_date = None + self.quantity = None + self.sku_id = None + self.sku_description = None + self.availability_id = None + self.parent_product_id = None + self.invoice_section_id = None + self.invoice_section_name = None + self.billing_profile_id = None + self.billing_profile_name = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_paged.py new file mode 100644 index 000000000000..d34d96d175af --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ProductSummaryPaged(Paged): + """ + A paging container for iterating over a list of :class:`ProductSummary ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ProductSummary]'} + } + + def __init__(self, *args, **kwargs): + + super(ProductSummaryPaged, self).__init__(*args, **kwargs) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_py3.py new file mode 100644 index 000000000000..182b96e9526f --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/product_summary_py3.py @@ -0,0 +1,138 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class ProductSummary(Resource): + """A product summary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: The display name of the product. + :vartype display_name: str + :ivar purchase_date: The date of purchase. + :vartype purchase_date: datetime + :ivar product_type_id: The product type id. + :vartype product_type_id: str + :ivar product_type: The type of product. + :vartype product_type: str + :param status: Product status. Possible values include: 'Active', + 'Inactive', 'PastDue', 'Expiring', 'Expired', 'Disabled', 'Cancelled', + 'AutoRenew' + :type status: str or ~azure.mgmt.billing.models.ProductStatusType + :ivar end_date: end date. + :vartype end_date: datetime + :param billing_frequency: Billing frequency. Possible values include: + 'OneTime', 'Monthly', 'UsageBased' + :type billing_frequency: str or + ~azure.mgmt.billing.models.BillingFrequency + :ivar last_charge: Last month charges. + :vartype last_charge: ~azure.mgmt.billing.models.Amount + :ivar last_charge_date: The date of the last charge. + :vartype last_charge_date: datetime + :ivar quantity: The purchased product quantity. + :vartype quantity: float + :ivar sku_id: Sku Id. + :vartype sku_id: str + :ivar sku_description: Sku description. + :vartype sku_description: str + :ivar availability_id: Availability Id. + :vartype availability_id: str + :ivar parent_product_id: Parent Product Id. + :vartype parent_product_id: str + :ivar invoice_section_id: Invoice section id to which this product + belongs. + :vartype invoice_section_id: str + :ivar invoice_section_name: Invoice section name to which this product + belongs. + :vartype invoice_section_name: str + :ivar billing_profile_id: Billing Profile id to which this product + belongs. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing Profile name to which this product + belongs. + :vartype billing_profile_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'purchase_date': {'readonly': True}, + 'product_type_id': {'readonly': True}, + 'product_type': {'readonly': True}, + 'end_date': {'readonly': True}, + 'last_charge': {'readonly': True}, + 'last_charge_date': {'readonly': True}, + 'quantity': {'readonly': True}, + 'sku_id': {'readonly': True}, + 'sku_description': {'readonly': True}, + 'availability_id': {'readonly': True}, + 'parent_product_id': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'invoice_section_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'purchase_date': {'key': 'properties.purchaseDate', 'type': 'iso-8601'}, + 'product_type_id': {'key': 'properties.productTypeId', 'type': 'str'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, + 'billing_frequency': {'key': 'properties.billingFrequency', 'type': 'str'}, + 'last_charge': {'key': 'properties.lastCharge', 'type': 'Amount'}, + 'last_charge_date': {'key': 'properties.lastChargeDate', 'type': 'iso-8601'}, + 'quantity': {'key': 'properties.quantity', 'type': 'float'}, + 'sku_id': {'key': 'properties.skuId', 'type': 'str'}, + 'sku_description': {'key': 'properties.skuDescription', 'type': 'str'}, + 'availability_id': {'key': 'properties.availabilityId', 'type': 'str'}, + 'parent_product_id': {'key': 'properties.parentProductId', 'type': 'str'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'invoice_section_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + } + + def __init__(self, *, status=None, billing_frequency=None, **kwargs) -> None: + super(ProductSummary, self).__init__(**kwargs) + self.display_name = None + self.purchase_date = None + self.product_type_id = None + self.product_type = None + self.status = status + self.end_date = None + self.billing_frequency = billing_frequency + self.last_charge = None + self.last_charge_date = None + self.quantity = None + self.sku_id = None + self.sku_description = None + self.availability_id = None + self.parent_product_id = None + self.invoice_section_id = None + self.invoice_section_name = None + self.billing_profile_id = None + self.billing_profile_name = None diff --git a/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..3bafba7449aa --- /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 summary. It contains a list of available + products summaries in reverse chronological order by purchase date. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of products summary. + :vartype value: list[~azure.mgmt.billing.models.ProductSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProductSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProductsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/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..d8afea8a7d89 --- /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 summary. It contains a list of available + products summaries in reverse chronological order by purchase date. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of products summary. + :vartype value: list[~azure.mgmt.billing.models.ProductSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProductSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProductsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/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..d354dbc6a36a --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RecipientTransferDetails(Model): + """Details of the transfer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar creation_time: Transfer creation time. + :vartype creation_time: datetime + :ivar expiration_time: Transfer expiration time. + :vartype expiration_time: datetime + :ivar allowed_product_type: Type of subscriptions that can be transferred. + :vartype allowed_product_type: list[str or + ~azure.mgmt.billing.models.EligibleProductType] + :ivar transfer_status: Overall transfer status. Possible values include: + 'Pending', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', + 'Canceled', 'Declined' + :vartype transfer_status: str or ~azure.mgmt.billing.models.TransferStatus + :ivar recipient_email_id: Email Id of recipient of transfer. + :vartype recipient_email_id: str + :ivar initiator_email_id: Email Id of initiator of transfer. + :vartype initiator_email_id: str + :ivar canceled_by: Email Id who user canceled the transfer. + :vartype canceled_by: str + :ivar last_modified_time: Transfer last modification time. + :vartype last_modified_time: datetime + :ivar detailed_transfer_status: Detailed transfer status. + :vartype detailed_transfer_status: + list[~azure.mgmt.billing.models.DetailedTransferStatus] + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'allowed_product_type': {'readonly': True}, + 'transfer_status': {'readonly': True}, + 'recipient_email_id': {'readonly': True}, + 'initiator_email_id': {'readonly': True}, + 'canceled_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'detailed_transfer_status': {'readonly': True}, + } + + _attribute_map = { + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'allowed_product_type': {'key': 'properties.allowedProductType', 'type': '[str]'}, + 'transfer_status': {'key': 'properties.transferStatus', 'type': 'str'}, + 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, + 'initiator_email_id': {'key': 'properties.initiatorEmailId', 'type': 'str'}, + 'canceled_by': {'key': 'properties.canceledBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'detailed_transfer_status': {'key': 'properties.detailedTransferStatus', 'type': '[DetailedTransferStatus]'}, + } + + def __init__(self, **kwargs): + super(RecipientTransferDetails, self).__init__(**kwargs) + self.creation_time = None + self.expiration_time = None + self.allowed_product_type = None + self.transfer_status = None + self.recipient_email_id = None + self.initiator_email_id = None + self.canceled_by = None + self.last_modified_time = None + self.detailed_transfer_status = None diff --git a/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..90fcfe2ab2fc --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/recipient_transfer_details_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RecipientTransferDetails(Model): + """Details of the transfer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar creation_time: Transfer creation time. + :vartype creation_time: datetime + :ivar expiration_time: Transfer expiration time. + :vartype expiration_time: datetime + :ivar allowed_product_type: Type of subscriptions that can be transferred. + :vartype allowed_product_type: list[str or + ~azure.mgmt.billing.models.EligibleProductType] + :ivar transfer_status: Overall transfer status. Possible values include: + 'Pending', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', + 'Canceled', 'Declined' + :vartype transfer_status: str or ~azure.mgmt.billing.models.TransferStatus + :ivar recipient_email_id: Email Id of recipient of transfer. + :vartype recipient_email_id: str + :ivar initiator_email_id: Email Id of initiator of transfer. + :vartype initiator_email_id: str + :ivar canceled_by: Email Id who user canceled the transfer. + :vartype canceled_by: str + :ivar last_modified_time: Transfer last modification time. + :vartype last_modified_time: datetime + :ivar detailed_transfer_status: Detailed transfer status. + :vartype detailed_transfer_status: + list[~azure.mgmt.billing.models.DetailedTransferStatus] + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'allowed_product_type': {'readonly': True}, + 'transfer_status': {'readonly': True}, + 'recipient_email_id': {'readonly': True}, + 'initiator_email_id': {'readonly': True}, + 'canceled_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'detailed_transfer_status': {'readonly': True}, + } + + _attribute_map = { + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'allowed_product_type': {'key': 'properties.allowedProductType', 'type': '[str]'}, + 'transfer_status': {'key': 'properties.transferStatus', 'type': 'str'}, + 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, + 'initiator_email_id': {'key': 'properties.initiatorEmailId', 'type': 'str'}, + 'canceled_by': {'key': 'properties.canceledBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'detailed_transfer_status': {'key': 'properties.detailedTransferStatus', 'type': '[DetailedTransferStatus]'}, + } + + def __init__(self, **kwargs) -> None: + super(RecipientTransferDetails, self).__init__(**kwargs) + self.creation_time = None + self.expiration_time = None + self.allowed_product_type = None + self.transfer_status = None + self.recipient_email_id = None + self.initiator_email_id = None + self.canceled_by = None + self.last_modified_time = None + self.detailed_transfer_status = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/resource.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/resource.py new file mode 100644 index 000000000000..246fb19f8a1a --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/resource.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): + 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/transactions_list_result.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result.py new file mode 100644 index 000000000000..156d834158bf --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TransactionsListResult(Model): + """Result of listing reservation transactions summary. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of reservation transactions summary. + :vartype value: list[~azure.mgmt.billing.models.TransactionsSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TransactionsSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TransactionsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result_py3.py new file mode 100644 index 000000000000..621cb39dc478 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_list_result_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TransactionsListResult(Model): + """Result of listing reservation transactions summary. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of reservation transactions summary. + :vartype value: list[~azure.mgmt.billing.models.TransactionsSummary] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TransactionsSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TransactionsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py new file mode 100644 index 000000000000..b614b9deb73d --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary.py @@ -0,0 +1,136 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class TransactionsSummary(Resource): + """A reservation transaction summary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param kind: The kind of transaction. Choices are all and reservation. + Possible values include: 'all', 'reservation' + :type kind: str or ~azure.mgmt.billing.models.TransactionTypeKind + :ivar date_property: The date of reservation transaction. + :vartype date_property: datetime + :ivar invoice: Invoice number or 'pending' if not invoiced. + :vartype invoice: str + :ivar order_id: The reservation order id. + :vartype order_id: str + :ivar order_name: The reservation order name. + :vartype order_name: str + :ivar product_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_name: Invoice section name to which this product + belongs. + :vartype invoice_section_name: str + :ivar billing_profile_id: Billing Profile id to which this product + belongs. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing Profile name to which this product + belongs. + :vartype billing_profile_name: str + :ivar subscription_id: The subscription id. + :vartype subscription_id: str + :ivar subscription_name: The subscription name. + :vartype subscription_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'date_property': {'readonly': True}, + 'invoice': {'readonly': True}, + 'order_id': {'readonly': True}, + 'order_name': {'readonly': True}, + 'product_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_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'subscription_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'properties.kind', 'type': 'str'}, + 'date_property': {'key': 'properties.date', 'type': 'iso-8601'}, + 'invoice': {'key': 'properties.invoice', 'type': 'str'}, + 'order_id': {'key': 'properties.orderId', 'type': 'str'}, + 'order_name': {'key': 'properties.orderName', 'type': 'str'}, + 'product_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_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TransactionsSummary, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.date_property = None + self.invoice = None + self.order_id = None + self.order_name = None + self.product_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_name = None + self.billing_profile_id = None + self.billing_profile_name = None + self.subscription_id = None + self.subscription_name = None diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_paged.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_paged.py new file mode 100644 index 000000000000..f1626e6b12ab --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class TransactionsSummaryPaged(Paged): + """ + A paging container for iterating over a list of :class:`TransactionsSummary ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TransactionsSummary]'} + } + + def __init__(self, *args, **kwargs): + + super(TransactionsSummaryPaged, self).__init__(*args, **kwargs) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py new file mode 100644 index 000000000000..8e438dbdf077 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transactions_summary_py3.py @@ -0,0 +1,136 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class TransactionsSummary(Resource): + """A reservation transaction summary resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param kind: The kind of transaction. Choices are all and reservation. + Possible values include: 'all', 'reservation' + :type kind: str or ~azure.mgmt.billing.models.TransactionTypeKind + :ivar date_property: The date of reservation transaction. + :vartype date_property: datetime + :ivar invoice: Invoice number or 'pending' if not invoiced. + :vartype invoice: str + :ivar order_id: The reservation order id. + :vartype order_id: str + :ivar order_name: The reservation order name. + :vartype order_name: str + :ivar product_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_name: Invoice section name to which this product + belongs. + :vartype invoice_section_name: str + :ivar billing_profile_id: Billing Profile id to which this product + belongs. + :vartype billing_profile_id: str + :ivar billing_profile_name: Billing Profile name to which this product + belongs. + :vartype billing_profile_name: str + :ivar subscription_id: The subscription id. + :vartype subscription_id: str + :ivar subscription_name: The subscription name. + :vartype subscription_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'date_property': {'readonly': True}, + 'invoice': {'readonly': True}, + 'order_id': {'readonly': True}, + 'order_name': {'readonly': True}, + 'product_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_name': {'readonly': True}, + 'billing_profile_id': {'readonly': True}, + 'billing_profile_name': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'subscription_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'properties.kind', 'type': 'str'}, + 'date_property': {'key': 'properties.date', 'type': 'iso-8601'}, + 'invoice': {'key': 'properties.invoice', 'type': 'str'}, + 'order_id': {'key': 'properties.orderId', 'type': 'str'}, + 'order_name': {'key': 'properties.orderName', 'type': 'str'}, + 'product_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_name': {'key': 'properties.invoiceSectionName', 'type': 'str'}, + 'billing_profile_id': {'key': 'properties.billingProfileId', 'type': 'str'}, + 'billing_profile_name': {'key': 'properties.billingProfileName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, + } + + def __init__(self, *, kind=None, transaction_type=None, **kwargs) -> None: + super(TransactionsSummary, self).__init__(**kwargs) + self.kind = kind + self.date_property = None + self.invoice = None + self.order_id = None + self.order_name = None + self.product_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_name = None + self.billing_profile_id = None + self.billing_profile_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..db0e4281ef8c --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TransferBillingSubscriptionRequest(Model): + """Request parameters to transfer billing subscription. + + :param destination_invoice_section_id: The destination invoice section id. + :type destination_invoice_section_id: str + """ + + _attribute_map = { + 'destination_invoice_section_id': {'key': 'properties.destinationInvoiceSectionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TransferBillingSubscriptionRequest, self).__init__(**kwargs) + self.destination_invoice_section_id = kwargs.get('destination_invoice_section_id', None) diff --git a/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..0f9174df2be3 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TransferBillingSubscriptionRequestProperties(Model): + """Request parameters to transfer billing subscription. + + :param destination_invoice_section_id: The destination invoice section id. + :type destination_invoice_section_id: str + """ + + _attribute_map = { + 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TransferBillingSubscriptionRequestProperties, self).__init__(**kwargs) + self.destination_invoice_section_id = kwargs.get('destination_invoice_section_id', None) diff --git a/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..ceb12cf89262 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_properties_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TransferBillingSubscriptionRequestProperties(Model): + """Request parameters to transfer billing subscription. + + :param destination_invoice_section_id: The destination invoice section id. + :type destination_invoice_section_id: str + """ + + _attribute_map = { + 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, + } + + def __init__(self, *, destination_invoice_section_id: str=None, **kwargs) -> None: + super(TransferBillingSubscriptionRequestProperties, self).__init__(**kwargs) + self.destination_invoice_section_id = destination_invoice_section_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..707b9e89ef01 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_billing_subscription_request_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TransferBillingSubscriptionRequest(Model): + """Request parameters to transfer billing subscription. + + :param destination_invoice_section_id: The destination invoice section id. + :type destination_invoice_section_id: str + """ + + _attribute_map = { + 'destination_invoice_section_id': {'key': 'properties.destinationInvoiceSectionId', 'type': 'str'}, + } + + def __init__(self, *, destination_invoice_section_id: str=None, **kwargs) -> None: + super(TransferBillingSubscriptionRequest, self).__init__(**kwargs) + self.destination_invoice_section_id = destination_invoice_section_id diff --git a/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..9355b9f49ce2 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details.py @@ -0,0 +1,83 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TransferDetails(Model): + """Details of the transfer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar creation_time: Transfer creation time. + :vartype creation_time: datetime + :ivar expiration_time: Transfer expiration time. + :vartype expiration_time: datetime + :ivar invoice_section_id: Target invoice section Id. + :vartype invoice_section_id: str + :ivar billing_account_id: Target billing account Id. + :vartype billing_account_id: str + :ivar transfer_status: Overall transfer status. Possible values include: + 'Pending', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', + 'Canceled', 'Declined' + :vartype transfer_status: str or ~azure.mgmt.billing.models.TransferStatus + :ivar recipient_email_id: Email Id of recipient of transfer. + :vartype recipient_email_id: str + :ivar initiator_email_id: Email Id of initiator of transfer. + :vartype initiator_email_id: str + :ivar canceled_by: Email Id who user canceled the transfer. + :vartype canceled_by: str + :ivar last_modified_time: Transfer last modification time. + :vartype last_modified_time: datetime + :ivar detailed_transfer_status: Detailed transfer status. + :vartype detailed_transfer_status: + list[~azure.mgmt.billing.models.DetailedTransferStatus] + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'billing_account_id': {'readonly': True}, + 'transfer_status': {'readonly': True}, + 'recipient_email_id': {'readonly': True}, + 'initiator_email_id': {'readonly': True}, + 'canceled_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'detailed_transfer_status': {'readonly': True}, + } + + _attribute_map = { + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, + 'transfer_status': {'key': 'properties.transferStatus', 'type': 'str'}, + 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, + 'initiator_email_id': {'key': 'properties.initiatorEmailId', 'type': 'str'}, + 'canceled_by': {'key': 'properties.canceledBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'detailed_transfer_status': {'key': 'properties.detailedTransferStatus', 'type': '[DetailedTransferStatus]'}, + } + + def __init__(self, **kwargs): + super(TransferDetails, self).__init__(**kwargs) + self.creation_time = None + self.expiration_time = None + self.invoice_section_id = None + self.billing_account_id = None + self.transfer_status = None + self.recipient_email_id = None + self.initiator_email_id = None + self.canceled_by = None + self.last_modified_time = None + self.detailed_transfer_status = None diff --git a/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..53670056ccf4 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_details_py3.py @@ -0,0 +1,83 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TransferDetails(Model): + """Details of the transfer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar creation_time: Transfer creation time. + :vartype creation_time: datetime + :ivar expiration_time: Transfer expiration time. + :vartype expiration_time: datetime + :ivar invoice_section_id: Target invoice section Id. + :vartype invoice_section_id: str + :ivar billing_account_id: Target billing account Id. + :vartype billing_account_id: str + :ivar transfer_status: Overall transfer status. Possible values include: + 'Pending', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', + 'Canceled', 'Declined' + :vartype transfer_status: str or ~azure.mgmt.billing.models.TransferStatus + :ivar recipient_email_id: Email Id of recipient of transfer. + :vartype recipient_email_id: str + :ivar initiator_email_id: Email Id of initiator of transfer. + :vartype initiator_email_id: str + :ivar canceled_by: Email Id who user canceled the transfer. + :vartype canceled_by: str + :ivar last_modified_time: Transfer last modification time. + :vartype last_modified_time: datetime + :ivar detailed_transfer_status: Detailed transfer status. + :vartype detailed_transfer_status: + list[~azure.mgmt.billing.models.DetailedTransferStatus] + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'invoice_section_id': {'readonly': True}, + 'billing_account_id': {'readonly': True}, + 'transfer_status': {'readonly': True}, + 'recipient_email_id': {'readonly': True}, + 'initiator_email_id': {'readonly': True}, + 'canceled_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'detailed_transfer_status': {'readonly': True}, + } + + _attribute_map = { + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'invoice_section_id': {'key': 'properties.invoiceSectionId', 'type': 'str'}, + 'billing_account_id': {'key': 'properties.billingAccountId', 'type': 'str'}, + 'transfer_status': {'key': 'properties.transferStatus', 'type': 'str'}, + 'recipient_email_id': {'key': 'properties.recipientEmailId', 'type': 'str'}, + 'initiator_email_id': {'key': 'properties.initiatorEmailId', 'type': 'str'}, + 'canceled_by': {'key': 'properties.canceledBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'detailed_transfer_status': {'key': 'properties.detailedTransferStatus', 'type': '[DetailedTransferStatus]'}, + } + + def __init__(self, **kwargs) -> None: + super(TransferDetails, self).__init__(**kwargs) + self.creation_time = None + self.expiration_time = None + self.invoice_section_id = None + self.billing_account_id = None + self.transfer_status = None + self.recipient_email_id = None + self.initiator_email_id = None + self.canceled_by = None + self.last_modified_time = None + self.detailed_transfer_status = None diff --git a/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..9feaa795f8f8 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TransferProductRequestProperties(Model): + """The properties of the product to initiate a transfer. + + :param destination_invoice_section_id: Destination invoice section id. + :type destination_invoice_section_id: str + """ + + _attribute_map = { + 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TransferProductRequestProperties, self).__init__(**kwargs) + self.destination_invoice_section_id = kwargs.get('destination_invoice_section_id', None) diff --git a/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..029af2856f0e --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/transfer_product_request_properties_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TransferProductRequestProperties(Model): + """The properties of the product to initiate a transfer. + + :param destination_invoice_section_id: Destination invoice section id. + :type destination_invoice_section_id: str + """ + + _attribute_map = { + 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, + } + + def __init__(self, *, destination_invoice_section_id: str=None, **kwargs) -> None: + super(TransferProductRequestProperties, self).__init__(**kwargs) + self.destination_invoice_section_id = destination_invoice_section_id diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary.py new file mode 100644 index 000000000000..58c13360fb33 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UpdateAutoRenewOperationSummary(Model): + """Summary of cancel product operation. + + :param end_date: The end date of this asset + :type end_date: datetime + """ + + _attribute_map = { + 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(UpdateAutoRenewOperationSummary, self).__init__(**kwargs) + self.end_date = kwargs.get('end_date', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary_py3.py new file mode 100644 index 000000000000..df7e37b21cd6 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/update_auto_renew_operation_summary_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UpdateAutoRenewOperationSummary(Model): + """Summary of cancel product operation. + + :param end_date: The end date of this asset + :type end_date: datetime + """ + + _attribute_map = { + 'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'}, + } + + def __init__(self, *, end_date=None, **kwargs) -> None: + super(UpdateAutoRenewOperationSummary, self).__init__(**kwargs) + self.end_date = end_date diff --git a/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..387605d5e931 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ValidateAddressResponse(Model): + """Result of the address validation. + + :param status: status of the address validation. Possible values include: + 'Valid', 'Invalid' + :type status: str or ~azure.mgmt.billing.models.AddressValidationStatus + :param suggested_addresses: list of suggested addresses. + :type suggested_addresses: list[~azure.mgmt.billing.models.Address] + :param validation_message: Validation error message. + :type validation_message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'suggested_addresses': {'key': 'suggestedAddresses', 'type': '[Address]'}, + 'validation_message': {'key': 'validationMessage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ValidateAddressResponse, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.suggested_addresses = kwargs.get('suggested_addresses', None) + self.validation_message = kwargs.get('validation_message', None) diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response_py3.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response_py3.py new file mode 100644 index 000000000000..9e01d7871ec4 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/models/validate_address_response_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ValidateAddressResponse(Model): + """Result of the address validation. + + :param status: status of the address validation. Possible values include: + 'Valid', 'Invalid' + :type status: str or ~azure.mgmt.billing.models.AddressValidationStatus + :param suggested_addresses: list of suggested addresses. + :type suggested_addresses: list[~azure.mgmt.billing.models.Address] + :param validation_message: Validation error message. + :type validation_message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'suggested_addresses': {'key': 'suggestedAddresses', 'type': '[Address]'}, + 'validation_message': {'key': 'validationMessage', 'type': 'str'}, + } + + def __init__(self, *, status=None, suggested_addresses=None, validation_message: str=None, **kwargs) -> None: + super(ValidateAddressResponse, self).__init__(**kwargs) + self.status = status + self.suggested_addresses = suggested_addresses + self.validation_message = validation_message diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.py new file mode 100644 index 000000000000..d9a2ca49fe76 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/__init__.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 .billing_accounts_operations import BillingAccountsOperations +from .payment_methods_operations import PaymentMethodsOperations +from .billing_accounts_validate_address_operations import BillingAccountsValidateAddressOperations +from .available_balances_operations import AvailableBalancesOperations +from .billing_profiles_operations import BillingProfilesOperations +from .invoice_sections_operations import InvoiceSectionsOperations +from .departments_operations import DepartmentsOperations +from .enrollment_accounts_operations import EnrollmentAccountsOperations +from .invoices_operations import InvoicesOperations +from .price_sheet_operations import PriceSheetOperations +from .billing_subscriptions_operations import BillingSubscriptionsOperations +from .products_operations import ProductsOperations +from .transactions_operations import TransactionsOperations +from .policies_operations import PoliciesOperations +from .billing_property_operations import BillingPropertyOperations +from .transfers_operations import TransfersOperations +from .recipient_transfers_operations import RecipientTransfersOperations +from .operations import Operations +from .billing_permissions_operations import BillingPermissionsOperations +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', + 'BillingAccountsValidateAddressOperations', + 'AvailableBalancesOperations', + 'BillingProfilesOperations', + 'InvoiceSectionsOperations', + 'DepartmentsOperations', + 'EnrollmentAccountsOperations', + 'InvoicesOperations', + 'PriceSheetOperations', + 'BillingSubscriptionsOperations', + 'ProductsOperations', + 'TransactionsOperations', + 'PoliciesOperations', + 'BillingPropertyOperations', + 'TransfersOperations', + 'RecipientTransfersOperations', + 'Operations', + 'BillingPermissionsOperations', + 'BillingRoleDefinitionsOperations', + 'BillingRoleAssignmentsOperations', + 'AgreementsOperations', + 'LineOfCreditsOperations', +] 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..edab2766fb75 --- /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 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list_by_billing_account_name( + 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_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') + + # 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_name.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..f425396e08b1 --- /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 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get_by_billing_profile( + self, billing_account_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..e2df4e98e87d --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_operations.py @@ -0,0 +1,155 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BillingAccountsOperations(object): + """BillingAccountsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all billing accounts for a user which he has access to. + + :param expand: May be used to expand the invoiceSections and + billingProfiles. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingAccountListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingAccountListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingAccountListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts'} + + def get( + self, billing_account_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 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}'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_validate_address_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_validate_address_operations.py new file mode 100644 index 000000000000..d9d42f694909 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_accounts_validate_address_operations.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BillingAccountsValidateAddressOperations(object): + """BillingAccountsValidateAddressOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def post( + self, billing_account_name, address, custom_headers=None, raw=False, **operation_config): + """Validates the address. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param address: + :type address: ~azure.mgmt.billing.models.Address + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ValidateAddressResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.ValidateAddressResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.post.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(address, 'Address') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ValidateAddressResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + post.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/validateAddress'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py new file mode 100644 index 000000000000..f31a5475cb64 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_permissions_operations.py @@ -0,0 +1,214 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list_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}/providers/Microsoft.Billing/billingPermissions'} + + def list_by_invoice_sections( + self, billing_account_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 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'), + '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}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingPermissions'} + + def list_by_billing_profile( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """Lists all billingPermissions for the caller has for a billing account. + + :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}/providers/Microsoft.Billing/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..d98add3bbe9f --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_profiles_operations.py @@ -0,0 +1,274 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class BillingProfilesOperations(object): + """BillingProfilesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list_by_billing_account_name( + 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_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') + + # 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_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles'} + + def get( + self, billing_account_name, billing_profile_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the billing profile by id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param expand: May be used to expand the invoiceSections. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingProfile or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingProfile or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingProfile', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}'} + + + def _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.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('BillingProfile', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def update( + self, billing_account_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: 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..38d4ca1f0ce3 --- /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 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, custom_headers=None, raw=False, **operation_config): + """Get billing property by subscription Id. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingProperty or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingProperty or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingProperty', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingProperty'} diff --git a/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..1bb2361d9cf9 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_assignments_operations.py @@ -0,0 +1,787 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get_by_billing_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}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def delete_by_billing_account_name( + 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_name.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_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def get_by_invoice_section_name( + self, billing_account_name, invoice_section_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignment for the caller on the invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_role_assignment_name: role assignment id. + :type billing_role_assignment_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_invoice_section_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def delete_by_invoice_section_name( + self, billing_account_name, invoice_section_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """Delete the role assignment on the invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_role_assignment_name: role assignment id. + :type billing_role_assignment_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingRoleAssignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignment or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_by_invoice_section_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingRoleAssignmentName': self._serialize.url("billing_role_assignment_name", billing_role_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def get_by_billing_profile_name( + self, billing_account_name, billing_profile_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """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_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + '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_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def delete_by_billing_profile_name( + self, billing_account_name, billing_profile_name, billing_role_assignment_name, custom_headers=None, raw=False, **operation_config): + """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_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + '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_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}'} + + def list_by_billing_account_name( + 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_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') + + # 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_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments'} + + def add_by_billing_account_name( + self, billing_account_name, custom_headers=None, raw=False, **operation_config): + """The operation to add a role assignment to a billing account. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = None + + # Construct URL + url = self.add_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') + + # 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_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/createBillingRoleAssignment'} + + def list_by_invoice_section_name( + self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Get the role assignments on the invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_invoice_section_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments'} + + def add_by_invoice_section_name( + self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """The operation to add a role assignment to a invoice Section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = None + + # Construct URL + url = self.add_by_invoice_section_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'BillingRoleAssignmentPayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('BillingRoleAssignmentListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/createBillingRoleAssignment'} + + def list_by_billing_profile_name( + 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_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.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_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleAssignments'} + + def add_by_billing_profile_name( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """The operation to add a role assignment to a billing profile. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param billing_profile_name: Billing Profile Id. + :type billing_profile_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingRoleAssignmentListResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleAssignmentListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = None + + # Construct URL + url = self.add_by_billing_profile_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/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..9ee44c433066 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_role_definitions_operations.py @@ -0,0 +1,403 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get_by_billing_account_name( + 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_name.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_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}'} + + def get_by_invoice_section_name( + self, billing_account_name, invoice_section_name, billing_role_definition_name, custom_headers=None, raw=False, **operation_config): + """Gets the role definition for a role. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_role_definition_name: role definition id. + :type billing_role_definition_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingRoleDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingRoleDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_invoice_section_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingRoleDefinitionName': self._serialize.url("billing_role_definition_name", billing_role_definition_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}'} + + def get_by_billing_profile_name( + self, billing_account_name, billing_profile_name, billing_role_definition_name, custom_headers=None, raw=False, **operation_config): + """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_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str'), + '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_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}'} + + def list_by_billing_account_name( + 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_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') + + # 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_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleDefinitions'} + + def list_by_invoice_section_name( + self, billing_account_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 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_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingRoleDefinitionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleDefinitions'} + + def list_by_billing_profile_name( + 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_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.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_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/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..c713b7e251c4 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/billing_subscriptions_operations.py @@ -0,0 +1,408 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list_by_billing_account_name( + 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 BillingSubscriptionSummary + :rtype: + ~azure.mgmt.billing.models.BillingSubscriptionSummaryPaged[~azure.mgmt.billing.models.BillingSubscriptionSummary] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.BillingSubscriptionSummaryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BillingSubscriptionSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions'} + + def list_by_billing_profile_name( + 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_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.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_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingSubscriptions'} + + def list_by_invoice_section_name( + self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Lists billing subscription by invoice section name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: 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_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingSubscriptionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions'} + + def get( + self, billing_account_name, invoice_section_name, billing_subscription_name, custom_headers=None, raw=False, **operation_config): + """Get a single billing subscription by name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_subscription_name: Billing Subscription Id. + :type billing_subscription_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingSubscriptionSummary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.BillingSubscriptionSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingSubscriptionName': self._serialize.url("billing_subscription_name", billing_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BillingSubscriptionSummary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}'} + + + def _transfer_initial( + self, billing_account_name, invoice_section_name, billing_subscription_name, destination_invoice_section_id=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TransferBillingSubscriptionRequestProperties(destination_invoice_section_id=destination_invoice_section_id) + + # Construct URL + url = self.transfer.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'billingSubscriptionName': self._serialize.url("billing_subscription_name", billing_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TransferBillingSubscriptionRequestProperties') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('TransferBillingSubscriptionResult', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + 'Azure-AsyncOperation': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def transfer( + self, billing_account_name, invoice_section_name, billing_subscription_name, destination_invoice_section_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 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 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, + invoice_section_name=invoice_section_name, + billing_subscription_name=billing_subscription_name, + destination_invoice_section_id=destination_invoice_section_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + 'Azure-AsyncOperation': 'str', + } + deserialized = self._deserialize('TransferBillingSubscriptionResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/transfer'} 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..dd5044ad7ef5 --- /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 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list_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 new file mode 100644 index 000000000000..b996cb2b6890 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/enrollment_accounts_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 EnrollmentAccountsOperations(object): + """EnrollmentAccountsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list_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: EnrollmentAccountListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.EnrollmentAccountListResult 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('EnrollmentAccountListResult', 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}/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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EnrollmentAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.EnrollmentAccount or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_enrollment_account_id.metadata['url'] + path_format_arguments = { + '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['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('EnrollmentAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + 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..ef9c355efe1c --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoice_sections_operations.py @@ -0,0 +1,567 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class InvoiceSectionsOperations(object): + """InvoiceSectionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list_by_billing_account_name( + self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all invoice sections for a user which he has access to. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param expand: May be used to expand the billingProfiles. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :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_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') + + # 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_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections'} + + + def _create_initial( + self, billing_account_name, display_name=None, billing_profiles=None, custom_headers=None, raw=False, **operation_config): + parameters = models.InvoiceSectionProperties(display_name=display_name, billing_profiles=billing_profiles) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + '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, 'InvoiceSectionProperties') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceSection', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + 'Azure-AsyncOperation': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def create( + self, billing_account_name, display_name=None, billing_profiles=None, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to create a InvoiceSection. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param display_name: The name of the InvoiceSection. + :type display_name: str + :param billing_profiles: The billing profiles associated to the + billing account. + :type billing_profiles: + list[~azure.mgmt.billing.models.BillingProfile] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns InvoiceSection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.InvoiceSection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.InvoiceSection]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_initial( + billing_account_name=billing_account_name, + display_name=display_name, + billing_profiles=billing_profiles, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + 'Azure-AsyncOperation': 'str', + } + deserialized = self._deserialize('InvoiceSection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections'} + + def list_by_billing_profile_name( + self, billing_account_name, billing_profile_name, custom_headers=None, raw=False, **operation_config): + """Lists all invoice sections under a billing profile for a user which he + has access to. + + :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_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.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_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections'} + + def list_by_create_subscription_permission( + self, billing_account_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all invoiceSections with create subscription permission for a + user. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param expand: May be used to expand the billingProfiles. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: InvoiceSectionListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceSectionListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_create_subscription_permission.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str') + } + 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('InvoiceSectionListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_create_subscription_permission.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/listInvoiceSectionsWithCreateSubscriptionPermission'} + + def get( + self, billing_account_name, invoice_section_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the InvoiceSection by id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param expand: May be used to expand the billingProfiles. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: InvoiceSection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceSection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceSection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}'} + + + def _update_initial( + self, billing_account_name, invoice_section_name, display_name=None, billing_profiles=None, custom_headers=None, raw=False, **operation_config): + parameters = models.InvoiceSection(display_name=display_name, billing_profiles=billing_profiles) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'InvoiceSection') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceSection', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def update( + self, billing_account_name, invoice_section_name, display_name=None, billing_profiles=None, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to update a InvoiceSection. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param display_name: The name of the InvoiceSection. + :type display_name: str + :param billing_profiles: The billing profiles associated to the + billing account. + :type billing_profiles: + list[~azure.mgmt.billing.models.BillingProfile] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns InvoiceSection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.billing.models.InvoiceSection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.billing.models.InvoiceSection]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._update_initial( + billing_account_name=billing_account_name, + invoice_section_name=invoice_section_name, + display_name=display_name, + billing_profiles=billing_profiles, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + } + deserialized = self._deserialize('InvoiceSection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}'} + + def elevate_to_billing_profile( + self, billing_account_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 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'), + '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}/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 new file mode 100644 index 000000000000..c5ed960009b8 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/invoices_operations.py @@ -0,0 +1,229 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class InvoicesOperations(object): + """InvoicesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list_by_billing_account_name( + 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: InvoiceListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceListResult 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') + query_parameters['periodStartDate'] = self._serialize.query("period_start_date", period_start_date, 'str') + query_parameters['periodEndDate'] = self._serialize.query("period_end_date", period_end_date, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_billing_account_name.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: InvoiceListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceListResult 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['periodStartDate'] = self._serialize.query("period_start_date", period_start_date, 'str') + query_parameters['periodEndDate'] = self._serialize.query("period_end_date", period_end_date, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: InvoiceSummary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.InvoiceSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + '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.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('InvoiceSummary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{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..dd7bf04d7df4 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/line_of_credits_operations.py @@ -0,0 +1,204 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class LineOfCreditsOperations(object): + """LineOfCreditsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, custom_headers=None, raw=False, **operation_config): + """Get the current line of credit. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LineOfCredit or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.LineOfCredit or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LineOfCredit', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingAccounts/default/lineOfCredit/default'} + + + def _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', + 'Azure-AsyncOperation': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def 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', + 'Azure-AsyncOperation': 'str', + } + 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 new file mode 100644 index 000000000000..09088dd24e9a --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/operations.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available billing REST API operations. + + :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 Operation + :rtype: + ~azure.mgmt.billing.models.OperationPaged[~azure.mgmt.billing.models.Operation] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/operations'} 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..462791ae4262 --- /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 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list_by_billing_account_name( + 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_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') + + 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_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/paymentMethods'} + + def list_by_billing_profile_name( + 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_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + 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_name.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..1dcbc3d125e7 --- /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 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get_by_billing_profile_name( + 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_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.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_name.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..b2e7e67f49b5 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/price_sheet_operations.py @@ -0,0 +1,145 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class 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 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + + def _download_initial( + self, billing_account_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'), + 'invoiceName': self._serialize.url("invoice_name", invoice_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('DownloadUrl', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + 'Azure-AsyncOperation': 'str', + 'OData-EntityId': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def download( + self, billing_account_name, invoice_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Download price sheet for an invoice. + + :param billing_account_name: Azure Billing Account ID. + :type billing_account_name: str + :param invoice_name: The name of an invoice resource. + :type invoice_name: str + :param dict custom_headers: headers that will be added to the request + :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, + invoice_name=invoice_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Retry-After': 'str', + 'Azure-AsyncOperation': 'str', + 'OData-EntityId': 'str', + } + deserialized = self._deserialize('DownloadUrl', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + download.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/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..94d18ee0f768 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/products_operations.py @@ -0,0 +1,460 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ProductsOperations(object): + """ProductsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list_by_billing_account_name( + 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 ProductSummary + :rtype: + ~azure.mgmt.billing.models.ProductSummaryPaged[~azure.mgmt.billing.models.ProductSummary] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_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 filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ProductSummaryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ProductSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products'} + + def list_by_invoice_section_name( + self, billing_account_name, invoice_section_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists products by invoice section name. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param filter: May be used to filter by product type. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + 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_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + 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_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products'} + + def get( + self, billing_account_name, invoice_section_name, product_name, custom_headers=None, raw=False, **operation_config): + """Get a single product by name. + + :param billing_account_name: billing Account Id. + :type billing_account_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: ProductSummary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.ProductSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'productName': self._serialize.url("product_name", product_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ProductSummary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}'} + + def transfer( + self, billing_account_name, invoice_section_name, product_name, destination_invoice_section_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 invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param product_name: Invoice Id. + :type product_name: str + :param destination_invoice_section_id: Destination invoice section id. + :type destination_invoice_section_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ProductSummary or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.ProductSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.TransferProductRequestProperties(destination_invoice_section_id=destination_invoice_section_id) + + # Construct URL + url = self.transfer.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'productName': self._serialize.url("product_name", product_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TransferProductRequestProperties') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ProductSummary', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + 'Azure-AsyncOperation': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + transfer.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}/transfer'} + + def update_auto_renew_by_billing_account_name( + 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: UpdateAutoRenewOperationSummary or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.UpdateAutoRenewOperationSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + body = models.UpdateAutoRenewRequest(auto_renew=auto_renew) + + # Construct URL + url = self.update_auto_renew_by_billing_account_name.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('UpdateAutoRenewOperationSummary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_auto_renew_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/updateAutoRenew'} + + def update_auto_renew_by_invoice_section_name( + self, billing_account_name, invoice_section_name, product_name, auto_renew=None, custom_headers=None, raw=False, **operation_config): + """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 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: UpdateAutoRenewOperationSummary or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.billing.models.UpdateAutoRenewOperationSummary or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + body = models.UpdateAutoRenewRequest(auto_renew=auto_renew) + + # Construct URL + url = self.update_auto_renew_by_invoice_section_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'productName': self._serialize.url("product_name", product_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'UpdateAutoRenewRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('UpdateAutoRenewOperationSummary', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_auto_renew_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/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..04d1f8d4dd43 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/recipient_transfers_operations.py @@ -0,0 +1,269 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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` + """ + body = models.AcceptTransferRequest(product_details=product_details) + + # Construct URL + url = self.accept.metadata['url'] + path_format_arguments = { + 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'AcceptTransferRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RecipientTransferDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + accept.metadata = {'url': '/providers/Microsoft.Billing/transfers/{transferName}/acceptTransfer'} + + def decline( + self, transfer_name, custom_headers=None, raw=False, **operation_config): + """Declines the transfer with given transfer Id. + + :param transfer_name: Transfer Name. + :type transfer_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RecipientTransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.RecipientTransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.decline.metadata['url'] + path_format_arguments = { + 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RecipientTransferDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + decline.metadata = {'url': '/providers/Microsoft.Billing/transfers/{transferName}/declineTransfer'} + + 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..3b5566d34793 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transactions_operations.py @@ -0,0 +1,264 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 2018-11-01-preview. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list_by_billing_account_name( + 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 TransactionsSummary + :rtype: + ~azure.mgmt.billing.models.TransactionsSummaryPaged[~azure.mgmt.billing.models.TransactionsSummary] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_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') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.TransactionsSummaryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TransactionsSummaryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_billing_account_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/transactions'} + + def list_by_billing_profile_name( + 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: TransactionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransactionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_billing_profile_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'billingProfileName': self._serialize.url("billing_profile_name", billing_profile_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransactionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_billing_profile_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/transactions'} + + def list_by_invoice_section_name( + self, billing_account_name, invoice_section_name, start_date, end_date, filter=None, custom_headers=None, raw=False, **operation_config): + """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 invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param start_date: Start date + :type start_date: str + :param end_date: End date + :type end_date: str + :param filter: May be used to filter by transaction kind. The filter + supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not + currently support 'ne', 'or', or 'not'. Tag filter is a key value pair + string where key and value is separated by a colon (:). + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TransactionsListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransactionsListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_invoice_section_name.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') + query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransactionsListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_invoice_section_name.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transactions'} 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..2daf9f4588e8 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/operations/transfers_operations.py @@ -0,0 +1,296 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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, invoice_section_name, billing_profile_id=None, recipient_email_id=None, custom_headers=None, raw=False, **operation_config): + """Initiates the request to transfer the legacy subscriptions or RIs. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param billing_profile_id: Target Usage context for devTest + subscriptions. + :type billing_profile_id: str + :param recipient_email_id: Email Id of recipient for transfer. + :type recipient_email_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + body = models.InitiateTransferRequest(billing_profile_id=billing_profile_id, recipient_email_id=recipient_email_id) + + # Construct URL + url = self.initiate.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'InitiateTransferRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransferDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + initiate.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/initiateTransfer'} + + def get( + self, billing_account_name, invoice_section_name, transfer_name, custom_headers=None, raw=False, **operation_config): + """Gets the transfer details for given transfer Id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param transfer_name: Transfer Name. + :type transfer_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransferDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}'} + + def cancel( + self, billing_account_name, invoice_section_name, transfer_name, custom_headers=None, raw=False, **operation_config): + """Cancels the transfer for given transfer Id. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param transfer_name: Transfer Name. + :type transfer_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TransferDetails or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.billing.models.TransferDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.cancel.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str'), + 'transferName': self._serialize.url("transfer_name", transfer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TransferDetails', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + cancel.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}'} + + def list( + self, billing_account_name, invoice_section_name, custom_headers=None, raw=False, **operation_config): + """Lists all transfer's details initiated from given invoice section. + + :param billing_account_name: billing Account Id. + :type billing_account_name: str + :param invoice_section_name: InvoiceSection Id. + :type invoice_section_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TransferDetails + :rtype: + ~azure.mgmt.billing.models.TransferDetailsPaged[~azure.mgmt.billing.models.TransferDetails] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'billingAccountName': self._serialize.url("billing_account_name", billing_account_name, 'str'), + 'invoiceSectionName': self._serialize.url("invoice_section_name", invoice_section_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.TransferDetailsPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TransferDetailsPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transfers'} diff --git a/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/version.py b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/version.py new file mode 100644 index 000000000000..3e682bbd5fb1 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/azure/mgmt/billing/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "0.3.0" + diff --git a/sdk/billing/azure-mgmt-billing/sdk_packaging.toml b/sdk/billing/azure-mgmt-billing/sdk_packaging.toml new file mode 100644 index 000000000000..37e5b38d73c5 --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-billing" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/sdk/billing/azure-mgmt-billing/setup.cfg b/sdk/billing/azure-mgmt-billing/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/billing/azure-mgmt-billing/setup.py b/sdk/billing/azure-mgmt-billing/setup.py new file mode 100644 index 000000000000..946b7232e50d --- /dev/null +++ b/sdk/billing/azure-mgmt-billing/setup.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-billing" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + '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', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +)