# pylint: disable=line-too-long,useless-suppression,too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=useless-super-delegation

import datetime
from typing import Any, Mapping, Optional, TYPE_CHECKING, Union, overload

from .._utils.model_base import Model as _Model, rest_field

if TYPE_CHECKING:
    from .. import models as _models


class AcceptTransferProperties(_Model):
    """Request parameters to accept transfer.

    :ivar product_details: Request parameters to accept transfer.
    :vartype product_details: list[~azure.mgmt.billing.models.ProductDetails]
    """

    product_details: Optional[list["_models.ProductDetails"]] = rest_field(
        name="productDetails", visibility=["read", "create", "update", "delete", "query"]
    )
    """Request parameters to accept transfer."""

    @overload
    def __init__(
        self,
        *,
        product_details: Optional[list["_models.ProductDetails"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class AcceptTransferRequest(_Model):
    """Request parameters to accept transfer.

    :ivar properties: Request parameters to accept transfer.
    :vartype properties: ~azure.mgmt.billing.models.AcceptTransferProperties
    """

    properties: Optional["_models.AcceptTransferProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Request parameters to accept transfer."""

    __flattened_items = ["product_details"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.AcceptTransferProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class AddressDetails(_Model):
    """Address details.

    :ivar address_line1: Address line 1. Required.
    :vartype address_line1: str
    :ivar address_line2: Address line 2.
    :vartype address_line2: str
    :ivar address_line3: Address line 3.
    :vartype address_line3: str
    :ivar city: Address city.
    :vartype city: str
    :ivar company_name: Company name. Optional for MCA Individual (Pay-as-you-go).
    :vartype company_name: str
    :ivar country: Country code uses ISO 3166-1 Alpha-2 format. Required.
    :vartype country: str
    :ivar district: Address district.
    :vartype district: str
    :ivar email: Email address.
    :vartype email: str
    :ivar first_name: First name. Optional for MCA Enterprise.
    :vartype first_name: str
    :ivar last_name: Last name. Optional for MCA Enterprise.
    :vartype last_name: str
    :ivar middle_name: Middle name.
    :vartype middle_name: str
    :ivar phone_number: Phone number.
    :vartype phone_number: str
    :ivar postal_code: Postal code.
    :vartype postal_code: str
    :ivar region: Address region.
    :vartype region: str
    :ivar is_valid_address: Indicates if the address is incomplete.
    :vartype is_valid_address: bool
    """

    address_line1: str = rest_field(name="addressLine1", visibility=["read", "create", "update", "delete", "query"])
    """Address line 1. Required."""
    address_line2: Optional[str] = rest_field(
        name="addressLine2", visibility=["read", "create", "update", "delete", "query"]
    )
    """Address line 2."""
    address_line3: Optional[str] = rest_field(
        name="addressLine3", visibility=["read", "create", "update", "delete", "query"]
    )
    """Address line 3."""
    city: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Address city."""
    company_name: Optional[str] = rest_field(
        name="companyName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Company name. Optional for MCA Individual (Pay-as-you-go)."""
    country: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Country code uses ISO 3166-1 Alpha-2 format. Required."""
    district: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Address district."""
    email: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Email address."""
    first_name: Optional[str] = rest_field(name="firstName", visibility=["read", "create", "update", "delete", "query"])
    """First name. Optional for MCA Enterprise."""
    last_name: Optional[str] = rest_field(name="lastName", visibility=["read", "create", "update", "delete", "query"])
    """Last name. Optional for MCA Enterprise."""
    middle_name: Optional[str] = rest_field(
        name="middleName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Middle name."""
    phone_number: Optional[str] = rest_field(
        name="phoneNumber", visibility=["read", "create", "update", "delete", "query"]
    )
    """Phone number."""
    postal_code: Optional[str] = rest_field(
        name="postalCode", visibility=["read", "create", "update", "delete", "query"]
    )
    """Postal code."""
    region: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Address region."""
    is_valid_address: Optional[bool] = rest_field(
        name="isValidAddress", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates if the address is incomplete."""

    @overload
    def __init__(
        self,
        *,
        address_line1: str,
        country: str,
        address_line2: Optional[str] = None,
        address_line3: Optional[str] = None,
        city: Optional[str] = None,
        company_name: Optional[str] = None,
        district: Optional[str] = None,
        email: Optional[str] = None,
        first_name: Optional[str] = None,
        last_name: Optional[str] = None,
        middle_name: Optional[str] = None,
        phone_number: Optional[str] = None,
        postal_code: Optional[str] = None,
        region: Optional[str] = None,
        is_valid_address: Optional[bool] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class AddressValidationResponse(_Model):
    """Result of the address validation.

    :ivar status: Status of the address validation. Known values are: "Other", "Valid", and
     "Invalid".
    :vartype status: str or ~azure.mgmt.billing.models.AddressValidationStatus
    :ivar suggested_addresses: The list of suggested addresses.
    :vartype suggested_addresses: list[~azure.mgmt.billing.models.AddressDetails]
    :ivar validation_message: Validation error message.
    :vartype validation_message: str
    """

    status: Optional[Union[str, "_models.AddressValidationStatus"]] = rest_field(visibility=["read"])
    """Status of the address validation. Known values are: \"Other\", \"Valid\", and \"Invalid\"."""
    suggested_addresses: Optional[list["_models.AddressDetails"]] = rest_field(
        name="suggestedAddresses", visibility=["read"]
    )
    """The list of suggested addresses."""
    validation_message: Optional[str] = rest_field(name="validationMessage", visibility=["read"])
    """Validation error message."""


class Resource(_Model):
    """Resource.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}."""
    name: Optional[str] = rest_field(visibility=["read"])
    """The name of the resource."""
    type: Optional[str] = rest_field(visibility=["read"])
    """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or
     \"Microsoft.Storage/storageAccounts\"."""
    system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"])
    """Azure Resource Manager metadata containing createdBy and modifiedBy information."""


class ProxyResource(Resource):
    """Proxy Resource.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    """


class Agreement(ProxyResource):
    """An agreement.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: An agreement.
    :vartype properties: ~azure.mgmt.billing.models.AgreementProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.AgreementProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """An agreement."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.AgreementProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class AgreementProperties(_Model):
    """An agreement.

    :ivar acceptance_mode: The mode of acceptance for an agreement. Known values are: "Other",
     "ClickToAccept", "ESignEmbedded", "ESignOffline", "Implicit", "Offline", and "PhysicalSign".
    :vartype acceptance_mode: str or ~azure.mgmt.billing.models.AcceptanceMode
    :ivar agreement_link: The URL to download the agreement.
    :vartype agreement_link: str
    :ivar billing_profile_info: The list of billing profiles associated with agreement and present
     only for specific agreements.
    :vartype billing_profile_info: list[~azure.mgmt.billing.models.BillingProfileInfo]
    :ivar category: The category of the agreement. Known values are: "Other",
     "AffiliatePurchaseTerms", "IndirectForGovernmentAgreement", "MicrosoftCustomerAgreement",
     "MicrosoftPartnerAgreement", and "UKCloudComputeFramework".
    :vartype category: str or ~azure.mgmt.billing.models.Category
    :ivar display_name: The name of the agreement signed by a customer.
    :vartype display_name: str
    :ivar effective_date: The date from which the agreement is effective.
    :vartype effective_date: ~datetime.datetime
    :ivar expiration_date: The date when the agreement expires.
    :vartype expiration_date: ~datetime.datetime
    :ivar participants: The list of participants that participates in acceptance of an agreement.
    :vartype participants: list[~azure.mgmt.billing.models.Participant]
    :ivar status: The current status of the agreement.
    :vartype status: str
    :ivar lead_billing_account_name: The ID of the lead billing account if this agreement is part
     of the Customer Affiliate Purchase Terms.
    :vartype lead_billing_account_name: str
    """

    acceptance_mode: Optional[Union[str, "_models.AcceptanceMode"]] = rest_field(
        name="acceptanceMode", visibility=["read"]
    )
    """The mode of acceptance for an agreement. Known values are: \"Other\", \"ClickToAccept\",
     \"ESignEmbedded\", \"ESignOffline\", \"Implicit\", \"Offline\", and \"PhysicalSign\"."""
    agreement_link: Optional[str] = rest_field(name="agreementLink", visibility=["read"])
    """The URL to download the agreement."""
    billing_profile_info: Optional[list["_models.BillingProfileInfo"]] = rest_field(
        name="billingProfileInfo", visibility=["read"]
    )
    """The list of billing profiles associated with agreement and present only for specific
     agreements."""
    category: Optional[Union[str, "_models.Category"]] = rest_field(visibility=["read"])
    """The category of the agreement. Known values are: \"Other\", \"AffiliatePurchaseTerms\",
     \"IndirectForGovernmentAgreement\", \"MicrosoftCustomerAgreement\",
     \"MicrosoftPartnerAgreement\", and \"UKCloudComputeFramework\"."""
    display_name: Optional[str] = rest_field(name="displayName", visibility=["read"])
    """The name of the agreement signed by a customer."""
    effective_date: Optional[datetime.datetime] = rest_field(
        name="effectiveDate", visibility=["read"], format="rfc3339"
    )
    """The date from which the agreement is effective."""
    expiration_date: Optional[datetime.datetime] = rest_field(
        name="expirationDate", visibility=["read"], format="rfc3339"
    )
    """The date when the agreement expires."""
    participants: Optional[list["_models.Participant"]] = rest_field(visibility=["read"])
    """The list of participants that participates in acceptance of an agreement."""
    status: Optional[str] = rest_field(visibility=["read"])
    """The current status of the agreement."""
    lead_billing_account_name: Optional[str] = rest_field(name="leadBillingAccountName", visibility=["read"])
    """The ID of the lead billing account if this agreement is part of the Customer Affiliate Purchase
     Terms."""


class Amount(_Model):
    """The amount.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """

    currency: Optional[str] = rest_field(visibility=["read"])
    """The currency for the amount value."""
    value: Optional[float] = rest_field(visibility=["read"])
    """The amount value. For example, if the currency is USD, then a value of 600 would be $600.00."""


class AppliedScopeProperties(_Model):
    """Properties specific to applied scope type. Not required if not applicable.

    :ivar tenant_id: Tenant ID where the savings plan where the benefit is applied.
    :vartype tenant_id: str
    :ivar management_group_id: Fully-qualified identifier of the management group where the benefit
     is applied.
    :vartype management_group_id: str
    :ivar subscription_id: Fully-qualified identifier of the subscription where the benefit is
     applied.
    :vartype subscription_id: str
    :ivar resource_group_id: Fully-qualified identifier of the resource group where the benefit is
     applied.
    :vartype resource_group_id: str
    :ivar display_name: Display name.
    :vartype display_name: str
    """

    tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"])
    """Tenant ID where the savings plan where the benefit is applied."""
    management_group_id: Optional[str] = rest_field(
        name="managementGroupId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Fully-qualified identifier of the management group where the benefit is applied."""
    subscription_id: Optional[str] = rest_field(
        name="subscriptionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Fully-qualified identifier of the subscription where the benefit is applied."""
    resource_group_id: Optional[str] = rest_field(
        name="resourceGroupId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Fully-qualified identifier of the resource group where the benefit is applied."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name."""

    @overload
    def __init__(
        self,
        *,
        tenant_id: Optional[str] = None,
        management_group_id: Optional[str] = None,
        subscription_id: Optional[str] = None,
        resource_group_id: Optional[str] = None,
        display_name: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class AssociatedTenant(ProxyResource):
    """An associated tenant.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: An associated tenant.
    :vartype properties: ~azure.mgmt.billing.models.AssociatedTenantProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.AssociatedTenantProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """An associated tenant."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.AssociatedTenantProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class AssociatedTenantProperties(_Model):
    """An associated tenant.

    :ivar provisioning_state: The provisioning state of the resource during a long-running
     operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending",
     "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired".
    :vartype provisioning_state: str or ~azure.mgmt.billing.models.ProvisioningState
    :ivar display_name: The name of the associated tenant.
    :vartype display_name: str
    :ivar tenant_id: The ID that uniquely identifies a tenant.
    :vartype tenant_id: str
    :ivar billing_management_state: The state determines whether users from the associated tenant
     can be assigned roles for commerce activities like viewing and downloading invoices, managing
     payments, and making purchases. Known values are: "Other", "NotAllowed", "Active", and
     "Revoked".
    :vartype billing_management_state: str or
     ~azure.mgmt.billing.models.BillingManagementTenantState
    :ivar provisioning_management_state: The state determines whether subscriptions and licenses
     can be provisioned in the associated tenant. It can be set to 'Pending' to initiate a billing
     request. Known values are: "Other", "NotRequested", "Active", "Pending",
     "BillingRequestExpired", "BillingRequestDeclined", and "Revoked".
    :vartype provisioning_management_state: str or
     ~azure.mgmt.billing.models.ProvisioningTenantState
    :ivar provisioning_billing_request_id: The unique identifier for the billing request that is
     created when enabling provisioning for an associated tenant.
    :vartype provisioning_billing_request_id: str
    """

    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the resource during a long-running operation. Known values are:
     \"Succeeded\", \"Canceled\", \"Failed\", \"New\", \"Pending\", \"Provisioning\",
     \"PendingBilling\", \"ConfirmedBilling\", \"Creating\", \"Created\", and \"Expired\"."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the associated tenant."""
    tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"])
    """The ID that uniquely identifies a tenant."""
    billing_management_state: Optional[Union[str, "_models.BillingManagementTenantState"]] = rest_field(
        name="billingManagementState", visibility=["read", "create", "update", "delete", "query"]
    )
    """The state determines whether users from the associated tenant can be assigned roles for
     commerce activities like viewing and downloading invoices, managing payments, and making
     purchases. Known values are: \"Other\", \"NotAllowed\", \"Active\", and \"Revoked\"."""
    provisioning_management_state: Optional[Union[str, "_models.ProvisioningTenantState"]] = rest_field(
        name="provisioningManagementState", visibility=["read", "create", "update", "delete", "query"]
    )
    """The state determines whether subscriptions and licenses can be provisioned in the associated
     tenant. It can be set to 'Pending' to initiate a billing request. Known values are: \"Other\",
     \"NotRequested\", \"Active\", \"Pending\", \"BillingRequestExpired\",
     \"BillingRequestDeclined\", and \"Revoked\"."""
    provisioning_billing_request_id: Optional[str] = rest_field(
        name="provisioningBillingRequestId", visibility=["read"]
    )
    """The unique identifier for the billing request that is created when enabling provisioning for an
     associated tenant."""

    @overload
    def __init__(
        self,
        *,
        display_name: Optional[str] = None,
        tenant_id: Optional[str] = None,
        billing_management_state: Optional[Union[str, "_models.BillingManagementTenantState"]] = None,
        provisioning_management_state: Optional[Union[str, "_models.ProvisioningTenantState"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class AvailableBalance(ProxyResource):
    """The Available Credit or Payment on Account Balance. The credit balance can be used to settle
    due or past due invoices.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: The Available Credit or Payment on Account Balance. The credit balance can be
     used to settle due or past due invoices.
    :vartype properties: ~azure.mgmt.billing.models.AvailableBalanceProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.AvailableBalanceProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The Available Credit or Payment on Account Balance. The credit balance can be used to settle
     due or past due invoices."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.AvailableBalanceProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class AvailableBalanceProperties(_Model):
    """The Available Credit or Payment on Account Balance. The credit balance can be used to settle
    due or past due invoices.

    :ivar amount: Credit amount for immediate payment.
    :vartype amount: ~azure.mgmt.billing.models.AvailableBalancePropertiesAmount
    :ivar payments_on_account: The list of payments on accounts.
    :vartype payments_on_account: list[~azure.mgmt.billing.models.PaymentOnAccount]
    :ivar total_payments_on_account: Total amount of payments on accounts.
    :vartype total_payments_on_account:
     ~azure.mgmt.billing.models.AvailableBalancePropertiesTotalPaymentsOnAccount
    """

    amount: Optional["_models.AvailableBalancePropertiesAmount"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Credit amount for immediate payment."""
    payments_on_account: Optional[list["_models.PaymentOnAccount"]] = rest_field(
        name="paymentsOnAccount", visibility=["read"]
    )
    """The list of payments on accounts."""
    total_payments_on_account: Optional["_models.AvailableBalancePropertiesTotalPaymentsOnAccount"] = rest_field(
        name="totalPaymentsOnAccount", visibility=["read", "create", "update", "delete", "query"]
    )
    """Total amount of payments on accounts."""

    @overload
    def __init__(
        self,
        *,
        amount: Optional["_models.AvailableBalancePropertiesAmount"] = None,
        total_payments_on_account: Optional["_models.AvailableBalancePropertiesTotalPaymentsOnAccount"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class AvailableBalancePropertiesAmount(Amount):
    """Credit amount for immediate payment.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class AvailableBalancePropertiesTotalPaymentsOnAccount(Amount):  # pylint: disable=name-too-long
    """Total amount of payments on accounts.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class AzurePlan(_Model):
    """Details of the Azure plan.

    :ivar product_id: The ID that uniquely identifies a product.
    :vartype product_id: str
    :ivar sku_id: The ID that uniquely identifies a sku.
    :vartype sku_id: str
    :ivar sku_description: The sku description.
    :vartype sku_description: str
    """

    product_id: Optional[str] = rest_field(name="productId", visibility=["read", "create", "update", "delete", "query"])
    """The ID that uniquely identifies a product."""
    sku_id: Optional[str] = rest_field(name="skuId", visibility=["read", "create", "update", "delete", "query"])
    """The ID that uniquely identifies a sku."""
    sku_description: Optional[str] = rest_field(
        name="skuDescription", visibility=["read", "create", "update", "delete", "query"]
    )
    """The sku description."""

    @overload
    def __init__(
        self,
        *,
        product_id: Optional[str] = None,
        sku_id: Optional[str] = None,
        sku_description: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class Beneficiary(_Model):
    """Details of the beneficiary.

    :ivar tenant_id: The ID that uniquely identifies a tenant.
    :vartype tenant_id: str
    :ivar object_id: The ID that uniquely identifies a user in a tenant.
    :vartype object_id: str
    """

    tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"])
    """The ID that uniquely identifies a tenant."""
    object_id: Optional[str] = rest_field(name="objectId", visibility=["read", "create", "update", "delete", "query"])
    """The ID that uniquely identifies a user in a tenant."""

    @overload
    def __init__(
        self,
        *,
        tenant_id: Optional[str] = None,
        object_id: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingAccount(ProxyResource):
    """A billing account.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: A billing account.
    :vartype properties: ~azure.mgmt.billing.models.BillingAccountProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.BillingAccountProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A billing account."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.BillingAccountProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ProxyResourceWithTags(ProxyResource):
    """Common fields that are returned in the response for all Azure Resource Manager resources.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingAccountPatch(ProxyResourceWithTags):
    """A billing account.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    :ivar properties: A billing account.
    :vartype properties: ~azure.mgmt.billing.models.BillingAccountProperties
    """

    properties: Optional["_models.BillingAccountProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A billing account."""

    @overload
    def __init__(
        self,
        *,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.BillingAccountProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingAccountPolicy(ProxyResource):
    """A policy at billing account scope.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: A policy at billing account scope.
    :vartype properties: ~azure.mgmt.billing.models.BillingAccountPolicyProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.BillingAccountPolicyProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A policy at billing account scope."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.BillingAccountPolicyProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingAccountPolicyProperties(_Model):
    """A policy at billing account scope.

    :ivar provisioning_state: The provisioning state of the resource during a long-running
     operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending",
     "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired".
    :vartype provisioning_state: str or ~azure.mgmt.billing.models.ProvisioningState
    :ivar enterprise_agreement_policies: The policies for Enterprise Agreement enrollments.
    :vartype enterprise_agreement_policies:
     ~azure.mgmt.billing.models.BillingAccountPolicyPropertiesEnterpriseAgreementPolicies
    :ivar marketplace_purchases: The policy that controls whether Azure marketplace purchases are
     allowed. Known values are: "Other", "AllAllowed", "Disabled", "NotAllowed", and
     "OnlyFreeAllowed".
    :vartype marketplace_purchases: str or ~azure.mgmt.billing.models.MarketplacePurchasesPolicy
    :ivar reservation_purchases: The policy that controls whether Azure reservation purchases are
     allowed. Known values are: "Other", "Allowed", "Disabled", and "NotAllowed".
    :vartype reservation_purchases: str or ~azure.mgmt.billing.models.ReservationPurchasesPolicy
    :ivar savings_plan_purchases: The policy that controls whether users with Azure savings plan
     purchase are allowed. Known values are: "Other", "Allowed", "Disabled", and "NotAllowed".
    :vartype savings_plan_purchases: str or ~azure.mgmt.billing.models.SavingsPlanPurchasesPolicy
    :ivar policies: List of all policies defined at the billing scope.
    :vartype policies: list[~azure.mgmt.billing.models.PolicySummary]
    """

    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the resource during a long-running operation. Known values are:
     \"Succeeded\", \"Canceled\", \"Failed\", \"New\", \"Pending\", \"Provisioning\",
     \"PendingBilling\", \"ConfirmedBilling\", \"Creating\", \"Created\", and \"Expired\"."""
    enterprise_agreement_policies: Optional["_models.BillingAccountPolicyPropertiesEnterpriseAgreementPolicies"] = (
        rest_field(name="enterpriseAgreementPolicies", visibility=["read", "create", "update", "delete", "query"])
    )
    """The policies for Enterprise Agreement enrollments."""
    marketplace_purchases: Optional[Union[str, "_models.MarketplacePurchasesPolicy"]] = rest_field(
        name="marketplacePurchases", visibility=["read", "create", "update", "delete", "query"]
    )
    """The policy that controls whether Azure marketplace purchases are allowed. Known values are:
     \"Other\", \"AllAllowed\", \"Disabled\", \"NotAllowed\", and \"OnlyFreeAllowed\"."""
    reservation_purchases: Optional[Union[str, "_models.ReservationPurchasesPolicy"]] = rest_field(
        name="reservationPurchases", visibility=["read", "create", "update", "delete", "query"]
    )
    """The policy that controls whether Azure reservation purchases are allowed. Known values are:
     \"Other\", \"Allowed\", \"Disabled\", and \"NotAllowed\"."""
    savings_plan_purchases: Optional[Union[str, "_models.SavingsPlanPurchasesPolicy"]] = rest_field(
        name="savingsPlanPurchases", visibility=["read", "create", "update", "delete", "query"]
    )
    """The policy that controls whether users with Azure savings plan purchase are allowed. Known
     values are: \"Other\", \"Allowed\", \"Disabled\", and \"NotAllowed\"."""
    policies: Optional[list["_models.PolicySummary"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of all policies defined at the billing scope."""

    @overload
    def __init__(
        self,
        *,
        enterprise_agreement_policies: Optional[
            "_models.BillingAccountPolicyPropertiesEnterpriseAgreementPolicies"
        ] = None,
        marketplace_purchases: Optional[Union[str, "_models.MarketplacePurchasesPolicy"]] = None,
        reservation_purchases: Optional[Union[str, "_models.ReservationPurchasesPolicy"]] = None,
        savings_plan_purchases: Optional[Union[str, "_models.SavingsPlanPurchasesPolicy"]] = None,
        policies: Optional[list["_models.PolicySummary"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class EnterpriseAgreementPolicies(_Model):
    """The policies for Enterprise Agreement enrollments.

    :ivar authentication_type: The state showing the enrollment auth level. Known values are:
     "Other", "MicrosoftAccountOnly", "MixedAccount", "OrganizationalAccountCrossTenant", and
     "OrganizationalAccountOnly".
    :vartype authentication_type: str or ~azure.mgmt.billing.models.EnrollmentAuthLevelState
    :ivar account_owner_view_charges: The policy that controls whether account owner can view
     charges. Known values are: "Other", "Allowed", "Disabled", and "NotAllowed".
    :vartype account_owner_view_charges: str or
     ~azure.mgmt.billing.models.EnrollmentAccountOwnerViewCharges
    :ivar department_admin_view_charges: The policy that controls whether department admin can view
     charges. Known values are: "Other", "Allowed", "Disabled", and "NotAllowed".
    :vartype department_admin_view_charges: str or
     ~azure.mgmt.billing.models.EnrollmentDepartmentAdminViewCharges
    """

    authentication_type: Optional[Union[str, "_models.EnrollmentAuthLevelState"]] = rest_field(
        name="authenticationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The state showing the enrollment auth level. Known values are: \"Other\",
     \"MicrosoftAccountOnly\", \"MixedAccount\", \"OrganizationalAccountCrossTenant\", and
     \"OrganizationalAccountOnly\"."""
    account_owner_view_charges: Optional[Union[str, "_models.EnrollmentAccountOwnerViewCharges"]] = rest_field(
        name="accountOwnerViewCharges", visibility=["read", "create", "update", "delete", "query"]
    )
    """The policy that controls whether account owner can view charges. Known values are: \"Other\",
     \"Allowed\", \"Disabled\", and \"NotAllowed\"."""
    department_admin_view_charges: Optional[Union[str, "_models.EnrollmentDepartmentAdminViewCharges"]] = rest_field(
        name="departmentAdminViewCharges", visibility=["read", "create", "update", "delete", "query"]
    )
    """The policy that controls whether department admin can view charges. Known values are:
     \"Other\", \"Allowed\", \"Disabled\", and \"NotAllowed\"."""

    @overload
    def __init__(
        self,
        *,
        authentication_type: Optional[Union[str, "_models.EnrollmentAuthLevelState"]] = None,
        account_owner_view_charges: Optional[Union[str, "_models.EnrollmentAccountOwnerViewCharges"]] = None,
        department_admin_view_charges: Optional[Union[str, "_models.EnrollmentDepartmentAdminViewCharges"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingAccountPolicyPropertiesEnterpriseAgreementPolicies(
    EnterpriseAgreementPolicies
):  # pylint: disable=name-too-long
    """The policies for Enterprise Agreement enrollments.

    :ivar authentication_type: The state showing the enrollment auth level. Known values are:
     "Other", "MicrosoftAccountOnly", "MixedAccount", "OrganizationalAccountCrossTenant", and
     "OrganizationalAccountOnly".
    :vartype authentication_type: str or ~azure.mgmt.billing.models.EnrollmentAuthLevelState
    :ivar account_owner_view_charges: The policy that controls whether account owner can view
     charges. Known values are: "Other", "Allowed", "Disabled", and "NotAllowed".
    :vartype account_owner_view_charges: str or
     ~azure.mgmt.billing.models.EnrollmentAccountOwnerViewCharges
    :ivar department_admin_view_charges: The policy that controls whether department admin can view
     charges. Known values are: "Other", "Allowed", "Disabled", and "NotAllowed".
    :vartype department_admin_view_charges: str or
     ~azure.mgmt.billing.models.EnrollmentDepartmentAdminViewCharges
    """

    @overload
    def __init__(
        self,
        *,
        authentication_type: Optional[Union[str, "_models.EnrollmentAuthLevelState"]] = None,
        account_owner_view_charges: Optional[Union[str, "_models.EnrollmentAccountOwnerViewCharges"]] = None,
        department_admin_view_charges: Optional[Union[str, "_models.EnrollmentDepartmentAdminViewCharges"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingAccountProperties(_Model):
    """A billing account.

    :ivar provisioning_state: The provisioning state of the resource during a long-running
     operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending",
     "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired".
    :vartype provisioning_state: str or ~azure.mgmt.billing.models.ProvisioningState
    :ivar account_status: The current status of the billing account. Known values are: "Other",
     "Active", "UnderReview", "Disabled", "Deleted", "Extended", "Pending", "New", "Expired",
     "Terminated", and "Transferred".
    :vartype account_status: str or ~azure.mgmt.billing.models.AccountStatus
    :ivar account_type: The type of customer. Known values are: "Other", "Enterprise",
     "Individual", "Partner", "Reseller", "ClassicPartner", "Internal", "Tenant", and "Business".
    :vartype account_type: str or ~azure.mgmt.billing.models.AccountType
    :ivar account_sub_type: The tier of the account. Known values are: "Other", "None",
     "Individual", "Professional", and "Enterprise".
    :vartype account_sub_type: str or ~azure.mgmt.billing.models.AccountSubType
    :ivar account_status_reason_code: Reason for the specified billing account status. Known values
     are: "Other", "UnusualActivity", "ManuallyTerminated", "Expired", "Transferred", and
     "TerminateProcessing".
    :vartype account_status_reason_code: str or
     ~azure.mgmt.billing.models.BillingAccountStatusReasonCode
    :ivar agreement_type: The type of agreement. Known values are: "Other",
     "MicrosoftCustomerAgreement", "EnterpriseAgreement", "MicrosoftOnlineServicesProgram", and
     "MicrosoftPartnerAgreement".
    :vartype agreement_type: str or ~azure.mgmt.billing.models.AgreementType
    :ivar display_name: The billing account name.
    :vartype display_name: str
    :ivar enrollment_details: The properties of an enrollment.
    :vartype enrollment_details:
     ~azure.mgmt.billing.models.BillingAccountPropertiesEnrollmentDetails
    :ivar has_read_access: Indicates whether user has read access to the billing account.
    :vartype has_read_access: bool
    :ivar has_no_billing_profiles: Indicates whether or not the billing account has any billing
     profiles.
    :vartype has_no_billing_profiles: bool
    :ivar notification_email_address: Notification email address for legacy account. Available for
     agreement type Microsoft Online Services Program.
    :vartype notification_email_address: str
    :ivar primary_billing_tenant_id: The tenant that was used to set up the billing account. By
     default, only users from this tenant can get role assignments on the billing account and all
     purchases are provisioned in this tenant.
    :vartype primary_billing_tenant_id: str
    :ivar sold_to: The address of the individual or organization that is responsible for the
     billing account.
    :vartype sold_to: ~azure.mgmt.billing.models.BillingAccountPropertiesSoldTo
    :ivar registration_number: Describes the registration number of the organization linked with
     the billing account.
    :vartype registration_number:
     ~azure.mgmt.billing.models.BillingAccountPropertiesRegistrationNumber
    :ivar billing_relationship_types: Identifies the billing relationships represented by a billing
     account. The billing relationship may be between Microsoft, the customer, and/or a third-party.
    :vartype billing_relationship_types: list[str or
     ~azure.mgmt.billing.models.BillingRelationshipType]
    :ivar qualifications: Qualifications for pricing on a billing account. Values may be
     Commercial, Education, Charity or Government.
    :vartype qualifications: list[str]
    :ivar tax_ids: A list of tax identifiers for the billing account.
    :vartype tax_ids: list[~azure.mgmt.billing.models.TaxIdentifier]
    """

    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the resource during a long-running operation. Known values are:
     \"Succeeded\", \"Canceled\", \"Failed\", \"New\", \"Pending\", \"Provisioning\",
     \"PendingBilling\", \"ConfirmedBilling\", \"Creating\", \"Created\", and \"Expired\"."""
    account_status: Optional[Union[str, "_models.AccountStatus"]] = rest_field(
        name="accountStatus", visibility=["read"]
    )
    """The current status of the billing account. Known values are: \"Other\", \"Active\",
     \"UnderReview\", \"Disabled\", \"Deleted\", \"Extended\", \"Pending\", \"New\", \"Expired\",
     \"Terminated\", and \"Transferred\"."""
    account_type: Optional[Union[str, "_models.AccountType"]] = rest_field(name="accountType", visibility=["read"])
    """The type of customer. Known values are: \"Other\", \"Enterprise\", \"Individual\", \"Partner\",
     \"Reseller\", \"ClassicPartner\", \"Internal\", \"Tenant\", and \"Business\"."""
    account_sub_type: Optional[Union[str, "_models.AccountSubType"]] = rest_field(
        name="accountSubType", visibility=["read"]
    )
    """The tier of the account. Known values are: \"Other\", \"None\", \"Individual\",
     \"Professional\", and \"Enterprise\"."""
    account_status_reason_code: Optional[Union[str, "_models.BillingAccountStatusReasonCode"]] = rest_field(
        name="accountStatusReasonCode", visibility=["read"]
    )
    """Reason for the specified billing account status. Known values are: \"Other\",
     \"UnusualActivity\", \"ManuallyTerminated\", \"Expired\", \"Transferred\", and
     \"TerminateProcessing\"."""
    agreement_type: Optional[Union[str, "_models.AgreementType"]] = rest_field(
        name="agreementType", visibility=["read"]
    )
    """The type of agreement. Known values are: \"Other\", \"MicrosoftCustomerAgreement\",
     \"EnterpriseAgreement\", \"MicrosoftOnlineServicesProgram\", and \"MicrosoftPartnerAgreement\"."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The billing account name."""
    enrollment_details: Optional["_models.BillingAccountPropertiesEnrollmentDetails"] = rest_field(
        name="enrollmentDetails", visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of an enrollment."""
    has_read_access: Optional[bool] = rest_field(
        name="hasReadAccess", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates whether user has read access to the billing account."""
    has_no_billing_profiles: Optional[bool] = rest_field(
        name="hasNoBillingProfiles", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates whether or not the billing account has any billing profiles."""
    notification_email_address: Optional[str] = rest_field(
        name="notificationEmailAddress", visibility=["read", "create", "update", "delete", "query"]
    )
    """Notification email address for legacy account. Available for agreement type Microsoft Online
     Services Program."""
    primary_billing_tenant_id: Optional[str] = rest_field(
        name="primaryBillingTenantId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The tenant that was used to set up the billing account. By default, only users from this tenant
     can get role assignments on the billing account and all purchases are provisioned in this
     tenant."""
    sold_to: Optional["_models.BillingAccountPropertiesSoldTo"] = rest_field(
        name="soldTo", visibility=["read", "create", "update", "delete", "query"]
    )
    """The address of the individual or organization that is responsible for the billing account."""
    registration_number: Optional["_models.BillingAccountPropertiesRegistrationNumber"] = rest_field(
        name="registrationNumber", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes the registration number of the organization linked with the billing account."""
    billing_relationship_types: Optional[list[Union[str, "_models.BillingRelationshipType"]]] = rest_field(
        name="billingRelationshipTypes", visibility=["read"]
    )
    """Identifies the billing relationships represented by a billing account. The billing relationship
     may be between Microsoft, the customer, and/or a third-party."""
    qualifications: Optional[list[str]] = rest_field(visibility=["read"])
    """Qualifications for pricing on a billing account. Values may be Commercial, Education, Charity
     or Government."""
    tax_ids: Optional[list["_models.TaxIdentifier"]] = rest_field(
        name="taxIds", visibility=["read", "create", "update", "delete", "query"]
    )
    """A list of tax identifiers for the billing account."""

    @overload
    def __init__(
        self,
        *,
        display_name: Optional[str] = None,
        enrollment_details: Optional["_models.BillingAccountPropertiesEnrollmentDetails"] = None,
        has_read_access: Optional[bool] = None,
        has_no_billing_profiles: Optional[bool] = None,
        notification_email_address: Optional[str] = None,
        primary_billing_tenant_id: Optional[str] = None,
        sold_to: Optional["_models.BillingAccountPropertiesSoldTo"] = None,
        registration_number: Optional["_models.BillingAccountPropertiesRegistrationNumber"] = None,
        tax_ids: Optional[list["_models.TaxIdentifier"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class EnrollmentDetails(_Model):
    """The properties of an enrollment.

    :ivar start_date: The start date of the enrollment.
    :vartype start_date: ~datetime.datetime
    :ivar end_date: The end date of the enrollment.
    :vartype end_date: ~datetime.datetime
    :ivar currency: The billing currency for the enrollment.
    :vartype currency: str
    :ivar channel: The channel type of the enrollment.
    :vartype channel: str
    :ivar language: The language for the enrollment.
    :vartype language: str
    :ivar country_code: The country code of the enrollment.
    :vartype country_code: str
    :ivar billing_cycle: The billing cycle for the enrollment.
    :vartype billing_cycle: str
    :ivar extended_term_option: The billing account extension opted by the company. Known values
     are: "Other", "Opted-In", and "Opted-Out".
    :vartype extended_term_option: str or ~azure.mgmt.billing.models.ExtendedTermOption
    :ivar support_level: The support level offer associated with an enrollment. Known values are:
     "Other", "Standard", "Pro-Direct", and "Developer".
    :vartype support_level: str or ~azure.mgmt.billing.models.SupportLevel
    :ivar support_coverage: The support coverage period for the enrollment.
    :vartype support_coverage: str
    :ivar cloud: The cloud of the enrollment.
    :vartype cloud: str
    :ivar po_number: The purchase order number of the enrollment.
    :vartype po_number: str
    :ivar markup_status: Markup status of enrollment, applicable only for indirect enrollments.
     Known values are: "Other", "Disabled", "Preview", "Published", and "Locked".
    :vartype markup_status: str or ~azure.mgmt.billing.models.MarkupStatus
    :ivar indirect_relationship_info: The properties of an enrollment which are applicable only for
     indirect enrollments.
    :vartype indirect_relationship_info:
     ~azure.mgmt.billing.models.EnrollmentDetailsIndirectRelationshipInfo
    :ivar invoice_recipient: The contact who receives invoices of the enrollment.
    :vartype invoice_recipient: str
    """

    start_date: Optional[datetime.datetime] = rest_field(
        name="startDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The start date of the enrollment."""
    end_date: Optional[datetime.datetime] = rest_field(
        name="endDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The end date of the enrollment."""
    currency: Optional[str] = rest_field(visibility=["read"])
    """The billing currency for the enrollment."""
    channel: Optional[str] = rest_field(visibility=["read"])
    """The channel type of the enrollment."""
    language: Optional[str] = rest_field(visibility=["read"])
    """The language for the enrollment."""
    country_code: Optional[str] = rest_field(name="countryCode", visibility=["read"])
    """The country code of the enrollment."""
    billing_cycle: Optional[str] = rest_field(name="billingCycle", visibility=["read"])
    """The billing cycle for the enrollment."""
    extended_term_option: Optional[Union[str, "_models.ExtendedTermOption"]] = rest_field(
        name="extendedTermOption", visibility=["read"]
    )
    """The billing account extension opted by the company. Known values are: \"Other\", \"Opted-In\",
     and \"Opted-Out\"."""
    support_level: Optional[Union[str, "_models.SupportLevel"]] = rest_field(name="supportLevel", visibility=["read"])
    """The support level offer associated with an enrollment. Known values are: \"Other\",
     \"Standard\", \"Pro-Direct\", and \"Developer\"."""
    support_coverage: Optional[str] = rest_field(name="supportCoverage", visibility=["read"])
    """The support coverage period for the enrollment."""
    cloud: Optional[str] = rest_field(visibility=["read"])
    """The cloud of the enrollment."""
    po_number: Optional[str] = rest_field(name="poNumber", visibility=["read", "create", "update", "delete", "query"])
    """The purchase order number of the enrollment."""
    markup_status: Optional[Union[str, "_models.MarkupStatus"]] = rest_field(name="markupStatus", visibility=["read"])
    """Markup status of enrollment, applicable only for indirect enrollments. Known values are:
     \"Other\", \"Disabled\", \"Preview\", \"Published\", and \"Locked\"."""
    indirect_relationship_info: Optional["_models.EnrollmentDetailsIndirectRelationshipInfo"] = rest_field(
        name="indirectRelationshipInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of an enrollment which are applicable only for indirect enrollments."""
    invoice_recipient: Optional[str] = rest_field(name="invoiceRecipient", visibility=["read"])
    """The contact who receives invoices of the enrollment."""

    @overload
    def __init__(
        self,
        *,
        start_date: Optional[datetime.datetime] = None,
        end_date: Optional[datetime.datetime] = None,
        po_number: Optional[str] = None,
        indirect_relationship_info: Optional["_models.EnrollmentDetailsIndirectRelationshipInfo"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingAccountPropertiesEnrollmentDetails(EnrollmentDetails):  # pylint: disable=name-too-long
    """The properties of an enrollment.

    :ivar start_date: The start date of the enrollment.
    :vartype start_date: ~datetime.datetime
    :ivar end_date: The end date of the enrollment.
    :vartype end_date: ~datetime.datetime
    :ivar currency: The billing currency for the enrollment.
    :vartype currency: str
    :ivar channel: The channel type of the enrollment.
    :vartype channel: str
    :ivar language: The language for the enrollment.
    :vartype language: str
    :ivar country_code: The country code of the enrollment.
    :vartype country_code: str
    :ivar billing_cycle: The billing cycle for the enrollment.
    :vartype billing_cycle: str
    :ivar extended_term_option: The billing account extension opted by the company. Known values
     are: "Other", "Opted-In", and "Opted-Out".
    :vartype extended_term_option: str or ~azure.mgmt.billing.models.ExtendedTermOption
    :ivar support_level: The support level offer associated with an enrollment. Known values are:
     "Other", "Standard", "Pro-Direct", and "Developer".
    :vartype support_level: str or ~azure.mgmt.billing.models.SupportLevel
    :ivar support_coverage: The support coverage period for the enrollment.
    :vartype support_coverage: str
    :ivar cloud: The cloud of the enrollment.
    :vartype cloud: str
    :ivar po_number: The purchase order number of the enrollment.
    :vartype po_number: str
    :ivar markup_status: Markup status of enrollment, applicable only for indirect enrollments.
     Known values are: "Other", "Disabled", "Preview", "Published", and "Locked".
    :vartype markup_status: str or ~azure.mgmt.billing.models.MarkupStatus
    :ivar indirect_relationship_info: The properties of an enrollment which are applicable only for
     indirect enrollments.
    :vartype indirect_relationship_info:
     ~azure.mgmt.billing.models.EnrollmentDetailsIndirectRelationshipInfo
    :ivar invoice_recipient: The contact who receives invoices of the enrollment.
    :vartype invoice_recipient: str
    """

    @overload
    def __init__(
        self,
        *,
        start_date: Optional[datetime.datetime] = None,
        end_date: Optional[datetime.datetime] = None,
        po_number: Optional[str] = None,
        indirect_relationship_info: Optional["_models.EnrollmentDetailsIndirectRelationshipInfo"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class RegistrationNumber(_Model):
    """Describes the registration number of the organization linked with the billing account.

    :ivar id: The unique identification number of the organization linked with the billing account.
    :vartype id: str
    :ivar required: Identifies if the registration number is required for the billing account.
    :vartype required: bool
    :ivar type: The types of registration number allowed based on the country of the billing
     account.
    :vartype type: list[str]
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The unique identification number of the organization linked with the billing account."""
    required: Optional[bool] = rest_field(visibility=["read"])
    """Identifies if the registration number is required for the billing account."""
    type: Optional[list[str]] = rest_field(visibility=["read"])
    """The types of registration number allowed based on the country of the billing account."""

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingAccountPropertiesRegistrationNumber(RegistrationNumber):  # pylint: disable=name-too-long
    """Describes the registration number of the organization linked with the billing account.

    :ivar id: The unique identification number of the organization linked with the billing account.
    :vartype id: str
    :ivar required: Identifies if the registration number is required for the billing account.
    :vartype required: bool
    :ivar type: The types of registration number allowed based on the country of the billing
     account.
    :vartype type: list[str]
    """

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingAccountPropertiesSoldTo(AddressDetails):
    """The address of the individual or organization that is responsible for the billing account.

    :ivar address_line1: Address line 1. Required.
    :vartype address_line1: str
    :ivar address_line2: Address line 2.
    :vartype address_line2: str
    :ivar address_line3: Address line 3.
    :vartype address_line3: str
    :ivar city: Address city.
    :vartype city: str
    :ivar company_name: Company name. Optional for MCA Individual (Pay-as-you-go).
    :vartype company_name: str
    :ivar country: Country code uses ISO 3166-1 Alpha-2 format. Required.
    :vartype country: str
    :ivar district: Address district.
    :vartype district: str
    :ivar email: Email address.
    :vartype email: str
    :ivar first_name: First name. Optional for MCA Enterprise.
    :vartype first_name: str
    :ivar last_name: Last name. Optional for MCA Enterprise.
    :vartype last_name: str
    :ivar middle_name: Middle name.
    :vartype middle_name: str
    :ivar phone_number: Phone number.
    :vartype phone_number: str
    :ivar postal_code: Postal code.
    :vartype postal_code: str
    :ivar region: Address region.
    :vartype region: str
    :ivar is_valid_address: Indicates if the address is incomplete.
    :vartype is_valid_address: bool
    """

    @overload
    def __init__(
        self,
        *,
        address_line1: str,
        country: str,
        address_line2: Optional[str] = None,
        address_line3: Optional[str] = None,
        city: Optional[str] = None,
        company_name: Optional[str] = None,
        district: Optional[str] = None,
        email: Optional[str] = None,
        first_name: Optional[str] = None,
        last_name: Optional[str] = None,
        middle_name: Optional[str] = None,
        phone_number: Optional[str] = None,
        postal_code: Optional[str] = None,
        region: Optional[str] = None,
        is_valid_address: Optional[bool] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingPermission(_Model):
    """The set of allowed action and not allowed actions a caller has on a resource.

    :ivar actions: The set of actions that the caller is allowed to perform.
    :vartype actions: list[str]
    :ivar not_actions: The set of actions that the caller is not allowed to perform.
    :vartype not_actions: list[str]
    """

    actions: Optional[list[str]] = rest_field(visibility=["read"])
    """The set of actions that the caller is allowed to perform."""
    not_actions: Optional[list[str]] = rest_field(name="notActions", visibility=["read"])
    """The set of actions that the caller is not allowed to perform."""


class BillingPlanInformation(_Model):
    """Information describing the type of billing plan for this savings plan.

    :ivar pricing_currency_total: Amount of money to be paid for the Order. Tax is not included.
    :vartype pricing_currency_total: ~azure.mgmt.billing.models.Price
    :ivar start_date: Date when the billing plan has started.
    :vartype start_date: ~datetime.date
    :ivar next_payment_due_date: For recurring billing plans, indicates the date when next payment
     will be processed. Null when total is paid off.
    :vartype next_payment_due_date: ~datetime.date
    :ivar transactions:
    :vartype transactions: list[~azure.mgmt.billing.models.PaymentDetail]
    """

    pricing_currency_total: Optional["_models.Price"] = rest_field(
        name="pricingCurrencyTotal", visibility=["read", "create", "update", "delete", "query"]
    )
    """Amount of money to be paid for the Order. Tax is not included."""
    start_date: Optional[datetime.date] = rest_field(
        name="startDate", visibility=["read", "create", "update", "delete", "query"]
    )
    """Date when the billing plan has started."""
    next_payment_due_date: Optional[datetime.date] = rest_field(
        name="nextPaymentDueDate", visibility=["read", "create", "update", "delete", "query"]
    )
    """For recurring billing plans, indicates the date when next payment will be processed. Null when
     total is paid off."""
    transactions: Optional[list["_models.PaymentDetail"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        pricing_currency_total: Optional["_models.Price"] = None,
        start_date: Optional[datetime.date] = None,
        next_payment_due_date: Optional[datetime.date] = None,
        transactions: Optional[list["_models.PaymentDetail"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingProfile(ProxyResource):
    """A billing profile.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: A billing profile.
    :vartype properties: ~azure.mgmt.billing.models.BillingProfileProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.BillingProfileProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A billing profile."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.BillingProfileProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingProfileInfo(_Model):
    """Details about billing profile associated with agreement and available only for specific
    agreements.

    :ivar billing_account_id: The fully qualified ID that uniquely identifies a billing account.
    :vartype billing_account_id: str
    :ivar billing_profile_display_name: The name of the billing profile.
    :vartype billing_profile_display_name: str
    :ivar billing_profile_id: The friendly ID that uniquely identifies a billing profile.
    :vartype billing_profile_id: str
    :ivar billing_profile_system_id: The fully qualified ID that uniquely identifies a billing
     profile.
    :vartype billing_profile_system_id: str
    :ivar indirect_relationship_organization_name: Billing account name. Available for a specific
     type of agreement.
    :vartype indirect_relationship_organization_name: str
    """

    billing_account_id: Optional[str] = rest_field(
        name="billingAccountId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The fully qualified ID that uniquely identifies a billing account."""
    billing_profile_display_name: Optional[str] = rest_field(
        name="billingProfileDisplayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the billing profile."""
    billing_profile_id: Optional[str] = rest_field(
        name="billingProfileId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The friendly ID that uniquely identifies a billing profile."""
    billing_profile_system_id: Optional[str] = rest_field(
        name="billingProfileSystemId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The fully qualified ID that uniquely identifies a billing profile."""
    indirect_relationship_organization_name: Optional[str] = rest_field(
        name="indirectRelationshipOrganizationName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Billing account name. Available for a specific type of agreement."""

    @overload
    def __init__(
        self,
        *,
        billing_account_id: Optional[str] = None,
        billing_profile_display_name: Optional[str] = None,
        billing_profile_id: Optional[str] = None,
        billing_profile_system_id: Optional[str] = None,
        indirect_relationship_organization_name: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingProfilePolicy(ProxyResource):
    """A policy at billing profile scope.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: A policy at billing profile scope.
    :vartype properties: ~azure.mgmt.billing.models.BillingProfilePolicyProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.BillingProfilePolicyProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A policy at billing profile scope."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.BillingProfilePolicyProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingProfilePolicyProperties(_Model):
    """A policy at billing profile scope.

    :ivar provisioning_state: The provisioning state of the resource during a long-running
     operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending",
     "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired".
    :vartype provisioning_state: str or ~azure.mgmt.billing.models.ProvisioningState
    :ivar enterprise_agreement_policies: The policies for Enterprise Agreement enrollments.
    :vartype enterprise_agreement_policies:
     ~azure.mgmt.billing.models.BillingProfilePolicyPropertiesEnterpriseAgreementPolicies
    :ivar invoice_section_label_management: The policy that controls invoice section label
     management at invoice section scope. This is allowed by default. Known values are: "Other",
     "Allowed", and "NotAllowed".
    :vartype invoice_section_label_management: str or
     ~azure.mgmt.billing.models.InvoiceSectionLabelManagementPolicy
    :ivar marketplace_purchases: The policy that controls whether Azure marketplace purchases are
     allowed. Known values are: "Other", "AllAllowed", "Disabled", "NotAllowed", and
     "OnlyFreeAllowed".
    :vartype marketplace_purchases: str or ~azure.mgmt.billing.models.MarketplacePurchasesPolicy
    :ivar reservation_purchases: The policy that controls whether Azure reservation purchases are
     allowed. Known values are: "Other", "Allowed", "Disabled", and "NotAllowed".
    :vartype reservation_purchases: str or ~azure.mgmt.billing.models.ReservationPurchasesPolicy
    :ivar savings_plan_purchases: The policy that controls whether users with Azure savings plan
     purchase are allowed. Known values are: "Other", "Allowed", "Disabled", and "NotAllowed".
    :vartype savings_plan_purchases: str or ~azure.mgmt.billing.models.SavingsPlanPurchasesPolicy
    :ivar view_charges: The policy that controls whether the users in customer's organization can
     view charges at pay-as-you-go prices. Known values are: "Other", "Allowed", and "NotAllowed".
    :vartype view_charges: str or ~azure.mgmt.billing.models.ViewChargesPolicy
    :ivar policies: List of all policies defined at the billing scope.
    :vartype policies: list[~azure.mgmt.billing.models.PolicySummary]
    """

    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the resource during a long-running operation. Known values are:
     \"Succeeded\", \"Canceled\", \"Failed\", \"New\", \"Pending\", \"Provisioning\",
     \"PendingBilling\", \"ConfirmedBilling\", \"Creating\", \"Created\", and \"Expired\"."""
    enterprise_agreement_policies: Optional["_models.BillingProfilePolicyPropertiesEnterpriseAgreementPolicies"] = (
        rest_field(name="enterpriseAgreementPolicies", visibility=["read", "create", "update", "delete", "query"])
    )
    """The policies for Enterprise Agreement enrollments."""
    invoice_section_label_management: Optional[Union[str, "_models.InvoiceSectionLabelManagementPolicy"]] = rest_field(
        name="invoiceSectionLabelManagement", visibility=["read", "create", "update", "delete", "query"]
    )
    """The policy that controls invoice section label management at invoice section scope. This is
     allowed by default. Known values are: \"Other\", \"Allowed\", and \"NotAllowed\"."""
    marketplace_purchases: Optional[Union[str, "_models.MarketplacePurchasesPolicy"]] = rest_field(
        name="marketplacePurchases", visibility=["read", "create", "update", "delete", "query"]
    )
    """The policy that controls whether Azure marketplace purchases are allowed. Known values are:
     \"Other\", \"AllAllowed\", \"Disabled\", \"NotAllowed\", and \"OnlyFreeAllowed\"."""
    reservation_purchases: Optional[Union[str, "_models.ReservationPurchasesPolicy"]] = rest_field(
        name="reservationPurchases", visibility=["read", "create", "update", "delete", "query"]
    )
    """The policy that controls whether Azure reservation purchases are allowed. Known values are:
     \"Other\", \"Allowed\", \"Disabled\", and \"NotAllowed\"."""
    savings_plan_purchases: Optional[Union[str, "_models.SavingsPlanPurchasesPolicy"]] = rest_field(
        name="savingsPlanPurchases", visibility=["read", "create", "update", "delete", "query"]
    )
    """The policy that controls whether users with Azure savings plan purchase are allowed. Known
     values are: \"Other\", \"Allowed\", \"Disabled\", and \"NotAllowed\"."""
    view_charges: Optional[Union[str, "_models.ViewChargesPolicy"]] = rest_field(
        name="viewCharges", visibility=["read", "create", "update", "delete", "query"]
    )
    """The policy that controls whether the users in customer's organization can view charges at
     pay-as-you-go prices. Known values are: \"Other\", \"Allowed\", and \"NotAllowed\"."""
    policies: Optional[list["_models.PolicySummary"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of all policies defined at the billing scope."""

    @overload
    def __init__(
        self,
        *,
        enterprise_agreement_policies: Optional[
            "_models.BillingProfilePolicyPropertiesEnterpriseAgreementPolicies"
        ] = None,
        invoice_section_label_management: Optional[Union[str, "_models.InvoiceSectionLabelManagementPolicy"]] = None,
        marketplace_purchases: Optional[Union[str, "_models.MarketplacePurchasesPolicy"]] = None,
        reservation_purchases: Optional[Union[str, "_models.ReservationPurchasesPolicy"]] = None,
        savings_plan_purchases: Optional[Union[str, "_models.SavingsPlanPurchasesPolicy"]] = None,
        view_charges: Optional[Union[str, "_models.ViewChargesPolicy"]] = None,
        policies: Optional[list["_models.PolicySummary"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingProfilePolicyPropertiesEnterpriseAgreementPolicies(
    EnterpriseAgreementPolicies
):  # pylint: disable=name-too-long
    """The policies for Enterprise Agreement enrollments.

    :ivar authentication_type: The state showing the enrollment auth level. Known values are:
     "Other", "MicrosoftAccountOnly", "MixedAccount", "OrganizationalAccountCrossTenant", and
     "OrganizationalAccountOnly".
    :vartype authentication_type: str or ~azure.mgmt.billing.models.EnrollmentAuthLevelState
    :ivar account_owner_view_charges: The policy that controls whether account owner can view
     charges. Known values are: "Other", "Allowed", "Disabled", and "NotAllowed".
    :vartype account_owner_view_charges: str or
     ~azure.mgmt.billing.models.EnrollmentAccountOwnerViewCharges
    :ivar department_admin_view_charges: The policy that controls whether department admin can view
     charges. Known values are: "Other", "Allowed", "Disabled", and "NotAllowed".
    :vartype department_admin_view_charges: str or
     ~azure.mgmt.billing.models.EnrollmentDepartmentAdminViewCharges
    """

    @overload
    def __init__(
        self,
        *,
        authentication_type: Optional[Union[str, "_models.EnrollmentAuthLevelState"]] = None,
        account_owner_view_charges: Optional[Union[str, "_models.EnrollmentAccountOwnerViewCharges"]] = None,
        department_admin_view_charges: Optional[Union[str, "_models.EnrollmentDepartmentAdminViewCharges"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingProfileProperties(_Model):
    """A billing profile.

    :ivar provisioning_state: The provisioning state of the resource during a long-running
     operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending",
     "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired".
    :vartype provisioning_state: str or ~azure.mgmt.billing.models.ProvisioningState
    :ivar billing_relationship_type: Identifies the billing relationship represented by the billing
     profile. The billing relationship may be between Microsoft, the customer, and/or a third-party.
     Known values are: "Other", "Direct", "IndirectCustomer", "IndirectPartner", "CSPPartner", and
     "CSPCustomer".
    :vartype billing_relationship_type: str or ~azure.mgmt.billing.models.BillingRelationshipType
    :ivar bill_to: Billing address.
    :vartype bill_to: ~azure.mgmt.billing.models.BillingProfilePropertiesBillTo
    :ivar currency: The currency in which the charges for the billing profile are billed.
    :vartype currency: str
    :ivar display_name: The name of the billing profile.
    :vartype display_name: str
    :ivar enabled_azure_plans: Information about the enabled azure plans.
    :vartype enabled_azure_plans: list[~azure.mgmt.billing.models.AzurePlan]
    :ivar has_read_access: Indicates whether user has read access to the billing profile.
    :vartype has_read_access: bool
    :ivar indirect_relationship_info: Identifies the billing profile that is linked to another
     billing profile in indirect purchase motion.
    :vartype indirect_relationship_info:
     ~azure.mgmt.billing.models.BillingProfilePropertiesIndirectRelationshipInfo
    :ivar invoice_day: The day of the month when the invoice for the billing profile is generated.
    :vartype invoice_day: int
    :ivar invoice_email_opt_in: Flag controlling whether the invoices for the billing profile are
     sent through email.
    :vartype invoice_email_opt_in: bool
    :ivar invoice_recipients: The list of email addresses to receive invoices by email for the
     billing profile.
    :vartype invoice_recipients: list[str]
    :ivar po_number: The default purchase order number that will appear on the invoices generated
     for the billing profile.
    :vartype po_number: str
    :ivar ship_to: The default address where the products are shipped, or the services are being
     used. If a ship to is not specified for a product or a subscription, then this address will be
     used.
    :vartype ship_to: ~azure.mgmt.billing.models.BillingProfilePropertiesShipTo
    :ivar sold_to: The address of the individual or organization that is responsible for the
     billing account.
    :vartype sold_to: ~azure.mgmt.billing.models.BillingProfilePropertiesSoldTo
    :ivar spending_limit: The billing profile spending limit. Known values are: "Off" and "On".
    :vartype spending_limit: str or ~azure.mgmt.billing.models.SpendingLimit
    :ivar spending_limit_details: The details of billing profile spending limit.
    :vartype spending_limit_details: list[~azure.mgmt.billing.models.SpendingLimitDetails]
    :ivar status: The status of the billing profile. Known values are: "Other", "Active",
     "Disabled", "Warned", "Deleted", and "UnderReview".
    :vartype status: str or ~azure.mgmt.billing.models.BillingProfileStatus
    :ivar status_reason_code: Reason for the specified billing profile status. Known values are:
     "Other", "PastDue", "UnusualActivity", "SpendingLimitReached", and "SpendingLimitExpired".
    :vartype status_reason_code: str or ~azure.mgmt.billing.models.BillingProfileStatusReasonCode
    :ivar system_id: The system generated unique identifier for a billing profile.
    :vartype system_id: str
    :ivar tags: Dictionary of metadata associated with the resource. Maximum key/value length
     supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain <
     > % & \\ ? /.
    :vartype tags: dict[str, str]
    :ivar target_clouds: Identifies the cloud environments that are associated with a billing
     profile. This is a system managed optional field and gets updated as the billing profile gets
     associated with accounts in various clouds.
    :vartype target_clouds: list[str]
    :ivar current_payment_term: The current payment term of the billing profile.
    :vartype current_payment_term:
     ~azure.mgmt.billing.models.BillingProfilePropertiesCurrentPaymentTerm
    :ivar other_payment_terms: The other payment terms of the billing profile.
    :vartype other_payment_terms: list[~azure.mgmt.billing.models.PaymentTerm]
    """

    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the resource during a long-running operation. Known values are:
     \"Succeeded\", \"Canceled\", \"Failed\", \"New\", \"Pending\", \"Provisioning\",
     \"PendingBilling\", \"ConfirmedBilling\", \"Creating\", \"Created\", and \"Expired\"."""
    billing_relationship_type: Optional[Union[str, "_models.BillingRelationshipType"]] = rest_field(
        name="billingRelationshipType", visibility=["read"]
    )
    """Identifies the billing relationship represented by the billing profile. The billing
     relationship may be between Microsoft, the customer, and/or a third-party. Known values are:
     \"Other\", \"Direct\", \"IndirectCustomer\", \"IndirectPartner\", \"CSPPartner\", and
     \"CSPCustomer\"."""
    bill_to: Optional["_models.BillingProfilePropertiesBillTo"] = rest_field(
        name="billTo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Billing address."""
    currency: Optional[str] = rest_field(visibility=["read"])
    """The currency in which the charges for the billing profile are billed."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the billing profile."""
    enabled_azure_plans: Optional[list["_models.AzurePlan"]] = rest_field(
        name="enabledAzurePlans", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the enabled azure plans."""
    has_read_access: Optional[bool] = rest_field(name="hasReadAccess", visibility=["read"])
    """Indicates whether user has read access to the billing profile."""
    indirect_relationship_info: Optional["_models.BillingProfilePropertiesIndirectRelationshipInfo"] = rest_field(
        name="indirectRelationshipInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Identifies the billing profile that is linked to another billing profile in indirect purchase
     motion."""
    invoice_day: Optional[int] = rest_field(name="invoiceDay", visibility=["read"])
    """The day of the month when the invoice for the billing profile is generated."""
    invoice_email_opt_in: Optional[bool] = rest_field(
        name="invoiceEmailOptIn", visibility=["read", "create", "update", "delete", "query"]
    )
    """Flag controlling whether the invoices for the billing profile are sent through email."""
    invoice_recipients: Optional[list[str]] = rest_field(
        name="invoiceRecipients", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of email addresses to receive invoices by email for the billing profile."""
    po_number: Optional[str] = rest_field(name="poNumber", visibility=["read", "create", "update", "delete", "query"])
    """The default purchase order number that will appear on the invoices generated for the billing
     profile."""
    ship_to: Optional["_models.BillingProfilePropertiesShipTo"] = rest_field(
        name="shipTo", visibility=["read", "create", "update", "delete", "query"]
    )
    """The default address where the products are shipped, or the services are being used. If a ship
     to is not specified for a product or a subscription, then this address will be used."""
    sold_to: Optional["_models.BillingProfilePropertiesSoldTo"] = rest_field(
        name="soldTo", visibility=["read", "create", "update", "delete", "query"]
    )
    """The address of the individual or organization that is responsible for the billing account."""
    spending_limit: Optional[Union[str, "_models.SpendingLimit"]] = rest_field(
        name="spendingLimit", visibility=["read"]
    )
    """The billing profile spending limit. Known values are: \"Off\" and \"On\"."""
    spending_limit_details: Optional[list["_models.SpendingLimitDetails"]] = rest_field(
        name="spendingLimitDetails", visibility=["read"]
    )
    """The details of billing profile spending limit."""
    status: Optional[Union[str, "_models.BillingProfileStatus"]] = rest_field(visibility=["read"])
    """The status of the billing profile. Known values are: \"Other\", \"Active\", \"Disabled\",
     \"Warned\", \"Deleted\", and \"UnderReview\"."""
    status_reason_code: Optional[Union[str, "_models.BillingProfileStatusReasonCode"]] = rest_field(
        name="statusReasonCode", visibility=["read"]
    )
    """Reason for the specified billing profile status. Known values are: \"Other\", \"PastDue\",
     \"UnusualActivity\", \"SpendingLimitReached\", and \"SpendingLimitExpired\"."""
    system_id: Optional[str] = rest_field(name="systemId", visibility=["read"])
    """The system generated unique identifier for a billing profile."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. Maximum key/value length supported of 256
     characters. Keys/value should not empty value nor null. Keys can not contain < > % & \\ ? /."""
    target_clouds: Optional[list[str]] = rest_field(name="targetClouds", visibility=["read"])
    """Identifies the cloud environments that are associated with a billing profile. This is a system
     managed optional field and gets updated as the billing profile gets associated with accounts in
     various clouds."""
    current_payment_term: Optional["_models.BillingProfilePropertiesCurrentPaymentTerm"] = rest_field(
        name="currentPaymentTerm", visibility=["read", "create", "update", "delete", "query"]
    )
    """The current payment term of the billing profile."""
    other_payment_terms: Optional[list["_models.PaymentTerm"]] = rest_field(
        name="otherPaymentTerms", visibility=["read"]
    )
    """The other payment terms of the billing profile."""

    @overload
    def __init__(
        self,
        *,
        bill_to: Optional["_models.BillingProfilePropertiesBillTo"] = None,
        display_name: Optional[str] = None,
        enabled_azure_plans: Optional[list["_models.AzurePlan"]] = None,
        indirect_relationship_info: Optional["_models.BillingProfilePropertiesIndirectRelationshipInfo"] = None,
        invoice_email_opt_in: Optional[bool] = None,
        invoice_recipients: Optional[list[str]] = None,
        po_number: Optional[str] = None,
        ship_to: Optional["_models.BillingProfilePropertiesShipTo"] = None,
        sold_to: Optional["_models.BillingProfilePropertiesSoldTo"] = None,
        tags: Optional[dict[str, str]] = None,
        current_payment_term: Optional["_models.BillingProfilePropertiesCurrentPaymentTerm"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingProfilePropertiesBillTo(AddressDetails):
    """Billing address.

    :ivar address_line1: Address line 1. Required.
    :vartype address_line1: str
    :ivar address_line2: Address line 2.
    :vartype address_line2: str
    :ivar address_line3: Address line 3.
    :vartype address_line3: str
    :ivar city: Address city.
    :vartype city: str
    :ivar company_name: Company name. Optional for MCA Individual (Pay-as-you-go).
    :vartype company_name: str
    :ivar country: Country code uses ISO 3166-1 Alpha-2 format. Required.
    :vartype country: str
    :ivar district: Address district.
    :vartype district: str
    :ivar email: Email address.
    :vartype email: str
    :ivar first_name: First name. Optional for MCA Enterprise.
    :vartype first_name: str
    :ivar last_name: Last name. Optional for MCA Enterprise.
    :vartype last_name: str
    :ivar middle_name: Middle name.
    :vartype middle_name: str
    :ivar phone_number: Phone number.
    :vartype phone_number: str
    :ivar postal_code: Postal code.
    :vartype postal_code: str
    :ivar region: Address region.
    :vartype region: str
    :ivar is_valid_address: Indicates if the address is incomplete.
    :vartype is_valid_address: bool
    """

    @overload
    def __init__(
        self,
        *,
        address_line1: str,
        country: str,
        address_line2: Optional[str] = None,
        address_line3: Optional[str] = None,
        city: Optional[str] = None,
        company_name: Optional[str] = None,
        district: Optional[str] = None,
        email: Optional[str] = None,
        first_name: Optional[str] = None,
        last_name: Optional[str] = None,
        middle_name: Optional[str] = None,
        phone_number: Optional[str] = None,
        postal_code: Optional[str] = None,
        region: Optional[str] = None,
        is_valid_address: Optional[bool] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class PaymentTerm(_Model):
    """The properties of payment term.

    :ivar term: Represents duration in netXX format. Always in days.
    :vartype term: str
    :ivar start_date: The date on when the defined 'Payment Term' will be effective from and is
     always in UTC.
    :vartype start_date: ~datetime.datetime
    :ivar end_date: The date on when the defined 'Payment Term' will end and is always in UTC.
    :vartype end_date: ~datetime.datetime
    :ivar is_default: Indicates payment term is the standard payment term.
    :vartype is_default: bool
    """

    term: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Represents duration in netXX format. Always in days."""
    start_date: Optional[datetime.datetime] = rest_field(
        name="startDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The date on when the defined 'Payment Term' will be effective from and is always in UTC."""
    end_date: Optional[datetime.datetime] = rest_field(
        name="endDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The date on when the defined 'Payment Term' will end and is always in UTC."""
    is_default: Optional[bool] = rest_field(name="isDefault", visibility=["read"])
    """Indicates payment term is the standard payment term."""

    @overload
    def __init__(
        self,
        *,
        term: Optional[str] = None,
        start_date: Optional[datetime.datetime] = None,
        end_date: Optional[datetime.datetime] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingProfilePropertiesCurrentPaymentTerm(PaymentTerm):  # pylint: disable=name-too-long
    """The current payment term of the billing profile.

    :ivar term: Represents duration in netXX format. Always in days.
    :vartype term: str
    :ivar start_date: The date on when the defined 'Payment Term' will be effective from and is
     always in UTC.
    :vartype start_date: ~datetime.datetime
    :ivar end_date: The date on when the defined 'Payment Term' will end and is always in UTC.
    :vartype end_date: ~datetime.datetime
    :ivar is_default: Indicates payment term is the standard payment term.
    :vartype is_default: bool
    """

    @overload
    def __init__(
        self,
        *,
        term: Optional[str] = None,
        start_date: Optional[datetime.datetime] = None,
        end_date: Optional[datetime.datetime] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class IndirectRelationshipInfo(_Model):
    """Identifies the billing profile that is linked to another billing profile in indirect purchase
    motion.

    :ivar billing_account_name: The billing account name of the partner or the customer for an
     indirect motion.
    :vartype billing_account_name: str
    :ivar billing_profile_name: The billing profile name of the partner or the customer for an
     indirect motion.
    :vartype billing_profile_name: str
    :ivar display_name: The display name of the partner or customer for an indirect motion.
    :vartype display_name: str
    """

    billing_account_name: Optional[str] = rest_field(
        name="billingAccountName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The billing account name of the partner or the customer for an indirect motion."""
    billing_profile_name: Optional[str] = rest_field(
        name="billingProfileName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The billing profile name of the partner or the customer for an indirect motion."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The display name of the partner or customer for an indirect motion."""

    @overload
    def __init__(
        self,
        *,
        billing_account_name: Optional[str] = None,
        billing_profile_name: Optional[str] = None,
        display_name: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingProfilePropertiesIndirectRelationshipInfo(IndirectRelationshipInfo):  # pylint: disable=name-too-long
    """Identifies the billing profile that is linked to another billing profile in indirect purchase
    motion.

    :ivar billing_account_name: The billing account name of the partner or the customer for an
     indirect motion.
    :vartype billing_account_name: str
    :ivar billing_profile_name: The billing profile name of the partner or the customer for an
     indirect motion.
    :vartype billing_profile_name: str
    :ivar display_name: The display name of the partner or customer for an indirect motion.
    :vartype display_name: str
    """

    @overload
    def __init__(
        self,
        *,
        billing_account_name: Optional[str] = None,
        billing_profile_name: Optional[str] = None,
        display_name: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingProfilePropertiesShipTo(AddressDetails):
    """The default address where the products are shipped, or the services are being used. If a ship
    to is not specified for a product or a subscription, then this address will be used.

    :ivar address_line1: Address line 1. Required.
    :vartype address_line1: str
    :ivar address_line2: Address line 2.
    :vartype address_line2: str
    :ivar address_line3: Address line 3.
    :vartype address_line3: str
    :ivar city: Address city.
    :vartype city: str
    :ivar company_name: Company name. Optional for MCA Individual (Pay-as-you-go).
    :vartype company_name: str
    :ivar country: Country code uses ISO 3166-1 Alpha-2 format. Required.
    :vartype country: str
    :ivar district: Address district.
    :vartype district: str
    :ivar email: Email address.
    :vartype email: str
    :ivar first_name: First name. Optional for MCA Enterprise.
    :vartype first_name: str
    :ivar last_name: Last name. Optional for MCA Enterprise.
    :vartype last_name: str
    :ivar middle_name: Middle name.
    :vartype middle_name: str
    :ivar phone_number: Phone number.
    :vartype phone_number: str
    :ivar postal_code: Postal code.
    :vartype postal_code: str
    :ivar region: Address region.
    :vartype region: str
    :ivar is_valid_address: Indicates if the address is incomplete.
    :vartype is_valid_address: bool
    """

    @overload
    def __init__(
        self,
        *,
        address_line1: str,
        country: str,
        address_line2: Optional[str] = None,
        address_line3: Optional[str] = None,
        city: Optional[str] = None,
        company_name: Optional[str] = None,
        district: Optional[str] = None,
        email: Optional[str] = None,
        first_name: Optional[str] = None,
        last_name: Optional[str] = None,
        middle_name: Optional[str] = None,
        phone_number: Optional[str] = None,
        postal_code: Optional[str] = None,
        region: Optional[str] = None,
        is_valid_address: Optional[bool] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingProfilePropertiesSoldTo(AddressDetails):
    """The address of the individual or organization that is responsible for the billing account.

    :ivar address_line1: Address line 1. Required.
    :vartype address_line1: str
    :ivar address_line2: Address line 2.
    :vartype address_line2: str
    :ivar address_line3: Address line 3.
    :vartype address_line3: str
    :ivar city: Address city.
    :vartype city: str
    :ivar company_name: Company name. Optional for MCA Individual (Pay-as-you-go).
    :vartype company_name: str
    :ivar country: Country code uses ISO 3166-1 Alpha-2 format. Required.
    :vartype country: str
    :ivar district: Address district.
    :vartype district: str
    :ivar email: Email address.
    :vartype email: str
    :ivar first_name: First name. Optional for MCA Enterprise.
    :vartype first_name: str
    :ivar last_name: Last name. Optional for MCA Enterprise.
    :vartype last_name: str
    :ivar middle_name: Middle name.
    :vartype middle_name: str
    :ivar phone_number: Phone number.
    :vartype phone_number: str
    :ivar postal_code: Postal code.
    :vartype postal_code: str
    :ivar region: Address region.
    :vartype region: str
    :ivar is_valid_address: Indicates if the address is incomplete.
    :vartype is_valid_address: bool
    """

    @overload
    def __init__(
        self,
        *,
        address_line1: str,
        country: str,
        address_line2: Optional[str] = None,
        address_line3: Optional[str] = None,
        city: Optional[str] = None,
        company_name: Optional[str] = None,
        district: Optional[str] = None,
        email: Optional[str] = None,
        first_name: Optional[str] = None,
        last_name: Optional[str] = None,
        middle_name: Optional[str] = None,
        phone_number: Optional[str] = None,
        postal_code: Optional[str] = None,
        region: Optional[str] = None,
        is_valid_address: Optional[bool] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingProperty(ProxyResource):
    """A billing property.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: A billing property.
    :vartype properties: ~azure.mgmt.billing.models.BillingPropertyProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.BillingPropertyProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A billing property."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.BillingPropertyProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingPropertyProperties(_Model):
    """A billing property.

    :ivar billing_account_agreement_type: The type of agreement. Known values are: "Other",
     "MicrosoftCustomerAgreement", "EnterpriseAgreement", "MicrosoftOnlineServicesProgram", and
     "MicrosoftPartnerAgreement".
    :vartype billing_account_agreement_type: str or ~azure.mgmt.billing.models.AgreementType
    :ivar billing_account_display_name: The name of the billing account.
    :vartype billing_account_display_name: str
    :ivar billing_account_id: The fully qualified ID that uniquely identifies a billing account.
    :vartype billing_account_id: str
    :ivar account_admin_notification_email_address: Notification email address for legacy account.
     Available for agreement type Microsoft Online Services Program.
    :vartype account_admin_notification_email_address: str
    :ivar billing_account_sold_to_country: The country of the individual or organization that is
     responsible for the billing account.
    :vartype billing_account_sold_to_country: str
    :ivar billing_account_status: The current status of the billing account. Known values are:
     "Other", "Active", "UnderReview", "Disabled", "Deleted", "Extended", "Pending", "New",
     "Expired", "Terminated", and "Transferred".
    :vartype billing_account_status: str or ~azure.mgmt.billing.models.AccountStatus
    :ivar billing_account_status_reason_code: Reason for the specified billing account status.
     Known values are: "Other", "UnusualActivity", "ManuallyTerminated", "Expired", "Transferred",
     and "TerminateProcessing".
    :vartype billing_account_status_reason_code: str or
     ~azure.mgmt.billing.models.BillingAccountStatusReasonCode
    :ivar billing_account_type: The type of customer. Known values are: "Other", "Enterprise",
     "Individual", "Partner", "Reseller", "ClassicPartner", "Internal", "Tenant", and "Business".
    :vartype billing_account_type: str or ~azure.mgmt.billing.models.AccountType
    :ivar billing_account_sub_type: The tier of the account. Known values are: "Other", "None",
     "Individual", "Professional", and "Enterprise".
    :vartype billing_account_sub_type: str or ~azure.mgmt.billing.models.AccountSubType
    :ivar billing_currency: The billing currency for the subscription. Available for billing
     accounts with agreement type Enterprise Agreement.
    :vartype billing_currency: str
    :ivar billing_profile_display_name: The name of the billing profile.
    :vartype billing_profile_display_name: str
    :ivar billing_profile_id: The fully qualified ID that uniquely identifies a billing profile.
    :vartype billing_profile_id: str
    :ivar billing_profile_spending_limit: The billing profile spending limit. Known values are:
     "Off" and "On".
    :vartype billing_profile_spending_limit: str or ~azure.mgmt.billing.models.SpendingLimit
    :ivar billing_profile_spending_limit_details: The details of billing profile spending limit.
    :vartype billing_profile_spending_limit_details:
     list[~azure.mgmt.billing.models.SpendingLimitDetails]
    :ivar billing_profile_status: The status of the billing profile. Known values are: "Other",
     "Active", "Disabled", "Warned", "Deleted", and "UnderReview".
    :vartype billing_profile_status: str or ~azure.mgmt.billing.models.BillingProfileStatus
    :ivar billing_profile_status_reason_code: Reason for the specified billing profile status.
     Known values are: "Other", "PastDue", "UnusualActivity", "SpendingLimitReached", and
     "SpendingLimitExpired".
    :vartype billing_profile_status_reason_code: str or
     ~azure.mgmt.billing.models.BillingProfileStatusReasonCode
    :ivar billing_profile_payment_method_family: The payment method family of the primary payment
     method for the billing profile. Known values are: "Other", "None", "CreditCard", "Credits",
     "CheckWire", "EWallet", "TaskOrder", and "DirectDebit".
    :vartype billing_profile_payment_method_family: str or
     ~azure.mgmt.billing.models.PaymentMethodFamily
    :ivar billing_profile_payment_method_type: The payment method type of the primary payment
     method for the billing profile.
    :vartype billing_profile_payment_method_type: str
    :ivar billing_tenant_id: The Azure AD tenant ID of the billing account for the subscription.
    :vartype billing_tenant_id: str
    :ivar cost_center: The cost center applied to the subscription. Available for agreement type
     Microsoft Customer Agreement and Microsoft Partner Agreement. This property can be updated via
     patch.
    :vartype cost_center: str
    :ivar customer_display_name: The name of the customer.
    :vartype customer_display_name: str
    :ivar customer_id: The fully qualified ID that uniquely identifies a customer.
    :vartype customer_id: str
    :ivar customer_status: Identifies the status of an customer. This is an upcoming property that
     will be populated in the future. Known values are: "Other", "Active", "Pending", "Disabled",
     "Warned", "Deleted", and "UnderReview".
    :vartype customer_status: str or ~azure.mgmt.billing.models.CustomerStatus
    :ivar invoice_section_display_name: The name of the invoice section.
    :vartype invoice_section_display_name: str
    :ivar invoice_section_id: The fully qualified ID that uniquely identifies an invoice section.
    :vartype invoice_section_id: str
    :ivar invoice_section_status: Identifies the status of an invoice section. Known values are:
     "Other", "Active", "Deleted", "Disabled", "UnderReview", "Warned", and "Restricted".
    :vartype invoice_section_status: str or ~azure.mgmt.billing.models.InvoiceSectionState
    :ivar invoice_section_status_reason_code: Reason for the specified invoice section status.
     Known values are: "Other", "PastDue", "UnusualActivity", "SpendingLimitReached", and
     "SpendingLimitExpired".
    :vartype invoice_section_status_reason_code: str or
     ~azure.mgmt.billing.models.InvoiceSectionStateReasonCode
    :ivar is_transitioned_billing_account: Specifies if the billing account for the subscription is
     transitioned from a Microsoft Online Service Program to a Microsoft Customer Agreement (MCA)
     account. Will be present and value will be true if its a transitioned billing account.
    :vartype is_transitioned_billing_account: bool
    :ivar sku_description: The sku description.
    :vartype sku_description: str
    :ivar sku_id: The ID that uniquely identifies a sku.
    :vartype sku_id: str
    :ivar subscription_billing_status: The subscription status. Known values are: "Other",
     "Unknown", "Active", "Disabled", "Deleted", "Warned", "Expiring", "Expired", "AutoRenew",
     "Cancelled", "Suspended", and "Failed".
    :vartype subscription_billing_status: str or
     ~azure.mgmt.billing.models.BillingSubscriptionStatus
    :ivar subscription_billing_status_details: The reason codes for the subscription status.
    :vartype subscription_billing_status_details:
     list[~azure.mgmt.billing.models.BillingSubscriptionStatusDetails]
    :ivar subscription_billing_type: The type of billing subscription. Known values are: "None",
     "Benefit", "Free", "Paid", and "PrePaid".
    :vartype subscription_billing_type: str or ~azure.mgmt.billing.models.SubscriptionBillingType
    :ivar subscription_service_usage_address: The address of the individual or organization where
     service subscription is being used. Available for agreement type Microsoft Online Services
     Program. This property can be updated via patch.
    :vartype subscription_service_usage_address:
     ~azure.mgmt.billing.models.BillingPropertyPropertiesSubscriptionServiceUsageAddress
    :ivar subscription_workload_type: The Azure workload type of the subscription. Known values
     are: "None", "Production", "DevTest", and "Internal".
    :vartype subscription_workload_type: str or ~azure.mgmt.billing.models.SubscriptionWorkloadType
    :ivar enrollment_details: The enrollment details for the subscription. Available for billing
     accounts with agreement type Enterprise Agreement.
    :vartype enrollment_details:
     ~azure.mgmt.billing.models.BillingPropertyPropertiesEnrollmentDetails
    :ivar is_account_admin: Indicates whether user is the account admin.
    :vartype is_account_admin: bool
    :ivar product_id: The ID that uniquely identifies a product.
    :vartype product_id: str
    :ivar product_name: The ID that uniquely identifies a product.
    :vartype product_name: str
    """

    billing_account_agreement_type: Optional[Union[str, "_models.AgreementType"]] = rest_field(
        name="billingAccountAgreementType", visibility=["read"]
    )
    """The type of agreement. Known values are: \"Other\", \"MicrosoftCustomerAgreement\",
     \"EnterpriseAgreement\", \"MicrosoftOnlineServicesProgram\", and \"MicrosoftPartnerAgreement\"."""
    billing_account_display_name: Optional[str] = rest_field(name="billingAccountDisplayName", visibility=["read"])
    """The name of the billing account."""
    billing_account_id: Optional[str] = rest_field(name="billingAccountId", visibility=["read"])
    """The fully qualified ID that uniquely identifies a billing account."""
    account_admin_notification_email_address: Optional[str] = rest_field(
        name="accountAdminNotificationEmailAddress", visibility=["read"]
    )
    """Notification email address for legacy account. Available for agreement type Microsoft Online
     Services Program."""
    billing_account_sold_to_country: Optional[str] = rest_field(name="billingAccountSoldToCountry", visibility=["read"])
    """The country of the individual or organization that is responsible for the billing account."""
    billing_account_status: Optional[Union[str, "_models.AccountStatus"]] = rest_field(
        name="billingAccountStatus", visibility=["read"]
    )
    """The current status of the billing account. Known values are: \"Other\", \"Active\",
     \"UnderReview\", \"Disabled\", \"Deleted\", \"Extended\", \"Pending\", \"New\", \"Expired\",
     \"Terminated\", and \"Transferred\"."""
    billing_account_status_reason_code: Optional[Union[str, "_models.BillingAccountStatusReasonCode"]] = rest_field(
        name="billingAccountStatusReasonCode", visibility=["read"]
    )
    """Reason for the specified billing account status. Known values are: \"Other\",
     \"UnusualActivity\", \"ManuallyTerminated\", \"Expired\", \"Transferred\", and
     \"TerminateProcessing\"."""
    billing_account_type: Optional[Union[str, "_models.AccountType"]] = rest_field(
        name="billingAccountType", visibility=["read"]
    )
    """The type of customer. Known values are: \"Other\", \"Enterprise\", \"Individual\", \"Partner\",
     \"Reseller\", \"ClassicPartner\", \"Internal\", \"Tenant\", and \"Business\"."""
    billing_account_sub_type: Optional[Union[str, "_models.AccountSubType"]] = rest_field(
        name="billingAccountSubType", visibility=["read"]
    )
    """The tier of the account. Known values are: \"Other\", \"None\", \"Individual\",
     \"Professional\", and \"Enterprise\"."""
    billing_currency: Optional[str] = rest_field(name="billingCurrency", visibility=["read"])
    """The billing currency for the subscription. Available for billing accounts with agreement type
     Enterprise Agreement."""
    billing_profile_display_name: Optional[str] = rest_field(name="billingProfileDisplayName", visibility=["read"])
    """The name of the billing profile."""
    billing_profile_id: Optional[str] = rest_field(name="billingProfileId", visibility=["read"])
    """The fully qualified ID that uniquely identifies a billing profile."""
    billing_profile_spending_limit: Optional[Union[str, "_models.SpendingLimit"]] = rest_field(
        name="billingProfileSpendingLimit", visibility=["read"]
    )
    """The billing profile spending limit. Known values are: \"Off\" and \"On\"."""
    billing_profile_spending_limit_details: Optional[list["_models.SpendingLimitDetails"]] = rest_field(
        name="billingProfileSpendingLimitDetails", visibility=["read"]
    )
    """The details of billing profile spending limit."""
    billing_profile_status: Optional[Union[str, "_models.BillingProfileStatus"]] = rest_field(
        name="billingProfileStatus", visibility=["read"]
    )
    """The status of the billing profile. Known values are: \"Other\", \"Active\", \"Disabled\",
     \"Warned\", \"Deleted\", and \"UnderReview\"."""
    billing_profile_status_reason_code: Optional[Union[str, "_models.BillingProfileStatusReasonCode"]] = rest_field(
        name="billingProfileStatusReasonCode", visibility=["read"]
    )
    """Reason for the specified billing profile status. Known values are: \"Other\", \"PastDue\",
     \"UnusualActivity\", \"SpendingLimitReached\", and \"SpendingLimitExpired\"."""
    billing_profile_payment_method_family: Optional[Union[str, "_models.PaymentMethodFamily"]] = rest_field(
        name="billingProfilePaymentMethodFamily", visibility=["read"]
    )
    """The payment method family of the primary payment method for the billing profile. Known values
     are: \"Other\", \"None\", \"CreditCard\", \"Credits\", \"CheckWire\", \"EWallet\",
     \"TaskOrder\", and \"DirectDebit\"."""
    billing_profile_payment_method_type: Optional[str] = rest_field(
        name="billingProfilePaymentMethodType", visibility=["read"]
    )
    """The payment method type of the primary payment method for the billing profile."""
    billing_tenant_id: Optional[str] = rest_field(name="billingTenantId", visibility=["read"])
    """The Azure AD tenant ID of the billing account for the subscription."""
    cost_center: Optional[str] = rest_field(
        name="costCenter", visibility=["read", "create", "update", "delete", "query"]
    )
    """The cost center applied to the subscription. Available for agreement type Microsoft Customer
     Agreement and Microsoft Partner Agreement. This property can be updated via patch."""
    customer_display_name: Optional[str] = rest_field(name="customerDisplayName", visibility=["read"])
    """The name of the customer."""
    customer_id: Optional[str] = rest_field(name="customerId", visibility=["read"])
    """The fully qualified ID that uniquely identifies a customer."""
    customer_status: Optional[Union[str, "_models.CustomerStatus"]] = rest_field(
        name="customerStatus", visibility=["read"]
    )
    """Identifies the status of an customer. This is an upcoming property that will be populated in
     the future. Known values are: \"Other\", \"Active\", \"Pending\", \"Disabled\", \"Warned\",
     \"Deleted\", and \"UnderReview\"."""
    invoice_section_display_name: Optional[str] = rest_field(name="invoiceSectionDisplayName", visibility=["read"])
    """The name of the invoice section."""
    invoice_section_id: Optional[str] = rest_field(name="invoiceSectionId", visibility=["read"])
    """The fully qualified ID that uniquely identifies an invoice section."""
    invoice_section_status: Optional[Union[str, "_models.InvoiceSectionState"]] = rest_field(
        name="invoiceSectionStatus", visibility=["read"]
    )
    """Identifies the status of an invoice section. Known values are: \"Other\", \"Active\",
     \"Deleted\", \"Disabled\", \"UnderReview\", \"Warned\", and \"Restricted\"."""
    invoice_section_status_reason_code: Optional[Union[str, "_models.InvoiceSectionStateReasonCode"]] = rest_field(
        name="invoiceSectionStatusReasonCode", visibility=["read"]
    )
    """Reason for the specified invoice section status. Known values are: \"Other\", \"PastDue\",
     \"UnusualActivity\", \"SpendingLimitReached\", and \"SpendingLimitExpired\"."""
    is_transitioned_billing_account: Optional[bool] = rest_field(
        name="isTransitionedBillingAccount", visibility=["read"]
    )
    """Specifies if the billing account for the subscription is transitioned from a Microsoft Online
     Service Program to a Microsoft Customer Agreement (MCA) account. Will be present and value will
     be true if its a transitioned billing account."""
    sku_description: Optional[str] = rest_field(name="skuDescription", visibility=["read"])
    """The sku description."""
    sku_id: Optional[str] = rest_field(name="skuId", visibility=["read"])
    """The ID that uniquely identifies a sku."""
    subscription_billing_status: Optional[Union[str, "_models.BillingSubscriptionStatus"]] = rest_field(
        name="subscriptionBillingStatus", visibility=["read"]
    )
    """The subscription status. Known values are: \"Other\", \"Unknown\", \"Active\", \"Disabled\",
     \"Deleted\", \"Warned\", \"Expiring\", \"Expired\", \"AutoRenew\", \"Cancelled\",
     \"Suspended\", and \"Failed\"."""
    subscription_billing_status_details: Optional[list["_models.BillingSubscriptionStatusDetails"]] = rest_field(
        name="subscriptionBillingStatusDetails", visibility=["read"]
    )
    """The reason codes for the subscription status."""
    subscription_billing_type: Optional[Union[str, "_models.SubscriptionBillingType"]] = rest_field(
        name="subscriptionBillingType", visibility=["read"]
    )
    """The type of billing subscription. Known values are: \"None\", \"Benefit\", \"Free\", \"Paid\",
     and \"PrePaid\"."""
    subscription_service_usage_address: Optional["_models.BillingPropertyPropertiesSubscriptionServiceUsageAddress"] = (
        rest_field(name="subscriptionServiceUsageAddress", visibility=["read", "create", "update", "delete", "query"])
    )
    """The address of the individual or organization where service subscription is being used.
     Available for agreement type Microsoft Online Services Program. This property can be updated
     via patch."""
    subscription_workload_type: Optional[Union[str, "_models.SubscriptionWorkloadType"]] = rest_field(
        name="subscriptionWorkloadType", visibility=["read"]
    )
    """The Azure workload type of the subscription. Known values are: \"None\", \"Production\",
     \"DevTest\", and \"Internal\"."""
    enrollment_details: Optional["_models.BillingPropertyPropertiesEnrollmentDetails"] = rest_field(
        name="enrollmentDetails", visibility=["read", "create", "update", "delete", "query"]
    )
    """The enrollment details for the subscription. Available for billing accounts with agreement type
     Enterprise Agreement."""
    is_account_admin: Optional[bool] = rest_field(name="isAccountAdmin", visibility=["read"])
    """Indicates whether user is the account admin."""
    product_id: Optional[str] = rest_field(name="productId", visibility=["read"])
    """The ID that uniquely identifies a product."""
    product_name: Optional[str] = rest_field(name="productName", visibility=["read"])
    """The ID that uniquely identifies a product."""

    @overload
    def __init__(  # pylint: disable=too-many-locals
        self,
        *,
        cost_center: Optional[str] = None,
        subscription_service_usage_address: Optional[
            "_models.BillingPropertyPropertiesSubscriptionServiceUsageAddress"
        ] = None,
        enrollment_details: Optional["_models.BillingPropertyPropertiesEnrollmentDetails"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SubscriptionEnrollmentDetails(_Model):
    """The enrollment details for the subscription. Available for billing accounts with agreement type
    Enterprise Agreement.

    :ivar department_display_name: The name of the department.
    :vartype department_display_name: str
    :ivar department_id: The ID that uniquely identifies the department.
    :vartype department_id: str
    :ivar enrollment_account_status: The status of the enrollment account.
    :vartype enrollment_account_status: str
    :ivar enrollment_account_display_name: The name of the enrollment account.
    :vartype enrollment_account_display_name: str
    :ivar enrollment_account_id: The ID that uniquely identifies an enrollment account.
    :vartype enrollment_account_id: str
    """

    department_display_name: Optional[str] = rest_field(
        name="departmentDisplayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the department."""
    department_id: Optional[str] = rest_field(
        name="departmentId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The ID that uniquely identifies the department."""
    enrollment_account_status: Optional[str] = rest_field(
        name="enrollmentAccountStatus", visibility=["read", "create", "update", "delete", "query"]
    )
    """The status of the enrollment account."""
    enrollment_account_display_name: Optional[str] = rest_field(
        name="enrollmentAccountDisplayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the enrollment account."""
    enrollment_account_id: Optional[str] = rest_field(
        name="enrollmentAccountId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The ID that uniquely identifies an enrollment account."""

    @overload
    def __init__(
        self,
        *,
        department_display_name: Optional[str] = None,
        department_id: Optional[str] = None,
        enrollment_account_status: Optional[str] = None,
        enrollment_account_display_name: Optional[str] = None,
        enrollment_account_id: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingPropertyPropertiesEnrollmentDetails(SubscriptionEnrollmentDetails):  # pylint: disable=name-too-long
    """The enrollment details for the subscription. Available for billing accounts with agreement type
    Enterprise Agreement.

    :ivar department_display_name: The name of the department.
    :vartype department_display_name: str
    :ivar department_id: The ID that uniquely identifies the department.
    :vartype department_id: str
    :ivar enrollment_account_status: The status of the enrollment account.
    :vartype enrollment_account_status: str
    :ivar enrollment_account_display_name: The name of the enrollment account.
    :vartype enrollment_account_display_name: str
    :ivar enrollment_account_id: The ID that uniquely identifies an enrollment account.
    :vartype enrollment_account_id: str
    """

    @overload
    def __init__(
        self,
        *,
        department_display_name: Optional[str] = None,
        department_id: Optional[str] = None,
        enrollment_account_status: Optional[str] = None,
        enrollment_account_display_name: Optional[str] = None,
        enrollment_account_id: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingPropertyPropertiesSubscriptionServiceUsageAddress(AddressDetails):  # pylint: disable=name-too-long
    """The address of the individual or organization where service subscription is being used.
    Available for agreement type Microsoft Online Services Program. This property can be updated
    via patch.

    :ivar address_line1: Address line 1. Required.
    :vartype address_line1: str
    :ivar address_line2: Address line 2.
    :vartype address_line2: str
    :ivar address_line3: Address line 3.
    :vartype address_line3: str
    :ivar city: Address city.
    :vartype city: str
    :ivar company_name: Company name. Optional for MCA Individual (Pay-as-you-go).
    :vartype company_name: str
    :ivar country: Country code uses ISO 3166-1 Alpha-2 format. Required.
    :vartype country: str
    :ivar district: Address district.
    :vartype district: str
    :ivar email: Email address.
    :vartype email: str
    :ivar first_name: First name. Optional for MCA Enterprise.
    :vartype first_name: str
    :ivar last_name: Last name. Optional for MCA Enterprise.
    :vartype last_name: str
    :ivar middle_name: Middle name.
    :vartype middle_name: str
    :ivar phone_number: Phone number.
    :vartype phone_number: str
    :ivar postal_code: Postal code.
    :vartype postal_code: str
    :ivar region: Address region.
    :vartype region: str
    :ivar is_valid_address: Indicates if the address is incomplete.
    :vartype is_valid_address: bool
    """

    @overload
    def __init__(
        self,
        *,
        address_line1: str,
        country: str,
        address_line2: Optional[str] = None,
        address_line3: Optional[str] = None,
        city: Optional[str] = None,
        company_name: Optional[str] = None,
        district: Optional[str] = None,
        email: Optional[str] = None,
        first_name: Optional[str] = None,
        last_name: Optional[str] = None,
        middle_name: Optional[str] = None,
        phone_number: Optional[str] = None,
        postal_code: Optional[str] = None,
        region: Optional[str] = None,
        is_valid_address: Optional[bool] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingRequest(ProxyResource):
    """A request submitted by a user to manage billing. Users with an owner role on the scope can
    approve or decline these requests.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: A request submitted by a user to manage billing. Users with an owner role on
     the scope can approve or decline these requests.
    :vartype properties: ~azure.mgmt.billing.models.BillingRequestProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.BillingRequestProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A request submitted by a user to manage billing. Users with an owner role on the scope can
     approve or decline these requests."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.BillingRequestProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingRequestProperties(_Model):
    """A request submitted by a user to manage billing. Users with an owner role on the scope can
    approve or decline these requests.

    :ivar provisioning_state: The provisioning state of the resource during a long-running
     operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending",
     "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired".
    :vartype provisioning_state: str or ~azure.mgmt.billing.models.ProvisioningState
    :ivar additional_information: Additional information for the billing request.
    :vartype additional_information: dict[str, str]
    :ivar reviewed_by: The principal of the request reviewer. Will only be set if request is
     approved.
    :vartype reviewed_by: ~azure.mgmt.billing.models.BillingRequestPropertiesReviewedBy
    :ivar reviewal_date: The date and time when the request was reviewed.
    :vartype reviewal_date: ~datetime.datetime
    :ivar billing_account_id: The fully qualified ID that uniquely identifies a billing account.
    :vartype billing_account_id: str
    :ivar billing_account_name: The ID that uniquely identifies a billing account.
    :vartype billing_account_name: str
    :ivar billing_account_display_name: The name of the billing account.
    :vartype billing_account_display_name: str
    :ivar billing_account_primary_billing_tenant_id: The primary tenant ID of the billing account
     for which the billing request was submitted.
    :vartype billing_account_primary_billing_tenant_id: str
    :ivar billing_profile_id: The fully qualified ID that uniquely identifies a billing profile.
    :vartype billing_profile_id: str
    :ivar billing_profile_name: The ID that uniquely identifies a billing profile.
    :vartype billing_profile_name: str
    :ivar billing_profile_display_name: The name of the billing profile.
    :vartype billing_profile_display_name: str
    :ivar created_by: The principal of the entity who created the request.
    :vartype created_by: ~azure.mgmt.billing.models.BillingRequestPropertiesCreatedBy
    :ivar creation_date: The date and time when the request was created.
    :vartype creation_date: ~datetime.datetime
    :ivar expiration_date: The date and time when the request expires.
    :vartype expiration_date: ~datetime.datetime
    :ivar decision_reason: The reason to approve or decline the request.
    :vartype decision_reason: str
    :ivar invoice_section_id: The fully qualified ID that uniquely identifies an invoice section.
    :vartype invoice_section_id: str
    :ivar invoice_section_name: The ID that uniquely identifies an invoice section.
    :vartype invoice_section_name: str
    :ivar invoice_section_display_name: The name of the invoice section.
    :vartype invoice_section_display_name: str
    :ivar customer_id: The fully qualified ID that uniquely identifies a customer.
    :vartype customer_id: str
    :ivar customer_name: The ID that uniquely identifies a customer.
    :vartype customer_name: str
    :ivar customer_display_name: The name of the customer.
    :vartype customer_display_name: str
    :ivar subscription_id: The fully qualified ID that uniquely identifies a billing subscription.
    :vartype subscription_id: str
    :ivar subscription_name: The ID that uniquely identifies a billing subscription.
    :vartype subscription_name: str
    :ivar subscription_display_name: The name of the billing subscription.
    :vartype subscription_display_name: str
    :ivar justification: Justification for submitting request.
    :vartype justification: str
    :ivar recipients: The recipients of the billing request.
    :vartype recipients: list[~azure.mgmt.billing.models.Principal]
    :ivar request_scope: The billing scope for which the request was submitted (ex.
     '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}').
    :vartype request_scope: str
    :ivar billing_scope: The billing scope for which the request will be applied. This is a read
     only property derived by the service.
    :vartype billing_scope: str
    :ivar status: Status of billing request. Known values are: "Other", "Pending", "Approved",
     "Declined", "Cancelled", "Completed", and "Expired".
    :vartype status: str or ~azure.mgmt.billing.models.BillingRequestStatus
    :ivar type: Type of billing request. Known values are: "Other", "InvoiceAccess",
     "ProvisioningAccess", "RoleAssignment", and "UpdateBillingPolicy".
    :vartype type: str or ~azure.mgmt.billing.models.BillingRequestType
    :ivar last_updated_by: The principal of the entity who last updated the request.
    :vartype last_updated_by: ~azure.mgmt.billing.models.BillingRequestPropertiesLastUpdatedBy
    :ivar last_updated_date: Date and time of last update.
    :vartype last_updated_date: ~datetime.datetime
    """

    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the resource during a long-running operation. Known values are:
     \"Succeeded\", \"Canceled\", \"Failed\", \"New\", \"Pending\", \"Provisioning\",
     \"PendingBilling\", \"ConfirmedBilling\", \"Creating\", \"Created\", and \"Expired\"."""
    additional_information: Optional[dict[str, str]] = rest_field(
        name="additionalInformation", visibility=["read", "create", "update", "delete", "query"]
    )
    """Additional information for the billing request."""
    reviewed_by: Optional["_models.BillingRequestPropertiesReviewedBy"] = rest_field(
        name="reviewedBy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The principal of the request reviewer. Will only be set if request is approved."""
    reviewal_date: Optional[datetime.datetime] = rest_field(name="reviewalDate", visibility=["read"], format="rfc3339")
    """The date and time when the request was reviewed."""
    billing_account_id: Optional[str] = rest_field(name="billingAccountId", visibility=["read"])
    """The fully qualified ID that uniquely identifies a billing account."""
    billing_account_name: Optional[str] = rest_field(name="billingAccountName", visibility=["read"])
    """The ID that uniquely identifies a billing account."""
    billing_account_display_name: Optional[str] = rest_field(name="billingAccountDisplayName", visibility=["read"])
    """The name of the billing account."""
    billing_account_primary_billing_tenant_id: Optional[str] = rest_field(
        name="billingAccountPrimaryBillingTenantId", visibility=["read"]
    )
    """The primary tenant ID of the billing account for which the billing request was submitted."""
    billing_profile_id: Optional[str] = rest_field(name="billingProfileId", visibility=["read"])
    """The fully qualified ID that uniquely identifies a billing profile."""
    billing_profile_name: Optional[str] = rest_field(name="billingProfileName", visibility=["read"])
    """The ID that uniquely identifies a billing profile."""
    billing_profile_display_name: Optional[str] = rest_field(name="billingProfileDisplayName", visibility=["read"])
    """The name of the billing profile."""
    created_by: Optional["_models.BillingRequestPropertiesCreatedBy"] = rest_field(
        name="createdBy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The principal of the entity who created the request."""
    creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339")
    """The date and time when the request was created."""
    expiration_date: Optional[datetime.datetime] = rest_field(
        name="expirationDate", visibility=["read"], format="rfc3339"
    )
    """The date and time when the request expires."""
    decision_reason: Optional[str] = rest_field(
        name="decisionReason", visibility=["read", "create", "update", "delete", "query"]
    )
    """The reason to approve or decline the request."""
    invoice_section_id: Optional[str] = rest_field(name="invoiceSectionId", visibility=["read"])
    """The fully qualified ID that uniquely identifies an invoice section."""
    invoice_section_name: Optional[str] = rest_field(name="invoiceSectionName", visibility=["read"])
    """The ID that uniquely identifies an invoice section."""
    invoice_section_display_name: Optional[str] = rest_field(name="invoiceSectionDisplayName", visibility=["read"])
    """The name of the invoice section."""
    customer_id: Optional[str] = rest_field(name="customerId", visibility=["read"])
    """The fully qualified ID that uniquely identifies a customer."""
    customer_name: Optional[str] = rest_field(name="customerName", visibility=["read"])
    """The ID that uniquely identifies a customer."""
    customer_display_name: Optional[str] = rest_field(name="customerDisplayName", visibility=["read"])
    """The name of the customer."""
    subscription_id: Optional[str] = rest_field(name="subscriptionId", visibility=["read"])
    """The fully qualified ID that uniquely identifies a billing subscription."""
    subscription_name: Optional[str] = rest_field(name="subscriptionName", visibility=["read"])
    """The ID that uniquely identifies a billing subscription."""
    subscription_display_name: Optional[str] = rest_field(name="subscriptionDisplayName", visibility=["read"])
    """The name of the billing subscription."""
    justification: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Justification for submitting request."""
    recipients: Optional[list["_models.Principal"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The recipients of the billing request."""
    request_scope: Optional[str] = rest_field(
        name="requestScope", visibility=["read", "create", "update", "delete", "query"]
    )
    """The billing scope for which the request was submitted (ex.
     '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}')."""
    billing_scope: Optional[str] = rest_field(name="billingScope", visibility=["read"])
    """The billing scope for which the request will be applied. This is a read only property derived
     by the service."""
    status: Optional[Union[str, "_models.BillingRequestStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Status of billing request. Known values are: \"Other\", \"Pending\", \"Approved\",
     \"Declined\", \"Cancelled\", \"Completed\", and \"Expired\"."""
    type: Optional[Union[str, "_models.BillingRequestType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of billing request. Known values are: \"Other\", \"InvoiceAccess\",
     \"ProvisioningAccess\", \"RoleAssignment\", and \"UpdateBillingPolicy\"."""
    last_updated_by: Optional["_models.BillingRequestPropertiesLastUpdatedBy"] = rest_field(
        name="lastUpdatedBy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The principal of the entity who last updated the request."""
    last_updated_date: Optional[datetime.datetime] = rest_field(
        name="lastUpdatedDate", visibility=["read"], format="rfc3339"
    )
    """Date and time of last update."""

    @overload
    def __init__(  # pylint: disable=too-many-locals
        self,
        *,
        additional_information: Optional[dict[str, str]] = None,
        reviewed_by: Optional["_models.BillingRequestPropertiesReviewedBy"] = None,
        created_by: Optional["_models.BillingRequestPropertiesCreatedBy"] = None,
        decision_reason: Optional[str] = None,
        justification: Optional[str] = None,
        recipients: Optional[list["_models.Principal"]] = None,
        request_scope: Optional[str] = None,
        status: Optional[Union[str, "_models.BillingRequestStatus"]] = None,
        type: Optional[Union[str, "_models.BillingRequestType"]] = None,
        last_updated_by: Optional["_models.BillingRequestPropertiesLastUpdatedBy"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class Principal(_Model):
    """A principal who has interacted with a billing entity.

    :ivar tenant_id: The tenant id of the principal who has interacted with a billing entity.
    :vartype tenant_id: str
    :ivar object_id: The object id of the principal who has interacted with a billing entity.
    :vartype object_id: str
    :ivar upn: The user principal name of the principal who has interacted with a billing entity.
    :vartype upn: str
    """

    tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"])
    """The tenant id of the principal who has interacted with a billing entity."""
    object_id: Optional[str] = rest_field(name="objectId", visibility=["read", "create", "update", "delete", "query"])
    """The object id of the principal who has interacted with a billing entity."""
    upn: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The user principal name of the principal who has interacted with a billing entity."""

    @overload
    def __init__(
        self,
        *,
        tenant_id: Optional[str] = None,
        object_id: Optional[str] = None,
        upn: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingRequestPropertiesCreatedBy(Principal):
    """The principal of the entity who created the request.

    :ivar tenant_id: The tenant id of the principal who has interacted with a billing entity.
    :vartype tenant_id: str
    :ivar object_id: The object id of the principal who has interacted with a billing entity.
    :vartype object_id: str
    :ivar upn: The user principal name of the principal who has interacted with a billing entity.
    :vartype upn: str
    """

    @overload
    def __init__(
        self,
        *,
        tenant_id: Optional[str] = None,
        object_id: Optional[str] = None,
        upn: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingRequestPropertiesLastUpdatedBy(Principal):
    """The principal of the entity who last updated the request.

    :ivar tenant_id: The tenant id of the principal who has interacted with a billing entity.
    :vartype tenant_id: str
    :ivar object_id: The object id of the principal who has interacted with a billing entity.
    :vartype object_id: str
    :ivar upn: The user principal name of the principal who has interacted with a billing entity.
    :vartype upn: str
    """

    @overload
    def __init__(
        self,
        *,
        tenant_id: Optional[str] = None,
        object_id: Optional[str] = None,
        upn: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingRequestPropertiesReviewedBy(Principal):
    """The principal of the request reviewer. Will only be set if request is approved.

    :ivar tenant_id: The tenant id of the principal who has interacted with a billing entity.
    :vartype tenant_id: str
    :ivar object_id: The object id of the principal who has interacted with a billing entity.
    :vartype object_id: str
    :ivar upn: The user principal name of the principal who has interacted with a billing entity.
    :vartype upn: str
    """

    @overload
    def __init__(
        self,
        *,
        tenant_id: Optional[str] = None,
        object_id: Optional[str] = None,
        upn: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingRoleAssignment(ProxyResource):
    """The properties of the billing role assignment.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: The properties of the billing role assignment.
    :vartype properties: ~azure.mgmt.billing.models.BillingRoleAssignmentProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.BillingRoleAssignmentProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the billing role assignment."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.BillingRoleAssignmentProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingRoleAssignmentListResult(_Model):
    """Paged collection of BillingRoleAssignment items.

    :ivar value: The BillingRoleAssignment items on this page. Required.
    :vartype value: list[~azure.mgmt.billing.models.BillingRoleAssignment]
    :ivar next_link: The link to the next page of items.
    :vartype next_link: str
    """

    value: list["_models.BillingRoleAssignment"] = rest_field(visibility=["read"])
    """The BillingRoleAssignment items on this page. Required."""
    next_link: Optional[str] = rest_field(name="nextLink", visibility=["read", "create", "update", "delete", "query"])
    """The link to the next page of items."""

    @overload
    def __init__(
        self,
        *,
        next_link: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingRoleAssignmentProperties(_Model):
    """The properties of the billing role assignment.

    :ivar provisioning_state: The provisioning state of the resource during a long-running
     operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending",
     "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired".
    :vartype provisioning_state: str or ~azure.mgmt.billing.models.ProvisioningState
    :ivar created_on: The date the role assignment was created.
    :vartype created_on: ~datetime.datetime
    :ivar created_by_principal_tenant_id: The tenant Id of the user who created the role
     assignment.
    :vartype created_by_principal_tenant_id: str
    :ivar created_by_principal_id: The object ID of the user who created the role assignment.
    :vartype created_by_principal_id: str
    :ivar created_by_principal_puid: The principal PUID of the user who created the role
     assignment.
    :vartype created_by_principal_puid: str
    :ivar created_by_user_email_address: The email address of the user who created the role
     assignment. This is supported only for billing accounts with agreement type Enterprise
     Agreement.
    :vartype created_by_user_email_address: str
    :ivar modified_on: The date the role assignment was modified.
    :vartype modified_on: ~datetime.datetime
    :ivar modified_by_principal_puid: The principal PUID of the user who modified the role
     assignment.
    :vartype modified_by_principal_puid: str
    :ivar modified_by_user_email_address: The email address of the user who modified the role
     assignment. This is supported only for billing accounts with agreement type Enterprise
     Agreement.
    :vartype modified_by_user_email_address: str
    :ivar modified_by_principal_id: The principal PUID of the user who modified the role
     assignment.
    :vartype modified_by_principal_id: str
    :ivar modified_by_principal_tenant_id: The tenant Id of the user who modified the role
     assignment.
    :vartype modified_by_principal_tenant_id: str
    :ivar principal_puid: The principal PUID of the user to whom the role was assigned.
    :vartype principal_puid: str
    :ivar principal_id: The object id of the user to whom the role was assigned.
    :vartype principal_id: str
    :ivar principal_tenant_id: The principal tenant id of the user to whom the role was assigned.
    :vartype principal_tenant_id: str
    :ivar role_definition_id: The ID of the role definition. Required.
    :vartype role_definition_id: str
    :ivar scope: The scope at which the role was assigned.
    :vartype scope: str
    :ivar user_authentication_type: The authentication type of the user, whether Organization or
     MSA, of the user to whom the role was assigned. This is supported only for billing accounts
     with agreement type Enterprise Agreement.
    :vartype user_authentication_type: str
    :ivar user_email_address: The email address of the user to whom the role was assigned. This is
     supported only for billing accounts with agreement type Enterprise Agreement.
    :vartype user_email_address: str
    :ivar principal_tenant_name: The friendly name of the tenant of the user to whom the role was
     assigned. This will be 'Primary Tenant' for the primary tenant of the billing account.
    :vartype principal_tenant_name: str
    :ivar principal_display_name: The display name of the principal to whom the role was assigned.
    :vartype principal_display_name: str
    :ivar principal_type: The type of a role Assignment. Known values are: "Unknown", "None",
     "User", "Group", "DirectoryRole", "ServicePrincipal", and "Everyone".
    :vartype principal_type: str or ~azure.mgmt.billing.models.PrincipalType
    :ivar billing_request_id: The ID of the billing request that was created for the role
     assignment. This is only applicable to cross tenant role assignments or role assignments
     created through the billing request.
    :vartype billing_request_id: str
    :ivar billing_account_id: The fully qualified ID that uniquely identifies a billing account.
    :vartype billing_account_id: str
    :ivar billing_account_display_name: The name of the billing account.
    :vartype billing_account_display_name: str
    :ivar billing_profile_id: The fully qualified ID that uniquely identifies a billing profile.
    :vartype billing_profile_id: str
    :ivar billing_profile_display_name: The name of the billing profile.
    :vartype billing_profile_display_name: str
    :ivar invoice_section_id: The fully qualified ID that uniquely identifies an invoice section.
    :vartype invoice_section_id: str
    :ivar invoice_section_display_name: The name of the invoice section.
    :vartype invoice_section_display_name: str
    :ivar customer_id: The fully qualified ID that uniquely identifies a customer.
    :vartype customer_id: str
    :ivar customer_display_name: The name of the customer.
    :vartype customer_display_name: str
    """

    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the resource during a long-running operation. Known values are:
     \"Succeeded\", \"Canceled\", \"Failed\", \"New\", \"Pending\", \"Provisioning\",
     \"PendingBilling\", \"ConfirmedBilling\", \"Creating\", \"Created\", and \"Expired\"."""
    created_on: Optional[datetime.datetime] = rest_field(name="createdOn", visibility=["read"], format="rfc3339")
    """The date the role assignment was created."""
    created_by_principal_tenant_id: Optional[str] = rest_field(name="createdByPrincipalTenantId", visibility=["read"])
    """The tenant Id of the user who created the role assignment."""
    created_by_principal_id: Optional[str] = rest_field(name="createdByPrincipalId", visibility=["read"])
    """The object ID of the user who created the role assignment."""
    created_by_principal_puid: Optional[str] = rest_field(name="createdByPrincipalPuid", visibility=["read"])
    """The principal PUID of the user who created the role assignment."""
    created_by_user_email_address: Optional[str] = rest_field(name="createdByUserEmailAddress", visibility=["read"])
    """The email address of the user who created the role assignment. This is supported only for
     billing accounts with agreement type Enterprise Agreement."""
    modified_on: Optional[datetime.datetime] = rest_field(name="modifiedOn", visibility=["read"], format="rfc3339")
    """The date the role assignment was modified."""
    modified_by_principal_puid: Optional[str] = rest_field(name="modifiedByPrincipalPuid", visibility=["read"])
    """The principal PUID of the user who modified the role assignment."""
    modified_by_user_email_address: Optional[str] = rest_field(name="modifiedByUserEmailAddress", visibility=["read"])
    """The email address of the user who modified the role assignment. This is supported only for
     billing accounts with agreement type Enterprise Agreement."""
    modified_by_principal_id: Optional[str] = rest_field(name="modifiedByPrincipalId", visibility=["read"])
    """The principal PUID of the user who modified the role assignment."""
    modified_by_principal_tenant_id: Optional[str] = rest_field(name="modifiedByPrincipalTenantId", visibility=["read"])
    """The tenant Id of the user who modified the role assignment."""
    principal_puid: Optional[str] = rest_field(
        name="principalPuid", visibility=["read", "create", "update", "delete", "query"]
    )
    """The principal PUID of the user to whom the role was assigned."""
    principal_id: Optional[str] = rest_field(
        name="principalId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The object id of the user to whom the role was assigned."""
    principal_tenant_id: Optional[str] = rest_field(
        name="principalTenantId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The principal tenant id of the user to whom the role was assigned."""
    role_definition_id: str = rest_field(
        name="roleDefinitionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The ID of the role definition. Required."""
    scope: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The scope at which the role was assigned."""
    user_authentication_type: Optional[str] = rest_field(
        name="userAuthenticationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The authentication type of the user, whether Organization or MSA, of the user to whom the role
     was assigned. This is supported only for billing accounts with agreement type Enterprise
     Agreement."""
    user_email_address: Optional[str] = rest_field(
        name="userEmailAddress", visibility=["read", "create", "update", "delete", "query"]
    )
    """The email address of the user to whom the role was assigned. This is supported only for billing
     accounts with agreement type Enterprise Agreement."""
    principal_tenant_name: Optional[str] = rest_field(name="principalTenantName", visibility=["read"])
    """The friendly name of the tenant of the user to whom the role was assigned. This will be
     'Primary Tenant' for the primary tenant of the billing account."""
    principal_display_name: Optional[str] = rest_field(name="principalDisplayName", visibility=["read"])
    """The display name of the principal to whom the role was assigned."""
    principal_type: Optional[Union[str, "_models.PrincipalType"]] = rest_field(
        name="principalType", visibility=["read"]
    )
    """The type of a role Assignment. Known values are: \"Unknown\", \"None\", \"User\", \"Group\",
     \"DirectoryRole\", \"ServicePrincipal\", and \"Everyone\"."""
    billing_request_id: Optional[str] = rest_field(name="billingRequestId", visibility=["read"])
    """The ID of the billing request that was created for the role assignment. This is only applicable
     to cross tenant role assignments or role assignments created through the billing request."""
    billing_account_id: Optional[str] = rest_field(name="billingAccountId", visibility=["read"])
    """The fully qualified ID that uniquely identifies a billing account."""
    billing_account_display_name: Optional[str] = rest_field(name="billingAccountDisplayName", visibility=["read"])
    """The name of the billing account."""
    billing_profile_id: Optional[str] = rest_field(name="billingProfileId", visibility=["read"])
    """The fully qualified ID that uniquely identifies a billing profile."""
    billing_profile_display_name: Optional[str] = rest_field(name="billingProfileDisplayName", visibility=["read"])
    """The name of the billing profile."""
    invoice_section_id: Optional[str] = rest_field(name="invoiceSectionId", visibility=["read"])
    """The fully qualified ID that uniquely identifies an invoice section."""
    invoice_section_display_name: Optional[str] = rest_field(name="invoiceSectionDisplayName", visibility=["read"])
    """The name of the invoice section."""
    customer_id: Optional[str] = rest_field(name="customerId", visibility=["read"])
    """The fully qualified ID that uniquely identifies a customer."""
    customer_display_name: Optional[str] = rest_field(name="customerDisplayName", visibility=["read"])
    """The name of the customer."""

    @overload
    def __init__(  # pylint: disable=too-many-locals
        self,
        *,
        role_definition_id: str,
        principal_puid: Optional[str] = None,
        principal_id: Optional[str] = None,
        principal_tenant_id: Optional[str] = None,
        scope: Optional[str] = None,
        user_authentication_type: Optional[str] = None,
        user_email_address: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingRoleDefinition(ProxyResource):
    """The properties of a role definition.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: The properties of a role definition.
    :vartype properties: ~azure.mgmt.billing.models.BillingRoleDefinitionProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.BillingRoleDefinitionProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of a role definition."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.BillingRoleDefinitionProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingRoleDefinitionProperties(_Model):
    """The properties of a role definition.

    :ivar description: The role description.
    :vartype description: str
    :ivar permissions: The billingPermissions the role has.
    :vartype permissions: list[~azure.mgmt.billing.models.BillingPermission]
    :ivar role_name: The name of the role. Required.
    :vartype role_name: str
    """

    description: Optional[str] = rest_field(visibility=["read"])
    """The role description."""
    permissions: Optional[list["_models.BillingPermission"]] = rest_field(visibility=["read"])
    """The billingPermissions the role has."""
    role_name: str = rest_field(name="roleName", visibility=["read", "create", "update", "delete", "query"])
    """The name of the role. Required."""

    @overload
    def __init__(
        self,
        *,
        role_name: str,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingSubscription(ProxyResource):
    """The billing properties of a subscription.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: The properties of a(n) BillingSubscription.
    :vartype properties: ~azure.mgmt.billing.models.BillingSubscriptionProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.BillingSubscriptionProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of a(n) BillingSubscription."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.BillingSubscriptionProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingSubscriptionAlias(ProxyResource):
    """A billing subscription alias.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: The properties of a(n) BillingSubscriptionAlias.
    :vartype properties: ~azure.mgmt.billing.models.BillingSubscriptionAliasProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.BillingSubscriptionAliasProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of a(n) BillingSubscriptionAlias."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.BillingSubscriptionAliasProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingSubscriptionProperties(_Model):
    """The billing properties of a subscription.

    :ivar auto_renew: Indicates whether auto renewal is turned on or off for a product. Known
     values are: "Off" and "On".
    :vartype auto_renew: str or ~azure.mgmt.billing.models.AutoRenew
    :ivar beneficiary_tenant_id: The provisioning tenant of the subscription.
    :vartype beneficiary_tenant_id: str
    :ivar beneficiary: The beneficiary of the billing subscription.
    :vartype beneficiary: ~azure.mgmt.billing.models.Beneficiary
    :ivar billing_frequency: The billing frequency in ISO8601 format of product in the
     subscription. Example: P1M, P3M, P1Y.
    :vartype billing_frequency: str
    :ivar billing_profile_id: The fully qualified ID that uniquely identifies a billing profile.
    :vartype billing_profile_id: str
    :ivar billing_policies: Dictionary of billing policies associated with the subscription.
    :vartype billing_policies: dict[str, str]
    :ivar billing_profile_display_name: The name of the billing profile.
    :vartype billing_profile_display_name: str
    :ivar billing_profile_name: The ID that uniquely identifies a billing profile.
    :vartype billing_profile_name: str
    :ivar consumption_cost_center: The cost center applied to the subscription. This field is only
     available for consumption subscriptions of Microsoft Customer Agreement or Enterprise Agreement
     Type billing accounts.
    :vartype consumption_cost_center: str
    :ivar customer_id: The fully qualified ID that uniquely identifies a customer.
    :vartype customer_id: str
    :ivar customer_display_name: The name of the customer.
    :vartype customer_display_name: str
    :ivar customer_name: The ID that uniquely identifies a customer.
    :vartype customer_name: str
    :ivar display_name: The name of the billing subscription.
    :vartype display_name: str
    :ivar enrollment_account_id: The enrollment Account ID associated with the subscription. This
     field is available only for the Enterprise Agreement Type billing accounts.
    :vartype enrollment_account_id: str
    :ivar enrollment_account_display_name: The enrollment Account name associated with the
     subscription. This field is available only for the Enterprise Agreement Type billing accounts.
    :vartype enrollment_account_display_name: str
    :ivar enrollment_account_subscription_details: Enrollment Account Subscription details. This
     field is available only for the Enterprise Agreement Type billing accounts.
    :vartype enrollment_account_subscription_details:
     ~azure.mgmt.billing.models.EnrollmentAccountSubscriptionDetails
    :ivar invoice_section_id: The fully qualified ID that uniquely identifies an invoice section.
    :vartype invoice_section_id: str
    :ivar invoice_section_display_name: The name of the invoice section.
    :vartype invoice_section_display_name: str
    :ivar invoice_section_name: The ID that uniquely identifies an invoice section.
    :vartype invoice_section_name: str
    :ivar last_month_charges: The last month's charges. This field is only available for usage
     based subscriptions of Microsoft Customer Agreement billing accounts.
    :vartype last_month_charges: ~azure.mgmt.billing.models.Amount
    :ivar month_to_date_charges: The current month to date charges. This field is only available
     for usage based subscriptions of Microsoft Customer Agreement billing accounts.
    :vartype month_to_date_charges: ~azure.mgmt.billing.models.Amount
    :ivar next_billing_cycle_details: Next billing cycle details of the subscription.
    :vartype next_billing_cycle_details: ~azure.mgmt.billing.models.NextBillingCycleDetails
    :ivar offer_id: The offer ID for the subscription. This field is only available for the
     Microsoft Online Services Program billing accounts or billing accounts with agreement type
     Enterprise Agreement.
    :vartype offer_id: str
    :ivar product_category: The category of the product for which the subscription is purchased.
     Possible values include: AzureSupport, Hardware, ReservationOrder, SaaS, SavingsPlanOrder,
     Software, UsageBased, Other.
    :vartype product_category: str
    :ivar product_type: Type of the product for which the subscription is purchased.
    :vartype product_type: str
    :ivar product_type_id: Id of the product for which the subscription is purchased.
    :vartype product_type_id: str
    :ivar purchase_date: Purchase date of the product in UTC time.
    :vartype purchase_date: ~datetime.datetime
    :ivar quantity: The quantity of licenses or fulfillment units for the subscription.
    :vartype quantity: int
    :ivar reseller: Reseller for this subscription. The fields is not available for Microsoft
     Partner Agreement billing accounts.
    :vartype reseller: ~azure.mgmt.billing.models.Reseller
    :ivar renewal_term_details: Details for the next renewal term of a subscription.
    :vartype renewal_term_details: ~azure.mgmt.billing.models.RenewalTermDetails
    :ivar sku_id: The SKU ID of the product for which the subscription is purchased. This field is
     is only available  for Microsoft Customer Agreement billing accounts.
    :vartype sku_id: str
    :ivar sku_description: The SKU description of the product for which the subscription is
     purchased. This field is is only available for billing accounts with agreement type Microsoft
     Customer Agreement and Microsoft Partner Agreement.
    :vartype sku_description: str
    :ivar system_overrides: System imposed policies that regulate behavior of the subscription.
    :vartype system_overrides: ~azure.mgmt.billing.models.SystemOverrides
    :ivar resource_uri: Unique identifier of the linked resource.
    :vartype resource_uri: str
    :ivar term_duration: The duration in ISO8601 format for which you can use the subscription.
     Example: P1M, P3M, P1Y.
    :vartype term_duration: str
    :ivar term_start_date: Start date of the term in UTC time.
    :vartype term_start_date: ~datetime.datetime
    :ivar term_end_date: End date of the term in UTC time.
    :vartype term_end_date: ~datetime.datetime
    :ivar provisioning_tenant_id: The tenant in which the subscription is provisioned.
    :vartype provisioning_tenant_id: str
    :ivar status: The status of the subscription. This field is not available for Enterprise
     Agreement billing accounts. Known values are: "Other", "Unknown", "Active", "Disabled",
     "Deleted", "Warned", "Expiring", "Expired", "AutoRenew", "Cancelled", "Suspended", and
     "Failed".
    :vartype status: str or ~azure.mgmt.billing.models.BillingSubscriptionStatus
    :ivar operation_status: The status of an operation on the subscription. When None, there is no
     ongoing operation. When LockedForUpdate, write operations will be blocked on the Billing
     Subscription. Other is the default value and you may need to refer to the latest API version
     for more details. Known values are: "Other", "None", and "LockedForUpdate".
    :vartype operation_status: str or ~azure.mgmt.billing.models.BillingSubscriptionOperationStatus
    :ivar provisioning_state: The provisioning state of the resource during a long-running
     operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending",
     "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired".
    :vartype provisioning_state: str or ~azure.mgmt.billing.models.ProvisioningState
    :ivar subscription_id: The ID of the subscription.
    :vartype subscription_id: str
    :ivar suspension_reasons: The suspension reason for a subscription. This field is not available
     for Enterprise Agreement billing accounts.
    :vartype suspension_reasons: list[str]
    :ivar suspension_reason_details: The suspension details for a subscription. This field is not
     available for Enterprise Agreement billing accounts.
    :vartype suspension_reason_details:
     list[~azure.mgmt.billing.models.BillingSubscriptionStatusDetails]
    """

    auto_renew: Optional[Union[str, "_models.AutoRenew"]] = rest_field(
        name="autoRenew", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates whether auto renewal is turned on or off for a product. Known values are: \"Off\" and
     \"On\"."""
    beneficiary_tenant_id: Optional[str] = rest_field(
        name="beneficiaryTenantId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The provisioning tenant of the subscription."""
    beneficiary: Optional["_models.Beneficiary"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The beneficiary of the billing subscription."""
    billing_frequency: Optional[str] = rest_field(
        name="billingFrequency", visibility=["read", "create", "update", "delete", "query"]
    )
    """The billing frequency in ISO8601 format of product in the subscription. Example: P1M, P3M, P1Y."""
    billing_profile_id: Optional[str] = rest_field(
        name="billingProfileId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The fully qualified ID that uniquely identifies a billing profile."""
    billing_policies: Optional[dict[str, str]] = rest_field(name="billingPolicies", visibility=["read"])
    """Dictionary of billing policies associated with the subscription."""
    billing_profile_display_name: Optional[str] = rest_field(name="billingProfileDisplayName", visibility=["read"])
    """The name of the billing profile."""
    billing_profile_name: Optional[str] = rest_field(name="billingProfileName", visibility=["read"])
    """The ID that uniquely identifies a billing profile."""
    consumption_cost_center: Optional[str] = rest_field(
        name="consumptionCostCenter", visibility=["read", "create", "update", "delete", "query"]
    )
    """The cost center applied to the subscription. This field is only available for consumption
     subscriptions of Microsoft Customer Agreement or Enterprise Agreement Type billing accounts."""
    customer_id: Optional[str] = rest_field(
        name="customerId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The fully qualified ID that uniquely identifies a customer."""
    customer_display_name: Optional[str] = rest_field(name="customerDisplayName", visibility=["read"])
    """The name of the customer."""
    customer_name: Optional[str] = rest_field(name="customerName", visibility=["read"])
    """The ID that uniquely identifies a customer."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the billing subscription."""
    enrollment_account_id: Optional[str] = rest_field(name="enrollmentAccountId", visibility=["read"])
    """The enrollment Account ID associated with the subscription. This field is available only for
     the Enterprise Agreement Type billing accounts."""
    enrollment_account_display_name: Optional[str] = rest_field(
        name="enrollmentAccountDisplayName", visibility=["read"]
    )
    """The enrollment Account name associated with the subscription. This field is available only for
     the Enterprise Agreement Type billing accounts."""
    enrollment_account_subscription_details: Optional["_models.EnrollmentAccountSubscriptionDetails"] = rest_field(
        name="enrollmentAccountSubscriptionDetails", visibility=["read"]
    )
    """Enrollment Account Subscription details. This field is available only for the Enterprise
     Agreement Type billing accounts."""
    invoice_section_id: Optional[str] = rest_field(
        name="invoiceSectionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The fully qualified ID that uniquely identifies an invoice section."""
    invoice_section_display_name: Optional[str] = rest_field(name="invoiceSectionDisplayName", visibility=["read"])
    """The name of the invoice section."""
    invoice_section_name: Optional[str] = rest_field(name="invoiceSectionName", visibility=["read"])
    """The ID that uniquely identifies an invoice section."""
    last_month_charges: Optional["_models.Amount"] = rest_field(name="lastMonthCharges", visibility=["read"])
    """The last month's charges. This field is only available for usage based subscriptions of
     Microsoft Customer Agreement billing accounts."""
    month_to_date_charges: Optional["_models.Amount"] = rest_field(name="monthToDateCharges", visibility=["read"])
    """The current month to date charges. This field is only available for usage based subscriptions
     of Microsoft Customer Agreement billing accounts."""
    next_billing_cycle_details: Optional["_models.NextBillingCycleDetails"] = rest_field(
        name="nextBillingCycleDetails", visibility=["read"]
    )
    """Next billing cycle details of the subscription."""
    offer_id: Optional[str] = rest_field(name="offerId", visibility=["read"])
    """The offer ID for the subscription. This field is only available for the Microsoft Online
     Services Program billing accounts or billing accounts with agreement type Enterprise Agreement."""
    product_category: Optional[str] = rest_field(name="productCategory", visibility=["read"])
    """The category of the product for which the subscription is purchased. Possible values include:
     AzureSupport, Hardware, ReservationOrder, SaaS, SavingsPlanOrder, Software, UsageBased, Other."""
    product_type: Optional[str] = rest_field(name="productType", visibility=["read"])
    """Type of the product for which the subscription is purchased."""
    product_type_id: Optional[str] = rest_field(
        name="productTypeId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Id of the product for which the subscription is purchased."""
    purchase_date: Optional[datetime.datetime] = rest_field(name="purchaseDate", visibility=["read"], format="rfc3339")
    """Purchase date of the product in UTC time."""
    quantity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The quantity of licenses or fulfillment units for the subscription."""
    reseller: Optional["_models.Reseller"] = rest_field(visibility=["read"])
    """Reseller for this subscription. The fields is not available for Microsoft Partner Agreement
     billing accounts."""
    renewal_term_details: Optional["_models.RenewalTermDetails"] = rest_field(
        name="renewalTermDetails", visibility=["read"]
    )
    """Details for the next renewal term of a subscription."""
    sku_id: Optional[str] = rest_field(name="skuId", visibility=["read", "create", "update", "delete", "query"])
    """The SKU ID of the product for which the subscription is purchased. This field is is only
     available  for Microsoft Customer Agreement billing accounts."""
    sku_description: Optional[str] = rest_field(name="skuDescription", visibility=["read"])
    """The SKU description of the product for which the subscription is purchased. This field is is
     only available for billing accounts with agreement type Microsoft Customer Agreement and
     Microsoft Partner Agreement."""
    system_overrides: Optional["_models.SystemOverrides"] = rest_field(
        name="systemOverrides", visibility=["read", "create", "update", "delete", "query"]
    )
    """System imposed policies that regulate behavior of the subscription."""
    resource_uri: Optional[str] = rest_field(name="resourceUri", visibility=["read"])
    """Unique identifier of the linked resource."""
    term_duration: Optional[str] = rest_field(
        name="termDuration", visibility=["read", "create", "update", "delete", "query"]
    )
    """The duration in ISO8601 format for which you can use the subscription. Example: P1M, P3M, P1Y."""
    term_start_date: Optional[datetime.datetime] = rest_field(
        name="termStartDate", visibility=["read"], format="rfc3339"
    )
    """Start date of the term in UTC time."""
    term_end_date: Optional[datetime.datetime] = rest_field(name="termEndDate", visibility=["read"], format="rfc3339")
    """End date of the term in UTC time."""
    provisioning_tenant_id: Optional[str] = rest_field(
        name="provisioningTenantId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The tenant in which the subscription is provisioned."""
    status: Optional[Union[str, "_models.BillingSubscriptionStatus"]] = rest_field(visibility=["read"])
    """The status of the subscription. This field is not available for Enterprise Agreement billing
     accounts. Known values are: \"Other\", \"Unknown\", \"Active\", \"Disabled\", \"Deleted\",
     \"Warned\", \"Expiring\", \"Expired\", \"AutoRenew\", \"Cancelled\", \"Suspended\", and
     \"Failed\"."""
    operation_status: Optional[Union[str, "_models.BillingSubscriptionOperationStatus"]] = rest_field(
        name="operationStatus", visibility=["read"]
    )
    """The status of an operation on the subscription. When None, there is no ongoing operation. When
     LockedForUpdate, write operations will be blocked on the Billing Subscription. Other is the
     default value and you may need to refer to the latest API version for more details. Known
     values are: \"Other\", \"None\", and \"LockedForUpdate\"."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the resource during a long-running operation. Known values are:
     \"Succeeded\", \"Canceled\", \"Failed\", \"New\", \"Pending\", \"Provisioning\",
     \"PendingBilling\", \"ConfirmedBilling\", \"Creating\", \"Created\", and \"Expired\"."""
    subscription_id: Optional[str] = rest_field(name="subscriptionId", visibility=["read"])
    """The ID of the subscription."""
    suspension_reasons: Optional[list[str]] = rest_field(name="suspensionReasons", visibility=["read"])
    """The suspension reason for a subscription. This field is not available for Enterprise Agreement
     billing accounts."""
    suspension_reason_details: Optional[list["_models.BillingSubscriptionStatusDetails"]] = rest_field(
        name="suspensionReasonDetails", visibility=["read"]
    )
    """The suspension details for a subscription. This field is not available for Enterprise Agreement
     billing accounts."""

    __flattened_items = ["enrollment_account_start_date", "subscription_enrollment_account_status"]

    @overload
    def __init__(  # pylint: disable=too-many-locals
        self,
        *,
        auto_renew: Optional[Union[str, "_models.AutoRenew"]] = None,
        beneficiary_tenant_id: Optional[str] = None,
        beneficiary: Optional["_models.Beneficiary"] = None,
        billing_frequency: Optional[str] = None,
        billing_profile_id: Optional[str] = None,
        consumption_cost_center: Optional[str] = None,
        customer_id: Optional[str] = None,
        display_name: Optional[str] = None,
        invoice_section_id: Optional[str] = None,
        product_type_id: Optional[str] = None,
        quantity: Optional[int] = None,
        sku_id: Optional[str] = None,
        system_overrides: Optional["_models.SystemOverrides"] = None,
        term_duration: Optional[str] = None,
        provisioning_tenant_id: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.enrollment_account_subscription_details is None:
                return None
            return getattr(self.enrollment_account_subscription_details, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.enrollment_account_subscription_details is None:
                self.enrollment_account_subscription_details = self._attr_to_rest_field[
                    "enrollment_account_subscription_details"
                ]._class_type()
            setattr(self.enrollment_account_subscription_details, key, value)
        else:
            super().__setattr__(key, value)


class BillingSubscriptionAliasProperties(BillingSubscriptionProperties):
    """A billing subscription alias.

    :ivar auto_renew: Indicates whether auto renewal is turned on or off for a product. Known
     values are: "Off" and "On".
    :vartype auto_renew: str or ~azure.mgmt.billing.models.AutoRenew
    :ivar beneficiary_tenant_id: The provisioning tenant of the subscription.
    :vartype beneficiary_tenant_id: str
    :ivar beneficiary: The beneficiary of the billing subscription.
    :vartype beneficiary: ~azure.mgmt.billing.models.Beneficiary
    :ivar billing_frequency: The billing frequency in ISO8601 format of product in the
     subscription. Example: P1M, P3M, P1Y.
    :vartype billing_frequency: str
    :ivar billing_profile_id: The fully qualified ID that uniquely identifies a billing profile.
    :vartype billing_profile_id: str
    :ivar billing_policies: Dictionary of billing policies associated with the subscription.
    :vartype billing_policies: dict[str, str]
    :ivar billing_profile_display_name: The name of the billing profile.
    :vartype billing_profile_display_name: str
    :ivar billing_profile_name: The ID that uniquely identifies a billing profile.
    :vartype billing_profile_name: str
    :ivar consumption_cost_center: The cost center applied to the subscription. This field is only
     available for consumption subscriptions of Microsoft Customer Agreement or Enterprise Agreement
     Type billing accounts.
    :vartype consumption_cost_center: str
    :ivar customer_id: The fully qualified ID that uniquely identifies a customer.
    :vartype customer_id: str
    :ivar customer_display_name: The name of the customer.
    :vartype customer_display_name: str
    :ivar customer_name: The ID that uniquely identifies a customer.
    :vartype customer_name: str
    :ivar display_name: The name of the billing subscription.
    :vartype display_name: str
    :ivar enrollment_account_id: The enrollment Account ID associated with the subscription. This
     field is available only for the Enterprise Agreement Type billing accounts.
    :vartype enrollment_account_id: str
    :ivar enrollment_account_display_name: The enrollment Account name associated with the
     subscription. This field is available only for the Enterprise Agreement Type billing accounts.
    :vartype enrollment_account_display_name: str
    :ivar enrollment_account_subscription_details: Enrollment Account Subscription details. This
     field is available only for the Enterprise Agreement Type billing accounts.
    :vartype enrollment_account_subscription_details:
     ~azure.mgmt.billing.models.EnrollmentAccountSubscriptionDetails
    :ivar invoice_section_id: The fully qualified ID that uniquely identifies an invoice section.
    :vartype invoice_section_id: str
    :ivar invoice_section_display_name: The name of the invoice section.
    :vartype invoice_section_display_name: str
    :ivar invoice_section_name: The ID that uniquely identifies an invoice section.
    :vartype invoice_section_name: str
    :ivar last_month_charges: The last month's charges. This field is only available for usage
     based subscriptions of Microsoft Customer Agreement billing accounts.
    :vartype last_month_charges: ~azure.mgmt.billing.models.Amount
    :ivar month_to_date_charges: The current month to date charges. This field is only available
     for usage based subscriptions of Microsoft Customer Agreement billing accounts.
    :vartype month_to_date_charges: ~azure.mgmt.billing.models.Amount
    :ivar next_billing_cycle_details: Next billing cycle details of the subscription.
    :vartype next_billing_cycle_details: ~azure.mgmt.billing.models.NextBillingCycleDetails
    :ivar offer_id: The offer ID for the subscription. This field is only available for the
     Microsoft Online Services Program billing accounts or billing accounts with agreement type
     Enterprise Agreement.
    :vartype offer_id: str
    :ivar product_category: The category of the product for which the subscription is purchased.
     Possible values include: AzureSupport, Hardware, ReservationOrder, SaaS, SavingsPlanOrder,
     Software, UsageBased, Other.
    :vartype product_category: str
    :ivar product_type: Type of the product for which the subscription is purchased.
    :vartype product_type: str
    :ivar product_type_id: Id of the product for which the subscription is purchased.
    :vartype product_type_id: str
    :ivar purchase_date: Purchase date of the product in UTC time.
    :vartype purchase_date: ~datetime.datetime
    :ivar quantity: The quantity of licenses or fulfillment units for the subscription.
    :vartype quantity: int
    :ivar reseller: Reseller for this subscription. The fields is not available for Microsoft
     Partner Agreement billing accounts.
    :vartype reseller: ~azure.mgmt.billing.models.Reseller
    :ivar renewal_term_details: Details for the next renewal term of a subscription.
    :vartype renewal_term_details: ~azure.mgmt.billing.models.RenewalTermDetails
    :ivar sku_id: The SKU ID of the product for which the subscription is purchased. This field is
     is only available  for Microsoft Customer Agreement billing accounts.
    :vartype sku_id: str
    :ivar sku_description: The SKU description of the product for which the subscription is
     purchased. This field is is only available for billing accounts with agreement type Microsoft
     Customer Agreement and Microsoft Partner Agreement.
    :vartype sku_description: str
    :ivar system_overrides: System imposed policies that regulate behavior of the subscription.
    :vartype system_overrides: ~azure.mgmt.billing.models.SystemOverrides
    :ivar resource_uri: Unique identifier of the linked resource.
    :vartype resource_uri: str
    :ivar term_duration: The duration in ISO8601 format for which you can use the subscription.
     Example: P1M, P3M, P1Y.
    :vartype term_duration: str
    :ivar term_start_date: Start date of the term in UTC time.
    :vartype term_start_date: ~datetime.datetime
    :ivar term_end_date: End date of the term in UTC time.
    :vartype term_end_date: ~datetime.datetime
    :ivar provisioning_tenant_id: The tenant in which the subscription is provisioned.
    :vartype provisioning_tenant_id: str
    :ivar status: The status of the subscription. This field is not available for Enterprise
     Agreement billing accounts. Known values are: "Other", "Unknown", "Active", "Disabled",
     "Deleted", "Warned", "Expiring", "Expired", "AutoRenew", "Cancelled", "Suspended", and
     "Failed".
    :vartype status: str or ~azure.mgmt.billing.models.BillingSubscriptionStatus
    :ivar operation_status: The status of an operation on the subscription. When None, there is no
     ongoing operation. When LockedForUpdate, write operations will be blocked on the Billing
     Subscription. Other is the default value and you may need to refer to the latest API version
     for more details. Known values are: "Other", "None", and "LockedForUpdate".
    :vartype operation_status: str or ~azure.mgmt.billing.models.BillingSubscriptionOperationStatus
    :ivar subscription_id: The ID of the subscription.
    :vartype subscription_id: str
    :ivar suspension_reasons: The suspension reason for a subscription. This field is not available
     for Enterprise Agreement billing accounts.
    :vartype suspension_reasons: list[str]
    :ivar suspension_reason_details: The suspension details for a subscription. This field is not
     available for Enterprise Agreement billing accounts.
    :vartype suspension_reason_details:
     list[~azure.mgmt.billing.models.BillingSubscriptionStatusDetails]
    :ivar billing_subscription_id: The ID of the billing subscription with the subscription alias.
    :vartype billing_subscription_id: str
    :ivar provisioning_state: The provisioning state of the resource during a long-running
     operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending",
     "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired".
    :vartype provisioning_state: str or ~azure.mgmt.billing.models.ProvisioningState
    """

    billing_subscription_id: Optional[str] = rest_field(name="billingSubscriptionId", visibility=["read"])
    """The ID of the billing subscription with the subscription alias."""

    __flattened_items = ["enrollment_account_start_date", "subscription_enrollment_account_status"]

    @overload
    def __init__(  # pylint: disable=too-many-locals
        self,
        *,
        auto_renew: Optional[Union[str, "_models.AutoRenew"]] = None,
        beneficiary_tenant_id: Optional[str] = None,
        beneficiary: Optional["_models.Beneficiary"] = None,
        billing_frequency: Optional[str] = None,
        billing_profile_id: Optional[str] = None,
        consumption_cost_center: Optional[str] = None,
        customer_id: Optional[str] = None,
        display_name: Optional[str] = None,
        invoice_section_id: Optional[str] = None,
        product_type_id: Optional[str] = None,
        quantity: Optional[int] = None,
        sku_id: Optional[str] = None,
        system_overrides: Optional["_models.SystemOverrides"] = None,
        term_duration: Optional[str] = None,
        provisioning_tenant_id: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.enrollment_account_subscription_details is None:
                return None
            return getattr(self.enrollment_account_subscription_details, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.enrollment_account_subscription_details is None:
                self.enrollment_account_subscription_details = self._attr_to_rest_field[
                    "enrollment_account_subscription_details"
                ]._class_type()
            setattr(self.enrollment_account_subscription_details, key, value)
        else:
            super().__setattr__(key, value)


class BillingSubscriptionMergeRequest(_Model):
    """Request parameters that are provided to merge the two billing subscriptions.

    :ivar target_billing_subscription_name: The ID of the target billing subscription that will be
     merged with the source subscription provided in the request.
    :vartype target_billing_subscription_name: str
    :ivar quantity: The quantity of the source billing subscription that will be merged with the
     target billing subscription.
    :vartype quantity: int
    """

    target_billing_subscription_name: Optional[str] = rest_field(
        name="targetBillingSubscriptionName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The ID of the target billing subscription that will be merged with the source subscription
     provided in the request."""
    quantity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The quantity of the source billing subscription that will be merged with the target billing
     subscription."""

    @overload
    def __init__(
        self,
        *,
        target_billing_subscription_name: Optional[str] = None,
        quantity: Optional[int] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingSubscriptionPatch(ProxyResourceWithTags):
    """The billing properties of a subscription.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    :ivar properties: The properties of a(n) BillingSubscription.
    :vartype properties: ~azure.mgmt.billing.models.BillingSubscriptionProperties
    """

    properties: Optional["_models.BillingSubscriptionProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of a(n) BillingSubscription."""

    @overload
    def __init__(
        self,
        *,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.BillingSubscriptionProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingSubscriptionSplitRequest(_Model):
    """Request parameters that are provided to split the billing subscription.

    :ivar target_product_type_id: The ID of the target product to which the subscription needs to
     be split into. This value is not same as the value returned in Get API call and can be
     retrieved from Catalog API to know the product id to split into.
    :vartype target_product_type_id: str
    :ivar target_sku_id: The ID of the target product to which the subscription needs to be split
     into. This value is not same as the value returned in Get API call and can be retrieved from
     Catalog API to know the sku id to split into.
    :vartype target_sku_id: str
    :ivar quantity: The quantity of the target product to which the subscription needs to be split
     into.
    :vartype quantity: int
    :ivar term_duration: The term duration of the target in ISO8601 format product to which the
     subscription needs to be split into. Example: P1M, P1Y.
    :vartype term_duration: str
    :ivar billing_frequency: The billing frequency of the target subscription in the ISO8601
     format. Example: P1M, P3M, P1Y".
    :vartype billing_frequency: str
    """

    target_product_type_id: Optional[str] = rest_field(
        name="targetProductTypeId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The ID of the target product to which the subscription needs to be split into. This value is
     not same as the value returned in Get API call and can be retrieved from Catalog API to know
     the product id to split into."""
    target_sku_id: Optional[str] = rest_field(
        name="targetSkuId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The ID of the target product to which the subscription needs to be split into. This value is
     not same as the value returned in Get API call and can be retrieved from Catalog API to know
     the sku id to split into."""
    quantity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The quantity of the target product to which the subscription needs to be split into."""
    term_duration: Optional[str] = rest_field(
        name="termDuration", visibility=["read", "create", "update", "delete", "query"]
    )
    """The term duration of the target in ISO8601 format product to which the subscription needs to be
     split into. Example: P1M, P1Y."""
    billing_frequency: Optional[str] = rest_field(
        name="billingFrequency", visibility=["read", "create", "update", "delete", "query"]
    )
    """The billing frequency of the target subscription in the ISO8601 format. Example: P1M, P3M,
     P1Y\"."""

    @overload
    def __init__(
        self,
        *,
        target_product_type_id: Optional[str] = None,
        target_sku_id: Optional[str] = None,
        quantity: Optional[int] = None,
        term_duration: Optional[str] = None,
        billing_frequency: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class BillingSubscriptionStatusDetails(_Model):
    """The suspension details for a subscription. This field is not available for Enterprise Agreement
    billing accounts.

    :ivar effective_date: The suspension effective date for a subscription. This field is not
     available for Enterprise Agreement billing accounts.
    :vartype effective_date: ~datetime.datetime
    :ivar reason: The suspension reason for a subscription. This field is not available for
     Enterprise Agreement billing accounts. Known values are: "None", "Cancelled", "PastDue",
     "SuspiciousActivity", "Other", "Transferred", "PolicyViolation", "SpendingLimitReached", and
     "Expired".
    :vartype reason: str or ~azure.mgmt.billing.models.SubscriptionStatusReason
    """

    effective_date: Optional[datetime.datetime] = rest_field(
        name="effectiveDate", visibility=["read"], format="rfc3339"
    )
    """The suspension effective date for a subscription. This field is not available for Enterprise
     Agreement billing accounts."""
    reason: Optional[Union[str, "_models.SubscriptionStatusReason"]] = rest_field(visibility=["read"])
    """The suspension reason for a subscription. This field is not available for Enterprise Agreement
     billing accounts. Known values are: \"None\", \"Cancelled\", \"PastDue\",
     \"SuspiciousActivity\", \"Other\", \"Transferred\", \"PolicyViolation\",
     \"SpendingLimitReached\", and \"Expired\"."""


class CancelSubscriptionRequest(_Model):
    """Request parameters for cancel customer subscription.

    :ivar cancellation_reason: Cancellation reason. Required. Known values are: "Other",
     "Compromise", and "Dispute".
    :vartype cancellation_reason: str or ~azure.mgmt.billing.models.CancellationReason
    :ivar customer_id: The fully qualified ID that uniquely identifies a customer.
    :vartype customer_id: str
    """

    cancellation_reason: Union[str, "_models.CancellationReason"] = rest_field(
        name="cancellationReason", visibility=["read", "create", "update", "delete", "query"]
    )
    """Cancellation reason. Required. Known values are: \"Other\", \"Compromise\", and \"Dispute\"."""
    customer_id: Optional[str] = rest_field(
        name="customerId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The fully qualified ID that uniquely identifies a customer."""

    @overload
    def __init__(
        self,
        *,
        cancellation_reason: Union[str, "_models.CancellationReason"],
        customer_id: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class CheckAccessRequest(_Model):
    """Request to check access.

    :ivar actions: List of actions passed in the request body against which the permissions will be
     checked.
    :vartype actions: list[str]
    """

    actions: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """List of actions passed in the request body against which the permissions will be checked."""

    @overload
    def __init__(
        self,
        *,
        actions: Optional[list[str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class CheckAccessResponse(_Model):
    """The properties of a check access response.

    :ivar access_decision: Access Decision, specifies access is allowed or not. Known values are:
     "Other", "Allowed", and "NotAllowed".
    :vartype access_decision: str or ~azure.mgmt.billing.models.AccessDecision
    :ivar action: Gets or sets an action.
    :vartype action: str
    """

    access_decision: Optional[Union[str, "_models.AccessDecision"]] = rest_field(
        name="accessDecision", visibility=["read"]
    )
    """Access Decision, specifies access is allowed or not. Known values are: \"Other\", \"Allowed\",
     and \"NotAllowed\"."""
    action: Optional[str] = rest_field(visibility=["read"])
    """Gets or sets an action."""


class Price(_Model):
    """The price.

    :ivar currency_code: The ISO 4217 3-letter currency code for the currency used by this purchase
     record.
    :vartype currency_code: str
    :ivar amount:
    :vartype amount: float
    """

    currency_code: Optional[str] = rest_field(
        name="currencyCode", visibility=["read", "create", "update", "delete", "query"]
    )
    """The ISO 4217 3-letter currency code for the currency used by this purchase record."""
    amount: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])

    @overload
    def __init__(
        self,
        *,
        currency_code: Optional[str] = None,
        amount: Optional[float] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class Commitment(Price):
    """Commitment towards the benefit.

    :ivar currency_code: The ISO 4217 3-letter currency code for the currency used by this purchase
     record.
    :vartype currency_code: str
    :ivar amount:
    :vartype amount: float
    :ivar grain: Commitment grain. "Hourly"
    :vartype grain: str or ~azure.mgmt.billing.models.CommitmentGrain
    """

    grain: Optional[Union[str, "_models.CommitmentGrain"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Commitment grain. \"Hourly\""""

    @overload
    def __init__(
        self,
        *,
        currency_code: Optional[str] = None,
        amount: Optional[float] = None,
        grain: Optional[Union[str, "_models.CommitmentGrain"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class Customer(ProxyResource):
    """A partner's customer.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: A partner's customer.
    :vartype properties: ~azure.mgmt.billing.models.CustomerProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.CustomerProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A partner's customer."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.CustomerProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class CustomerPolicy(ProxyResource):
    """A policy at customer scope.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: A policy at customer scope.
    :vartype properties: ~azure.mgmt.billing.models.CustomerPolicyProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.CustomerPolicyProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A policy at customer scope."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.CustomerPolicyProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class CustomerPolicyProperties(_Model):
    """A policy at customer scope.

    :ivar provisioning_state: The provisioning state of the resource during a long-running
     operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending",
     "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired".
    :vartype provisioning_state: str or ~azure.mgmt.billing.models.ProvisioningState
    :ivar view_charges: The policy that controls whether the users in customer's organization can
     view charges at pay-as-you-go prices. Required. Known values are: "Other", "Allowed", and
     "NotAllowed".
    :vartype view_charges: str or ~azure.mgmt.billing.models.ViewChargesPolicy
    :ivar policies: List of all policies defined at the billing scope.
    :vartype policies: list[~azure.mgmt.billing.models.PolicySummary]
    """

    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the resource during a long-running operation. Known values are:
     \"Succeeded\", \"Canceled\", \"Failed\", \"New\", \"Pending\", \"Provisioning\",
     \"PendingBilling\", \"ConfirmedBilling\", \"Creating\", \"Created\", and \"Expired\"."""
    view_charges: Union[str, "_models.ViewChargesPolicy"] = rest_field(
        name="viewCharges", visibility=["read", "create", "update", "delete", "query"]
    )
    """The policy that controls whether the users in customer's organization can view charges at
     pay-as-you-go prices. Required. Known values are: \"Other\", \"Allowed\", and \"NotAllowed\"."""
    policies: Optional[list["_models.PolicySummary"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of all policies defined at the billing scope."""

    @overload
    def __init__(
        self,
        *,
        view_charges: Union[str, "_models.ViewChargesPolicy"],
        policies: Optional[list["_models.PolicySummary"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class CustomerProperties(_Model):
    """A partner's customer.

    :ivar billing_profile_display_name: The name of the billing profile.
    :vartype billing_profile_display_name: str
    :ivar billing_profile_id: The fully qualified ID that uniquely identifies a billing profile.
    :vartype billing_profile_id: str
    :ivar display_name: The name of the customer.
    :vartype display_name: str
    :ivar system_id: The system generated unique identifier for a customer.
    :vartype system_id: str
    :ivar status: Identifies the status of an customer. This is an upcoming property that will be
     populated in the future. Known values are: "Other", "Active", "Pending", "Disabled", "Warned",
     "Deleted", and "UnderReview".
    :vartype status: str or ~azure.mgmt.billing.models.CustomerStatus
    :ivar enabled_azure_plans: Azure plans enabled for the customer.
    :vartype enabled_azure_plans: list[~azure.mgmt.billing.models.AzurePlan]
    :ivar resellers: The list of resellers for which an Azure plan is enabled for the customer.
    :vartype resellers: list[~azure.mgmt.billing.models.Reseller]
    :ivar tags: Dictionary of metadata associated with the resource. Maximum key/value length
     supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain <
     > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    billing_profile_display_name: Optional[str] = rest_field(name="billingProfileDisplayName", visibility=["read"])
    """The name of the billing profile."""
    billing_profile_id: Optional[str] = rest_field(name="billingProfileId", visibility=["read"])
    """The fully qualified ID that uniquely identifies a billing profile."""
    display_name: Optional[str] = rest_field(name="displayName", visibility=["read"])
    """The name of the customer."""
    system_id: Optional[str] = rest_field(name="systemId", visibility=["read"])
    """The system generated unique identifier for a customer."""
    status: Optional[Union[str, "_models.CustomerStatus"]] = rest_field(visibility=["read"])
    """Identifies the status of an customer. This is an upcoming property that will be populated in
     the future. Known values are: \"Other\", \"Active\", \"Pending\", \"Disabled\", \"Warned\",
     \"Deleted\", and \"UnderReview\"."""
    enabled_azure_plans: Optional[list["_models.AzurePlan"]] = rest_field(
        name="enabledAzurePlans", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure plans enabled for the customer."""
    resellers: Optional[list["_models.Reseller"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of resellers for which an Azure plan is enabled for the customer."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. Maximum key/value length supported of 256
     characters. Keys/value should not empty value nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        enabled_azure_plans: Optional[list["_models.AzurePlan"]] = None,
        resellers: Optional[list["_models.Reseller"]] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class DeleteBillingProfileEligibilityDetail(_Model):
    """Validation details of delete billing profile eligibility.

    :ivar code: Code of the delete invoice section eligibility response. Known values are: "None",
     "ActiveCredits", "ActiveCreditCard", "LastBillingProfile", "NotSupported",
     "OutstandingCharges", "PendingCharges", "ReservedInstances", and "ActiveBillingSubscriptions".
    :vartype code: str or ~azure.mgmt.billing.models.DeleteBillingProfileEligibilityCode
    :ivar message: Validation message.
    :vartype message: str
    """

    code: Optional[Union[str, "_models.DeleteBillingProfileEligibilityCode"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Code of the delete invoice section eligibility response. Known values are: \"None\",
     \"ActiveCredits\", \"ActiveCreditCard\", \"LastBillingProfile\", \"NotSupported\",
     \"OutstandingCharges\", \"PendingCharges\", \"ReservedInstances\", and
     \"ActiveBillingSubscriptions\"."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Validation message."""

    @overload
    def __init__(
        self,
        *,
        code: Optional[Union[str, "_models.DeleteBillingProfileEligibilityCode"]] = None,
        message: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class DeleteBillingProfileEligibilityResult(_Model):
    """Eligibility to delete a billing profile result.

    :ivar eligibility_status: Status describing if billing profile is eligible to be deleted. Known
     values are: "Allowed" and "NotAllowed".
    :vartype eligibility_status: str or
     ~azure.mgmt.billing.models.DeleteBillingProfileEligibilityStatus
    :ivar eligibility_details: Validation details of delete billing profile eligibility.
    :vartype eligibility_details:
     list[~azure.mgmt.billing.models.DeleteBillingProfileEligibilityDetail]
    """

    eligibility_status: Optional[Union[str, "_models.DeleteBillingProfileEligibilityStatus"]] = rest_field(
        name="eligibilityStatus", visibility=["read", "create", "update", "delete", "query"]
    )
    """Status describing if billing profile is eligible to be deleted. Known values are: \"Allowed\"
     and \"NotAllowed\"."""
    eligibility_details: Optional[list["_models.DeleteBillingProfileEligibilityDetail"]] = rest_field(
        name="eligibilityDetails", visibility=["read", "create", "update", "delete", "query"]
    )
    """Validation details of delete billing profile eligibility."""

    @overload
    def __init__(
        self,
        *,
        eligibility_status: Optional[Union[str, "_models.DeleteBillingProfileEligibilityStatus"]] = None,
        eligibility_details: Optional[list["_models.DeleteBillingProfileEligibilityDetail"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class DeleteInvoiceSectionEligibilityDetail(_Model):
    """The details of delete invoice section eligibility result.

    :ivar code: Code for the delete invoice section validation. Known values are: "Other",
     "LastInvoiceSection", "ActiveAzurePlans", "ReservedInstances", and
     "ActiveBillingSubscriptions".
    :vartype code: str or ~azure.mgmt.billing.models.DeleteInvoiceSectionEligibilityCode
    :ivar message: Validation message.
    :vartype message: str
    """

    code: Optional[Union[str, "_models.DeleteInvoiceSectionEligibilityCode"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Code for the delete invoice section validation. Known values are: \"Other\",
     \"LastInvoiceSection\", \"ActiveAzurePlans\", \"ReservedInstances\", and
     \"ActiveBillingSubscriptions\"."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Validation message."""

    @overload
    def __init__(
        self,
        *,
        code: Optional[Union[str, "_models.DeleteInvoiceSectionEligibilityCode"]] = None,
        message: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class DeleteInvoiceSectionEligibilityResult(_Model):
    """Eligibility to delete an invoice section result.

    :ivar eligibility_status: Status describing if invoice section is eligible to be deleted. Known
     values are: "Allowed" and "NotAllowed".
    :vartype eligibility_status: str or
     ~azure.mgmt.billing.models.DeleteInvoiceSectionEligibilityStatus
    :ivar eligibility_details: A list of delete invoice section eligibility result details.
    :vartype eligibility_details:
     list[~azure.mgmt.billing.models.DeleteInvoiceSectionEligibilityDetail]
    """

    eligibility_status: Optional[Union[str, "_models.DeleteInvoiceSectionEligibilityStatus"]] = rest_field(
        name="eligibilityStatus", visibility=["read", "create", "update", "delete", "query"]
    )
    """Status describing if invoice section is eligible to be deleted. Known values are: \"Allowed\"
     and \"NotAllowed\"."""
    eligibility_details: Optional[list["_models.DeleteInvoiceSectionEligibilityDetail"]] = rest_field(
        name="eligibilityDetails", visibility=["read", "create", "update", "delete", "query"]
    )
    """A list of delete invoice section eligibility result details."""

    @overload
    def __init__(
        self,
        *,
        eligibility_status: Optional[Union[str, "_models.DeleteInvoiceSectionEligibilityStatus"]] = None,
        eligibility_details: Optional[list["_models.DeleteInvoiceSectionEligibilityDetail"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class Department(ProxyResource):
    """Optional grouping of enrollment accounts to segment costs into logical groupings and set
    budgets.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: Optional grouping of enrollment accounts to segment costs into logical
     groupings and set budgets.
    :vartype properties: ~azure.mgmt.billing.models.DepartmentProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.DepartmentProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Optional grouping of enrollment accounts to segment costs into logical groupings and set
     budgets."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.DepartmentProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class DepartmentProperties(_Model):
    """Optional grouping of enrollment accounts to segment costs into logical groupings and set
    budgets.

    :ivar cost_center: The cost center associated with the department.
    :vartype cost_center: str
    :ivar display_name: The name of the department.
    :vartype display_name: str
    :ivar id: The ID that uniquely identifies the department.
    :vartype id: str
    :ivar status: The status of the department.
    :vartype status: str
    """

    cost_center: Optional[str] = rest_field(
        name="costCenter", visibility=["read", "create", "update", "delete", "query"]
    )
    """The cost center associated with the department."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the department."""
    id: Optional[str] = rest_field(visibility=["read"])
    """The ID that uniquely identifies the department."""
    status: Optional[str] = rest_field(visibility=["read"])
    """The status of the department."""

    @overload
    def __init__(
        self,
        *,
        cost_center: Optional[str] = None,
        display_name: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class DetailedTransferStatus(_Model):
    """Detailed transfer status.

    :ivar product_type: Type of product that is transferred. Known values are: "AzureSubscription",
     "AzureReservation", "Department", "SavingsPlan", and "SAAS".
    :vartype product_type: str or ~azure.mgmt.billing.models.ProductType
    :ivar product_id: The ID of the product that is transferred.
    :vartype product_id: str
    :ivar product_name: The name of the product that is transferred.
    :vartype product_name: str
    :ivar sku_description: The SKU of the product that is transferred.
    :vartype sku_description: str
    :ivar transfer_status: Transfer status. Known values are: "NotStarted", "InProgress",
     "Completed", and "Failed".
    :vartype transfer_status: str or ~azure.mgmt.billing.models.ProductTransferStatus
    :ivar error_details: Error details for transfer execution.
    :vartype error_details: ~azure.mgmt.billing.models.TransferError
    """

    product_type: Optional[Union[str, "_models.ProductType"]] = rest_field(name="productType", visibility=["read"])
    """Type of product that is transferred. Known values are: \"AzureSubscription\",
     \"AzureReservation\", \"Department\", \"SavingsPlan\", and \"SAAS\"."""
    product_id: Optional[str] = rest_field(name="productId", visibility=["read"])
    """The ID of the product that is transferred."""
    product_name: Optional[str] = rest_field(name="productName", visibility=["read"])
    """The name of the product that is transferred."""
    sku_description: Optional[str] = rest_field(name="skuDescription", visibility=["read"])
    """The SKU of the product that is transferred."""
    transfer_status: Optional[Union[str, "_models.ProductTransferStatus"]] = rest_field(
        name="transferStatus", visibility=["read"]
    )
    """Transfer status. Known values are: \"NotStarted\", \"InProgress\", \"Completed\", and
     \"Failed\"."""
    error_details: Optional["_models.TransferError"] = rest_field(
        name="errorDetails", visibility=["read", "create", "update", "delete", "query"]
    )
    """Error details for transfer execution."""

    @overload
    def __init__(
        self,
        *,
        error_details: Optional["_models.TransferError"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class DocumentDownloadRequest(_Model):
    """A list of download details for individual documents.

    :ivar document_name: The ID that uniquely identifies an invoice document. This ID may be an
     identifier for an invoice PDF, a credit note, or a tax receipt. If omitted, the most recent
     invoice PDF for the invoice will be returned.
    :vartype document_name: str
    :ivar invoice_name: The ID that uniquely identifies an invoice.
    :vartype invoice_name: str
    """

    document_name: Optional[str] = rest_field(
        name="documentName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The ID that uniquely identifies an invoice document. This ID may be an identifier for an
     invoice PDF, a credit note, or a tax receipt. If omitted, the most recent invoice PDF for the
     invoice will be returned."""
    invoice_name: Optional[str] = rest_field(
        name="invoiceName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The ID that uniquely identifies an invoice."""

    @overload
    def __init__(
        self,
        *,
        document_name: Optional[str] = None,
        invoice_name: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class DocumentDownloadResult(_Model):
    """A secure URL that can be used to download a an entity until the URL expires.

    :ivar expiry_time: The time in UTC when the download URL will expire.
    :vartype expiry_time: str
    :ivar url: The URL to the PDF or .zip file.
    :vartype url: str
    """

    expiry_time: Optional[str] = rest_field(name="expiryTime", visibility=["read"])
    """The time in UTC when the download URL will expire."""
    url: Optional[str] = rest_field(visibility=["read"])
    """The URL to the PDF or .zip file."""


class EnrollmentAccount(ProxyResource):
    """It is an organizational hierarchy within a billing account to administer and manage azure
    costs.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: It is an organizational hierarchy within a billing account to administer and
     manage azure costs.
    :vartype properties: ~azure.mgmt.billing.models.EnrollmentAccountProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.EnrollmentAccountProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """It is an organizational hierarchy within a billing account to administer and manage azure
     costs."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.EnrollmentAccountProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class EnrollmentAccountProperties(_Model):
    """It is an organizational hierarchy within a billing account to administer and manage azure
    costs.

    :ivar cost_center: The cost center associated with the enrollment account.
    :vartype cost_center: str
    :ivar display_name: The name of the enrollment account.
    :vartype display_name: str
    :ivar department_display_name: The name of the department under which the enrollment account
     exists.
    :vartype department_display_name: str
    :ivar department_id: The ID that uniquely identifies the department.
    :vartype department_id: str
    :ivar is_dev_test_enabled: Boolean flag which enables subscribers to run development and
     testing workloads on Azure at special Dev/Test rates.
    :vartype is_dev_test_enabled: bool
    :ivar account_owner: The owner of the enrollment account.
    :vartype account_owner: str
    :ivar auth_type: The authorization type of the enrollment account.
    :vartype auth_type: str
    :ivar status: The status of the enrollment account.
    :vartype status: str
    :ivar start_date: The date from which the enrollment account became valid and functional.
    :vartype start_date: ~datetime.datetime
    :ivar end_date: The date of expiration of the enrollment account.
    :vartype end_date: ~datetime.datetime
    """

    cost_center: Optional[str] = rest_field(
        name="costCenter", visibility=["read", "create", "update", "delete", "query"]
    )
    """The cost center associated with the enrollment account."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the enrollment account."""
    department_display_name: Optional[str] = rest_field(name="departmentDisplayName", visibility=["read"])
    """The name of the department under which the enrollment account exists."""
    department_id: Optional[str] = rest_field(name="departmentId", visibility=["read"])
    """The ID that uniquely identifies the department."""
    is_dev_test_enabled: Optional[bool] = rest_field(
        name="isDevTestEnabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Boolean flag which enables subscribers to run development and testing workloads on Azure at
     special Dev/Test rates."""
    account_owner: Optional[str] = rest_field(name="accountOwner", visibility=["read"])
    """The owner of the enrollment account."""
    auth_type: Optional[str] = rest_field(name="authType", visibility=["read"])
    """The authorization type of the enrollment account."""
    status: Optional[str] = rest_field(visibility=["read"])
    """The status of the enrollment account."""
    start_date: Optional[datetime.datetime] = rest_field(name="startDate", visibility=["read"], format="rfc3339")
    """The date from which the enrollment account became valid and functional."""
    end_date: Optional[datetime.datetime] = rest_field(name="endDate", visibility=["read"], format="rfc3339")
    """The date of expiration of the enrollment account."""

    @overload
    def __init__(
        self,
        *,
        cost_center: Optional[str] = None,
        display_name: Optional[str] = None,
        is_dev_test_enabled: Optional[bool] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class EnrollmentAccountSubscriptionDetails(_Model):
    """The billing properties that can be modified. Available only for the Enterprise Agreement Type.

    :ivar enrollment_account_start_date: The enrollment Account and the subscription association
     start date. This field is available only for the Enterprise Agreement Type.
    :vartype enrollment_account_start_date: ~datetime.datetime
    :ivar subscription_enrollment_account_status: The current enrollment account status of the
     subscription. This field is available only for the Enterprise Agreement Type. Known values are:
     "Active", "Cancelled", "Expired", "Deleted", "TransferredOut", "Transferring", and "Inactive".
    :vartype subscription_enrollment_account_status: str or
     ~azure.mgmt.billing.models.SubscriptionEnrollmentAccountStatus
    """

    enrollment_account_start_date: Optional[datetime.datetime] = rest_field(
        name="enrollmentAccountStartDate", visibility=["read"], format="rfc3339"
    )
    """The enrollment Account and the subscription association start date. This field is available
     only for the Enterprise Agreement Type."""
    subscription_enrollment_account_status: Optional[Union[str, "_models.SubscriptionEnrollmentAccountStatus"]] = (
        rest_field(name="subscriptionEnrollmentAccountStatus", visibility=["read"])
    )
    """The current enrollment account status of the subscription. This field is available only for the
     Enterprise Agreement Type. Known values are: \"Active\", \"Cancelled\", \"Expired\",
     \"Deleted\", \"TransferredOut\", \"Transferring\", and \"Inactive\"."""


class EnrollmentDetailsIndirectRelationshipInfo(IndirectRelationshipInfo):  # pylint: disable=name-too-long
    """The properties of an enrollment which are applicable only for indirect enrollments.

    :ivar billing_account_name: The billing account name of the partner or the customer for an
     indirect motion.
    :vartype billing_account_name: str
    :ivar billing_profile_name: The billing profile name of the partner or the customer for an
     indirect motion.
    :vartype billing_profile_name: str
    :ivar display_name: The display name of the partner or customer for an indirect motion.
    :vartype display_name: str
    """

    @overload
    def __init__(
        self,
        *,
        billing_account_name: Optional[str] = None,
        billing_profile_name: Optional[str] = None,
        display_name: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ErrorAdditionalInfo(_Model):
    """The resource management error additional info.

    :ivar type: The additional info type.
    :vartype type: str
    :ivar info: The additional info.
    :vartype info: any
    """

    type: Optional[str] = rest_field(visibility=["read"])
    """The additional info type."""
    info: Optional[Any] = rest_field(visibility=["read"])
    """The additional info."""


class ErrorDetail(_Model):
    """The error detail.

    :ivar code: The error code.
    :vartype code: str
    :ivar message: The error message.
    :vartype message: str
    :ivar target: The error target.
    :vartype target: str
    :ivar details: The error details.
    :vartype details: list[~azure.mgmt.billing.models.ErrorDetail]
    :ivar additional_info: The error additional info.
    :vartype additional_info: list[~azure.mgmt.billing.models.ErrorAdditionalInfo]
    """

    code: Optional[str] = rest_field(visibility=["read"])
    """The error code."""
    message: Optional[str] = rest_field(visibility=["read"])
    """The error message."""
    target: Optional[str] = rest_field(visibility=["read"])
    """The error target."""
    details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"])
    """The error details."""
    additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field(
        name="additionalInfo", visibility=["read"]
    )
    """The error additional info."""


class ErrorResponse(_Model):
    """Error response.

    :ivar error: The error object.
    :vartype error: ~azure.mgmt.billing.models.ErrorDetail
    """

    error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The error object."""

    @overload
    def __init__(
        self,
        *,
        error: Optional["_models.ErrorDetail"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ExtendedStatusDefinitionProperties(_Model):
    """Extended status definition properties.

    :ivar subscription_id: Subscription Id.
    :vartype subscription_id: str
    """

    subscription_id: Optional[str] = rest_field(
        name="subscriptionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Subscription Id."""

    @overload
    def __init__(
        self,
        *,
        subscription_id: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ExtendedStatusInfo(_Model):
    """Extended status information.

    :ivar status_code: Status code providing additional information.
    :vartype status_code: str
    :ivar message: The message giving detailed information about the status code.
    :vartype message: str
    :ivar properties: Properties specific to credit line check failure.
    :vartype properties: ~azure.mgmt.billing.models.ExtendedStatusInfoProperties
    """

    status_code: Optional[str] = rest_field(
        name="statusCode", visibility=["read", "create", "update", "delete", "query"]
    )
    """Status code providing additional information."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The message giving detailed information about the status code."""
    properties: Optional["_models.ExtendedStatusInfoProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties specific to credit line check failure."""

    __flattened_items = ["subscription_id"]

    @overload
    def __init__(
        self,
        *,
        status_code: Optional[str] = None,
        message: Optional[str] = None,
        properties: Optional["_models.ExtendedStatusInfoProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class ExtendedStatusInfoProperties(_Model):
    """Properties specific to credit line check failure.

    :ivar subscription_id: The subscription that has failed credit line check.
    :vartype subscription_id: str
    """

    subscription_id: Optional[str] = rest_field(
        name="subscriptionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The subscription that has failed credit line check."""

    @overload
    def __init__(
        self,
        *,
        subscription_id: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class FailedPayment(_Model):
    """A failed payment.

    :ivar date: The date when the payment was attempted.
    :vartype date: ~datetime.datetime
    :ivar failed_payment_reason: The reason that the payment failed. Known values are: "Other",
     "BankDeclined", "CardExpired", and "IncorrectCardDetails".
    :vartype failed_payment_reason: str or ~azure.mgmt.billing.models.FailedPaymentReason
    """

    date: Optional[datetime.datetime] = rest_field(visibility=["read"], format="rfc3339")
    """The date when the payment was attempted."""
    failed_payment_reason: Optional[Union[str, "_models.FailedPaymentReason"]] = rest_field(
        name="failedPaymentReason", visibility=["read"]
    )
    """The reason that the payment failed. Known values are: \"Other\", \"BankDeclined\",
     \"CardExpired\", and \"IncorrectCardDetails\"."""


class InitiateTransferProperties(_Model):
    """Request parameters to initiate transfer.

    :ivar recipient_email_id: The email ID of the recipient to whom the transfer request is sent.
    :vartype recipient_email_id: str
    """

    recipient_email_id: Optional[str] = rest_field(
        name="recipientEmailId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The email ID of the recipient to whom the transfer request is sent."""

    @overload
    def __init__(
        self,
        *,
        recipient_email_id: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class InitiateTransferRequest(_Model):
    """Request parameters to initiate transfer.

    :ivar properties: Request parameters to initiate transfer.
    :vartype properties: ~azure.mgmt.billing.models.InitiateTransferProperties
    """

    properties: Optional["_models.InitiateTransferProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Request parameters to initiate transfer."""

    __flattened_items = ["recipient_email_id"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.InitiateTransferProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class Invoice(ProxyResource):
    """An invoice.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: An invoice.
    :vartype properties: ~azure.mgmt.billing.models.InvoiceProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.InvoiceProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """An invoice."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.InvoiceProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class InvoiceDocument(_Model):
    """The properties of a document.

    :ivar document_numbers: The document numbers for the invoice document.
    :vartype document_numbers: list[str]
    :ivar external_url: The URL to download the invoice document if the source is external to
     Microsoft.Billing.
    :vartype external_url: str
    :ivar kind: The type of the document. Known values are: "Other", "Invoice", "VoidNote",
     "TaxReceipt", "CreditNote", "Summary", and "Transactions".
    :vartype kind: str or ~azure.mgmt.billing.models.InvoiceDocumentType
    :ivar name: The ID that uniquely identifies an invoice document. This ID may be an identifier
     for an invoice PDF, a credit note, or a tax receipt.
    :vartype name: str
    :ivar url: The URL to download the invoice document if the source is internal to
     Microsoft.Billing.
    :vartype url: str
    :ivar source: The source of the document. ENF for Brazil and DRS for rest of the world. Known
     values are: "Other", "DRS", and "ENF".
    :vartype source: str or ~azure.mgmt.billing.models.DocumentSource
    """

    document_numbers: Optional[list[str]] = rest_field(name="documentNumbers", visibility=["read"])
    """The document numbers for the invoice document."""
    external_url: Optional[str] = rest_field(name="externalUrl", visibility=["read"])
    """The URL to download the invoice document if the source is external to Microsoft.Billing."""
    kind: Optional[Union[str, "_models.InvoiceDocumentType"]] = rest_field(visibility=["read"])
    """The type of the document. Known values are: \"Other\", \"Invoice\", \"VoidNote\",
     \"TaxReceipt\", \"CreditNote\", \"Summary\", and \"Transactions\"."""
    name: Optional[str] = rest_field(visibility=["read"])
    """The ID that uniquely identifies an invoice document. This ID may be an identifier for an
     invoice PDF, a credit note, or a tax receipt."""
    url: Optional[str] = rest_field(visibility=["read"])
    """The URL to download the invoice document if the source is internal to Microsoft.Billing."""
    source: Optional[Union[str, "_models.DocumentSource"]] = rest_field(visibility=["read"])
    """The source of the document. ENF for Brazil and DRS for rest of the world. Known values are:
     \"Other\", \"DRS\", and \"ENF\"."""


class InvoiceProperties(_Model):
    """An invoice.

    :ivar amount_due: The amount due as of now.
    :vartype amount_due: ~azure.mgmt.billing.models.InvoicePropertiesAmountDue
    :ivar azure_prepayment_applied: The amount of Azure prepayment applied to the charges. This
     field is applicable to billing accounts with agreement type Microsoft Customer Agreement.
    :vartype azure_prepayment_applied:
     ~azure.mgmt.billing.models.InvoicePropertiesAzurePrepaymentApplied
    :ivar billed_amount: The total charges for the invoice billing period.
    :vartype billed_amount: ~azure.mgmt.billing.models.InvoicePropertiesBilledAmount
    :ivar billed_document_id: The Id of the active invoice which is originally billed after this
     invoice was voided. This field is applicable to the void invoices only.
    :vartype billed_document_id: str
    :ivar billing_profile_display_name: The name of the billing profile for which the invoice is
     generated.
    :vartype billing_profile_display_name: str
    :ivar billing_profile_id: The ID of the billing profile for which the invoice is generated.
    :vartype billing_profile_id: str
    :ivar credit_amount: The total refund for returns and cancellations during the invoice billing
     period. This field is applicable to billing accounts with agreement type Microsoft Customer
     Agreement.
    :vartype credit_amount: ~azure.mgmt.billing.models.InvoicePropertiesCreditAmount
    :ivar credit_for_document_id: The Id of the invoice which got voided and this credit note was
     issued as a result. This field is applicable to the credit notes only.
    :vartype credit_for_document_id: str
    :ivar documents: List of documents available to download and view such as invoice, credit note,
     or tax receipt.
    :vartype documents: list[~azure.mgmt.billing.models.InvoiceDocument]
    :ivar document_type: The type of the document. Known values are: "Other", "Invoice",
     "VoidNote", "TaxReceipt", "CreditNote", "Summary", and "Transactions".
    :vartype document_type: str or ~azure.mgmt.billing.models.InvoiceDocumentType
    :ivar due_date: The due date for the invoice.
    :vartype due_date: ~datetime.datetime
    :ivar failed_payments: List of failed payments.
    :vartype failed_payments: list[~azure.mgmt.billing.models.FailedPayment]
    :ivar free_azure_credit_applied: The amount of free Azure credits applied to the charges. This
     field is applicable to billing accounts with agreement type Microsoft Customer Agreement.
    :vartype free_azure_credit_applied:
     ~azure.mgmt.billing.models.InvoicePropertiesFreeAzureCreditApplied
    :ivar invoice_date: The date when the invoice was generated.
    :vartype invoice_date: ~datetime.datetime
    :ivar invoice_period_end_date: The end date of the billing period for which the invoice is
     generated. The date is in MM-DD-YYYY format.
    :vartype invoice_period_end_date: ~datetime.datetime
    :ivar invoice_period_start_date: The start date of the billing period for which the invoice is
     generated. The date is in MM-DD-YYYY format.
    :vartype invoice_period_start_date: ~datetime.datetime
    :ivar invoice_type: Invoice type. Known values are: "Other", "AzureServices",
     "AzureMarketplace", and "AzureSupport".
    :vartype invoice_type: str or ~azure.mgmt.billing.models.InvoiceType
    :ivar is_monthly_invoice: Specifies if the invoice is generated as part of monthly invoicing
     cycle or not. This field is applicable to billing accounts with agreement type Microsoft
     Customer Agreement.
    :vartype is_monthly_invoice: bool
    :ivar payments: List of payments.
    :vartype payments: list[~azure.mgmt.billing.models.Payment]
    :ivar purchase_order_number: An optional purchase order number for the invoice.
    :vartype purchase_order_number: str
    :ivar rebill_details: Rebill details for an invoice.
    :vartype rebill_details: ~azure.mgmt.billing.models.InvoicePropertiesRebillDetails
    :ivar status: The current status of the invoice. Known values are: "Other", "Due", "OverDue",
     "Paid", "Void", and "Locked".
    :vartype status: str or ~azure.mgmt.billing.models.InvoiceStatus
    :ivar subscription_display_name: The name of the billing subscription for which the invoice is
     generated.
    :vartype subscription_display_name: str
    :ivar subscription_id: The ID of the subscription for which the invoice is generated.
    :vartype subscription_id: str
    :ivar special_taxation_type: Identifies the type of tax calculation used for the invoice. The
     field is applicable only to invoices with special tax calculation logic. Known values are:
     "SubtotalLevel" and "InvoiceLevel".
    :vartype special_taxation_type: str or ~azure.mgmt.billing.models.SpecialTaxationType
    :ivar sub_total: The pre-tax amount due. This field is applicable to billing accounts with
     agreement type Microsoft Customer Agreement.
    :vartype sub_total: ~azure.mgmt.billing.models.InvoicePropertiesSubTotal
    :ivar tax_amount: The amount of tax charged for the billing period. This field is applicable to
     billing accounts with agreement type Microsoft Customer Agreement.
    :vartype tax_amount: ~azure.mgmt.billing.models.InvoicePropertiesTaxAmount
    :ivar total_amount: The amount due when the invoice was generated. This field is applicable to
     billing accounts with agreement type Microsoft Customer Agreement.
    :vartype total_amount: ~azure.mgmt.billing.models.InvoicePropertiesTotalAmount
    :ivar refund_details: The details of a refund request.
    :vartype refund_details: ~azure.mgmt.billing.models.InvoicePropertiesRefundDetails
    """

    amount_due: Optional["_models.InvoicePropertiesAmountDue"] = rest_field(
        name="amountDue", visibility=["read", "create", "update", "delete", "query"]
    )
    """The amount due as of now."""
    azure_prepayment_applied: Optional["_models.InvoicePropertiesAzurePrepaymentApplied"] = rest_field(
        name="azurePrepaymentApplied", visibility=["read", "create", "update", "delete", "query"]
    )
    """The amount of Azure prepayment applied to the charges. This field is applicable to billing
     accounts with agreement type Microsoft Customer Agreement."""
    billed_amount: Optional["_models.InvoicePropertiesBilledAmount"] = rest_field(
        name="billedAmount", visibility=["read", "create", "update", "delete", "query"]
    )
    """The total charges for the invoice billing period."""
    billed_document_id: Optional[str] = rest_field(name="billedDocumentId", visibility=["read"])
    """The Id of the active invoice which is originally billed after this invoice was voided. This
     field is applicable to the void invoices only."""
    billing_profile_display_name: Optional[str] = rest_field(name="billingProfileDisplayName", visibility=["read"])
    """The name of the billing profile for which the invoice is generated."""
    billing_profile_id: Optional[str] = rest_field(name="billingProfileId", visibility=["read"])
    """The ID of the billing profile for which the invoice is generated."""
    credit_amount: Optional["_models.InvoicePropertiesCreditAmount"] = rest_field(
        name="creditAmount", visibility=["read", "create", "update", "delete", "query"]
    )
    """The total refund for returns and cancellations during the invoice billing period. This field is
     applicable to billing accounts with agreement type Microsoft Customer Agreement."""
    credit_for_document_id: Optional[str] = rest_field(name="creditForDocumentId", visibility=["read"])
    """The Id of the invoice which got voided and this credit note was issued as a result. This field
     is applicable to the credit notes only."""
    documents: Optional[list["_models.InvoiceDocument"]] = rest_field(visibility=["read"])
    """List of documents available to download and view such as invoice, credit note, or tax receipt."""
    document_type: Optional[Union[str, "_models.InvoiceDocumentType"]] = rest_field(
        name="documentType", visibility=["read"]
    )
    """The type of the document. Known values are: \"Other\", \"Invoice\", \"VoidNote\",
     \"TaxReceipt\", \"CreditNote\", \"Summary\", and \"Transactions\"."""
    due_date: Optional[datetime.datetime] = rest_field(name="dueDate", visibility=["read"], format="rfc3339")
    """The due date for the invoice."""
    failed_payments: Optional[list["_models.FailedPayment"]] = rest_field(name="failedPayments", visibility=["read"])
    """List of failed payments."""
    free_azure_credit_applied: Optional["_models.InvoicePropertiesFreeAzureCreditApplied"] = rest_field(
        name="freeAzureCreditApplied", visibility=["read", "create", "update", "delete", "query"]
    )
    """The amount of free Azure credits applied to the charges. This field is applicable to billing
     accounts with agreement type Microsoft Customer Agreement."""
    invoice_date: Optional[datetime.datetime] = rest_field(name="invoiceDate", visibility=["read"], format="rfc3339")
    """The date when the invoice was generated."""
    invoice_period_end_date: Optional[datetime.datetime] = rest_field(
        name="invoicePeriodEndDate", visibility=["read"], format="rfc3339"
    )
    """The end date of the billing period for which the invoice is generated. The date is in
     MM-DD-YYYY format."""
    invoice_period_start_date: Optional[datetime.datetime] = rest_field(
        name="invoicePeriodStartDate", visibility=["read"], format="rfc3339"
    )
    """The start date of the billing period for which the invoice is generated. The date is in
     MM-DD-YYYY format."""
    invoice_type: Optional[Union[str, "_models.InvoiceType"]] = rest_field(name="invoiceType", visibility=["read"])
    """Invoice type. Known values are: \"Other\", \"AzureServices\", \"AzureMarketplace\", and
     \"AzureSupport\"."""
    is_monthly_invoice: Optional[bool] = rest_field(name="isMonthlyInvoice", visibility=["read"])
    """Specifies if the invoice is generated as part of monthly invoicing cycle or not. This field is
     applicable to billing accounts with agreement type Microsoft Customer Agreement."""
    payments: Optional[list["_models.Payment"]] = rest_field(visibility=["read"])
    """List of payments."""
    purchase_order_number: Optional[str] = rest_field(name="purchaseOrderNumber", visibility=["read"])
    """An optional purchase order number for the invoice."""
    rebill_details: Optional["_models.InvoicePropertiesRebillDetails"] = rest_field(
        name="rebillDetails", visibility=["read", "create", "update", "delete", "query"]
    )
    """Rebill details for an invoice."""
    status: Optional[Union[str, "_models.InvoiceStatus"]] = rest_field(visibility=["read"])
    """The current status of the invoice. Known values are: \"Other\", \"Due\", \"OverDue\", \"Paid\",
     \"Void\", and \"Locked\"."""
    subscription_display_name: Optional[str] = rest_field(name="subscriptionDisplayName", visibility=["read"])
    """The name of the billing subscription for which the invoice is generated."""
    subscription_id: Optional[str] = rest_field(name="subscriptionId", visibility=["read"])
    """The ID of the subscription for which the invoice is generated."""
    special_taxation_type: Optional[Union[str, "_models.SpecialTaxationType"]] = rest_field(
        name="specialTaxationType", visibility=["read"]
    )
    """Identifies the type of tax calculation used for the invoice. The field is applicable only to
     invoices with special tax calculation logic. Known values are: \"SubtotalLevel\" and
     \"InvoiceLevel\"."""
    sub_total: Optional["_models.InvoicePropertiesSubTotal"] = rest_field(
        name="subTotal", visibility=["read", "create", "update", "delete", "query"]
    )
    """The pre-tax amount due. This field is applicable to billing accounts with agreement type
     Microsoft Customer Agreement."""
    tax_amount: Optional["_models.InvoicePropertiesTaxAmount"] = rest_field(
        name="taxAmount", visibility=["read", "create", "update", "delete", "query"]
    )
    """The amount of tax charged for the billing period. This field is applicable to billing accounts
     with agreement type Microsoft Customer Agreement."""
    total_amount: Optional["_models.InvoicePropertiesTotalAmount"] = rest_field(
        name="totalAmount", visibility=["read", "create", "update", "delete", "query"]
    )
    """The amount due when the invoice was generated. This field is applicable to billing accounts
     with agreement type Microsoft Customer Agreement."""
    refund_details: Optional["_models.InvoicePropertiesRefundDetails"] = rest_field(
        name="refundDetails", visibility=["read", "create", "update", "delete", "query"]
    )
    """The details of a refund request."""

    @overload
    def __init__(  # pylint: disable=too-many-locals
        self,
        *,
        amount_due: Optional["_models.InvoicePropertiesAmountDue"] = None,
        azure_prepayment_applied: Optional["_models.InvoicePropertiesAzurePrepaymentApplied"] = None,
        billed_amount: Optional["_models.InvoicePropertiesBilledAmount"] = None,
        credit_amount: Optional["_models.InvoicePropertiesCreditAmount"] = None,
        free_azure_credit_applied: Optional["_models.InvoicePropertiesFreeAzureCreditApplied"] = None,
        rebill_details: Optional["_models.InvoicePropertiesRebillDetails"] = None,
        sub_total: Optional["_models.InvoicePropertiesSubTotal"] = None,
        tax_amount: Optional["_models.InvoicePropertiesTaxAmount"] = None,
        total_amount: Optional["_models.InvoicePropertiesTotalAmount"] = None,
        refund_details: Optional["_models.InvoicePropertiesRefundDetails"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class InvoicePropertiesAmountDue(Amount):
    """The amount due as of now.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class InvoicePropertiesAzurePrepaymentApplied(Amount):
    """The amount of Azure prepayment applied to the charges. This field is applicable to billing
    accounts with agreement type Microsoft Customer Agreement.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class InvoicePropertiesBilledAmount(Amount):
    """The total charges for the invoice billing period.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class InvoicePropertiesCreditAmount(Amount):
    """The total refund for returns and cancellations during the invoice billing period. This field is
    applicable to billing accounts with agreement type Microsoft Customer Agreement.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class InvoicePropertiesFreeAzureCreditApplied(Amount):
    """The amount of free Azure credits applied to the charges. This field is applicable to billing
    accounts with agreement type Microsoft Customer Agreement.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class RebillDetails(_Model):
    """The rebill details of an invoice.

    :ivar invoice_document_id: The ID of invoice.
    :vartype invoice_document_id: str
    :ivar credit_note_document_id: The ID of credit note.
    :vartype credit_note_document_id: str
    :ivar rebill_details: The rebill details of an invoice.
    :vartype rebill_details: ~azure.mgmt.billing.models.RebillDetails
    """

    invoice_document_id: Optional[str] = rest_field(name="invoiceDocumentId", visibility=["read"])
    """The ID of invoice."""
    credit_note_document_id: Optional[str] = rest_field(name="creditNoteDocumentId", visibility=["read"])
    """The ID of credit note."""
    rebill_details: Optional["_models.RebillDetails"] = rest_field(name="rebillDetails", visibility=["read"])
    """The rebill details of an invoice."""


class InvoicePropertiesRebillDetails(RebillDetails):
    """Rebill details for an invoice.

    :ivar invoice_document_id: The ID of invoice.
    :vartype invoice_document_id: str
    :ivar credit_note_document_id: The ID of credit note.
    :vartype credit_note_document_id: str
    :ivar rebill_details: The rebill details of an invoice.
    :vartype rebill_details: ~azure.mgmt.billing.models.RebillDetails
    """


class RefundDetailsSummary(_Model):
    """The details of refund request.

    :ivar requested_on: Date when the refund was requested.
    :vartype requested_on: ~datetime.datetime
    :ivar approved_on: Date when the refund was approved.
    :vartype approved_on: ~datetime.datetime
    :ivar completed_on: Date when the refund was completed.
    :vartype completed_on: ~datetime.datetime
    :ivar amount_requested: The amount of refund requested.
    :vartype amount_requested: ~azure.mgmt.billing.models.RefundDetailsSummaryAmountRequested
    :ivar amount_refunded: The amount refunded.
    :vartype amount_refunded: ~azure.mgmt.billing.models.RefundDetailsSummaryAmountRefunded
    :ivar rebill_invoice_id: The invoice ID of the rebill invoice for a refund.
    :vartype rebill_invoice_id: str
    :ivar transaction_count: The number of transactions refunded.
    :vartype transaction_count: int
    :ivar refund_status: The status of refund request. Known values are: "Other", "Pending",
     "Approved", "Declined", "Cancelled", "Completed", and "Expired".
    :vartype refund_status: str or ~azure.mgmt.billing.models.RefundStatus
    :ivar refund_operation_id: The ID of refund operation.
    :vartype refund_operation_id: str
    :ivar refund_reason: The reason for refund. Known values are: "Other", "AccidentalConversion",
     "UnclearPricing", "AccidentalPurchase", "ForgotToCancel", and "UnclearDocumentation".
    :vartype refund_reason: str or ~azure.mgmt.billing.models.RefundReasonCode
    """

    requested_on: Optional[datetime.datetime] = rest_field(name="requestedOn", visibility=["read"], format="rfc3339")
    """Date when the refund was requested."""
    approved_on: Optional[datetime.datetime] = rest_field(name="approvedOn", visibility=["read"], format="rfc3339")
    """Date when the refund was approved."""
    completed_on: Optional[datetime.datetime] = rest_field(name="completedOn", visibility=["read"], format="rfc3339")
    """Date when the refund was completed."""
    amount_requested: Optional["_models.RefundDetailsSummaryAmountRequested"] = rest_field(
        name="amountRequested", visibility=["read", "create", "update", "delete", "query"]
    )
    """The amount of refund requested."""
    amount_refunded: Optional["_models.RefundDetailsSummaryAmountRefunded"] = rest_field(
        name="amountRefunded", visibility=["read", "create", "update", "delete", "query"]
    )
    """The amount refunded."""
    rebill_invoice_id: Optional[str] = rest_field(name="rebillInvoiceId", visibility=["read"])
    """The invoice ID of the rebill invoice for a refund."""
    transaction_count: Optional[int] = rest_field(name="transactionCount", visibility=["read"])
    """The number of transactions refunded."""
    refund_status: Optional[Union[str, "_models.RefundStatus"]] = rest_field(name="refundStatus", visibility=["read"])
    """The status of refund request. Known values are: \"Other\", \"Pending\", \"Approved\",
     \"Declined\", \"Cancelled\", \"Completed\", and \"Expired\"."""
    refund_operation_id: Optional[str] = rest_field(name="refundOperationId", visibility=["read"])
    """The ID of refund operation."""
    refund_reason: Optional[Union[str, "_models.RefundReasonCode"]] = rest_field(
        name="refundReason", visibility=["read"]
    )
    """The reason for refund. Known values are: \"Other\", \"AccidentalConversion\",
     \"UnclearPricing\", \"AccidentalPurchase\", \"ForgotToCancel\", and \"UnclearDocumentation\"."""

    @overload
    def __init__(
        self,
        *,
        amount_requested: Optional["_models.RefundDetailsSummaryAmountRequested"] = None,
        amount_refunded: Optional["_models.RefundDetailsSummaryAmountRefunded"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class InvoicePropertiesRefundDetails(RefundDetailsSummary):
    """The details of a refund request.

    :ivar requested_on: Date when the refund was requested.
    :vartype requested_on: ~datetime.datetime
    :ivar approved_on: Date when the refund was approved.
    :vartype approved_on: ~datetime.datetime
    :ivar completed_on: Date when the refund was completed.
    :vartype completed_on: ~datetime.datetime
    :ivar amount_requested: The amount of refund requested.
    :vartype amount_requested: ~azure.mgmt.billing.models.RefundDetailsSummaryAmountRequested
    :ivar amount_refunded: The amount refunded.
    :vartype amount_refunded: ~azure.mgmt.billing.models.RefundDetailsSummaryAmountRefunded
    :ivar rebill_invoice_id: The invoice ID of the rebill invoice for a refund.
    :vartype rebill_invoice_id: str
    :ivar transaction_count: The number of transactions refunded.
    :vartype transaction_count: int
    :ivar refund_status: The status of refund request. Known values are: "Other", "Pending",
     "Approved", "Declined", "Cancelled", "Completed", and "Expired".
    :vartype refund_status: str or ~azure.mgmt.billing.models.RefundStatus
    :ivar refund_operation_id: The ID of refund operation.
    :vartype refund_operation_id: str
    :ivar refund_reason: The reason for refund. Known values are: "Other", "AccidentalConversion",
     "UnclearPricing", "AccidentalPurchase", "ForgotToCancel", and "UnclearDocumentation".
    :vartype refund_reason: str or ~azure.mgmt.billing.models.RefundReasonCode
    """

    @overload
    def __init__(
        self,
        *,
        amount_requested: Optional["_models.RefundDetailsSummaryAmountRequested"] = None,
        amount_refunded: Optional["_models.RefundDetailsSummaryAmountRefunded"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class InvoicePropertiesSubTotal(Amount):
    """The pre-tax amount due. This field is applicable to billing accounts with agreement type
    Microsoft Customer Agreement.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class InvoicePropertiesTaxAmount(Amount):
    """The amount of tax charged for the billing period. This field is applicable to billing accounts
    with agreement type Microsoft Customer Agreement.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class InvoicePropertiesTotalAmount(Amount):
    """The amount due when the invoice was generated. This field is applicable to billing accounts
    with agreement type Microsoft Customer Agreement.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class InvoiceSection(ProxyResource):
    """An invoice section.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: An invoice section.
    :vartype properties: ~azure.mgmt.billing.models.InvoiceSectionProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.InvoiceSectionProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """An invoice section."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.InvoiceSectionProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class InvoiceSectionProperties(_Model):
    """An invoice section.

    :ivar provisioning_state: The provisioning state of the resource during a long-running
     operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending",
     "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired".
    :vartype provisioning_state: str or ~azure.mgmt.billing.models.ProvisioningState
    :ivar display_name: The name of the invoice section.
    :vartype display_name: str
    :ivar state: Identifies the status of an invoice section. Known values are: "Other", "Active",
     "Deleted", "Disabled", "UnderReview", "Warned", and "Restricted".
    :vartype state: str or ~azure.mgmt.billing.models.InvoiceSectionState
    :ivar reason_code: Reason for the specified invoice section status. Known values are: "Other",
     "PastDue", "UnusualActivity", "SpendingLimitReached", and "SpendingLimitExpired".
    :vartype reason_code: str or ~azure.mgmt.billing.models.InvoiceSectionStateReasonCode
    :ivar system_id: The system generated unique identifier for an invoice section.
    :vartype system_id: str
    :ivar target_cloud: Identifies the cloud environments that are associated with an invoice
     section. This is a system managed optional field and gets updated as the invoice section gets
     associated with accounts in various clouds.
    :vartype target_cloud: str
    :ivar tags: Dictionary of metadata associated with the resource. Maximum key/value length
     supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain <
     > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the resource during a long-running operation. Known values are:
     \"Succeeded\", \"Canceled\", \"Failed\", \"New\", \"Pending\", \"Provisioning\",
     \"PendingBilling\", \"ConfirmedBilling\", \"Creating\", \"Created\", and \"Expired\"."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the invoice section."""
    state: Optional[Union[str, "_models.InvoiceSectionState"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Identifies the status of an invoice section. Known values are: \"Other\", \"Active\",
     \"Deleted\", \"Disabled\", \"UnderReview\", \"Warned\", and \"Restricted\"."""
    reason_code: Optional[Union[str, "_models.InvoiceSectionStateReasonCode"]] = rest_field(
        name="reasonCode", visibility=["read", "create", "update", "delete", "query"]
    )
    """Reason for the specified invoice section status. Known values are: \"Other\", \"PastDue\",
     \"UnusualActivity\", \"SpendingLimitReached\", and \"SpendingLimitExpired\"."""
    system_id: Optional[str] = rest_field(name="systemId", visibility=["read"])
    """The system generated unique identifier for an invoice section."""
    target_cloud: Optional[str] = rest_field(
        name="targetCloud", visibility=["read", "create", "update", "delete", "query"]
    )
    """Identifies the cloud environments that are associated with an invoice section. This is a system
     managed optional field and gets updated as the invoice section gets associated with accounts in
     various clouds."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. Maximum key/value length supported of 256
     characters. Keys/value should not empty value nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        display_name: Optional[str] = None,
        state: Optional[Union[str, "_models.InvoiceSectionState"]] = None,
        reason_code: Optional[Union[str, "_models.InvoiceSectionStateReasonCode"]] = None,
        target_cloud: Optional[str] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class InvoiceSectionWithCreateSubPermission(_Model):
    """Invoice section properties with create subscription permission.

    :ivar billing_profile_display_name: The name of the billing profile.
    :vartype billing_profile_display_name: str
    :ivar billing_profile_id: The fully qualified ID that uniquely identifies a billing profile.
    :vartype billing_profile_id: str
    :ivar billing_profile_system_id: The system generated unique identifier for a billing profile.
    :vartype billing_profile_system_id: str
    :ivar billing_profile_status: The status of the billing profile. Known values are: "Other",
     "Active", "Disabled", "Warned", "Deleted", and "UnderReview".
    :vartype billing_profile_status: str or ~azure.mgmt.billing.models.BillingProfileStatus
    :ivar billing_profile_status_reason_code: Reason for the specified billing profile status.
     Known values are: "Other", "PastDue", "UnusualActivity", "SpendingLimitReached", and
     "SpendingLimitExpired".
    :vartype billing_profile_status_reason_code: str or
     ~azure.mgmt.billing.models.BillingProfileStatusReasonCode
    :ivar billing_profile_spending_limit: The billing profile spending limit. Known values are:
     "Off" and "On".
    :vartype billing_profile_spending_limit: str or ~azure.mgmt.billing.models.SpendingLimit
    :ivar enabled_azure_plans: Enabled azure plans for the associated billing profile.
    :vartype enabled_azure_plans: list[~azure.mgmt.billing.models.AzurePlan]
    :ivar invoice_section_display_name: The name of the invoice section.
    :vartype invoice_section_display_name: str
    :ivar invoice_section_id: The fully qualified ID that uniquely identifies an invoice section.
    :vartype invoice_section_id: str
    :ivar invoice_section_system_id: The system generated unique identifier for an invoice section.
    :vartype invoice_section_system_id: str
    """

    billing_profile_display_name: Optional[str] = rest_field(name="billingProfileDisplayName", visibility=["read"])
    """The name of the billing profile."""
    billing_profile_id: Optional[str] = rest_field(name="billingProfileId", visibility=["read"])
    """The fully qualified ID that uniquely identifies a billing profile."""
    billing_profile_system_id: Optional[str] = rest_field(name="billingProfileSystemId", visibility=["read"])
    """The system generated unique identifier for a billing profile."""
    billing_profile_status: Optional[Union[str, "_models.BillingProfileStatus"]] = rest_field(
        name="billingProfileStatus", visibility=["read"]
    )
    """The status of the billing profile. Known values are: \"Other\", \"Active\", \"Disabled\",
     \"Warned\", \"Deleted\", and \"UnderReview\"."""
    billing_profile_status_reason_code: Optional[Union[str, "_models.BillingProfileStatusReasonCode"]] = rest_field(
        name="billingProfileStatusReasonCode", visibility=["read"]
    )
    """Reason for the specified billing profile status. Known values are: \"Other\", \"PastDue\",
     \"UnusualActivity\", \"SpendingLimitReached\", and \"SpendingLimitExpired\"."""
    billing_profile_spending_limit: Optional[Union[str, "_models.SpendingLimit"]] = rest_field(
        name="billingProfileSpendingLimit", visibility=["read"]
    )
    """The billing profile spending limit. Known values are: \"Off\" and \"On\"."""
    enabled_azure_plans: Optional[list["_models.AzurePlan"]] = rest_field(name="enabledAzurePlans", visibility=["read"])
    """Enabled azure plans for the associated billing profile."""
    invoice_section_display_name: Optional[str] = rest_field(name="invoiceSectionDisplayName", visibility=["read"])
    """The name of the invoice section."""
    invoice_section_id: Optional[str] = rest_field(name="invoiceSectionId", visibility=["read"])
    """The fully qualified ID that uniquely identifies an invoice section."""
    invoice_section_system_id: Optional[str] = rest_field(name="invoiceSectionSystemId", visibility=["read"])
    """The system generated unique identifier for an invoice section."""


class MoveBillingSubscriptionEligibilityResult(_Model):
    """Result of the transfer eligibility validation.

    :ivar is_move_eligible: Specifies whether the subscription is eligible to be transferred.
    :vartype is_move_eligible: bool
    :ivar error_details: Error details of the transfer eligibility validation.
    :vartype error_details: ~azure.mgmt.billing.models.MoveBillingSubscriptionErrorDetails
    """

    is_move_eligible: Optional[bool] = rest_field(name="isMoveEligible", visibility=["read"])
    """Specifies whether the subscription is eligible to be transferred."""
    error_details: Optional["_models.MoveBillingSubscriptionErrorDetails"] = rest_field(
        name="errorDetails", visibility=["read", "create", "update", "delete", "query"]
    )
    """Error details of the transfer eligibility validation."""

    @overload
    def __init__(
        self,
        *,
        error_details: Optional["_models.MoveBillingSubscriptionErrorDetails"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class MoveBillingSubscriptionErrorDetails(_Model):
    """Error details of the transfer eligibility validation.

    :ivar code: Error code of the transfer validation response. Known values are: "Other",
     "BillingAccountInactive", "DestinationBillingProfileInactive",
     "DestinationBillingProfileNotFound", "DestinationBillingProfilePastDue",
     "DestinationInvoiceSectionInactive", "DestinationInvoiceSectionNotFound",
     "InsufficientPermissionOnDestination", "InsufficientPermissionOnSource", "InvalidDestination",
     "InvalidSource", "MarketplaceNotEnabledOnDestination", "ProductInactive", "ProductNotFound",
     "ProductTypeNotSupported", "SourceBillingProfilePastDue", "SourceInvoiceSectionInactive",
     "AccountIsLocked", "AssetHasCap", "AssetNotActive", "BillingProfilePastDue",
     "CrossBillingAccountNotAllowed", "NoActiveAzurePlan", "None", "SubscriptionNotActive",
     "SubscriptionHasReservations", "SubscriptionTypeNotSupported", and
     "InvoiceSectionIsRestricted".
    :vartype code: str or ~azure.mgmt.billing.models.SubscriptionTransferValidationErrorCode
    :ivar message: The error message.
    :vartype message: str
    :ivar details: Detailed error message explaining the error.
    :vartype details: str
    """

    code: Optional[Union[str, "_models.SubscriptionTransferValidationErrorCode"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Error code of the transfer validation response. Known values are: \"Other\",
     \"BillingAccountInactive\", \"DestinationBillingProfileInactive\",
     \"DestinationBillingProfileNotFound\", \"DestinationBillingProfilePastDue\",
     \"DestinationInvoiceSectionInactive\", \"DestinationInvoiceSectionNotFound\",
     \"InsufficientPermissionOnDestination\", \"InsufficientPermissionOnSource\",
     \"InvalidDestination\", \"InvalidSource\", \"MarketplaceNotEnabledOnDestination\",
     \"ProductInactive\", \"ProductNotFound\", \"ProductTypeNotSupported\",
     \"SourceBillingProfilePastDue\", \"SourceInvoiceSectionInactive\", \"AccountIsLocked\",
     \"AssetHasCap\", \"AssetNotActive\", \"BillingProfilePastDue\",
     \"CrossBillingAccountNotAllowed\", \"NoActiveAzurePlan\", \"None\", \"SubscriptionNotActive\",
     \"SubscriptionHasReservations\", \"SubscriptionTypeNotSupported\", and
     \"InvoiceSectionIsRestricted\"."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The error message."""
    details: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Detailed error message explaining the error."""

    @overload
    def __init__(
        self,
        *,
        code: Optional[Union[str, "_models.SubscriptionTransferValidationErrorCode"]] = None,
        message: Optional[str] = None,
        details: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class MoveBillingSubscriptionRequest(_Model):
    """Request parameters to transfer billing subscription.

    :ivar destination_invoice_section_id: The destination invoice section id.
    :vartype destination_invoice_section_id: str
    :ivar destination_enrollment_account_id: The destination enrollment account id.
    :vartype destination_enrollment_account_id: str
    """

    destination_invoice_section_id: Optional[str] = rest_field(
        name="destinationInvoiceSectionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The destination invoice section id."""
    destination_enrollment_account_id: Optional[str] = rest_field(
        name="destinationEnrollmentAccountId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The destination enrollment account id."""

    @overload
    def __init__(
        self,
        *,
        destination_invoice_section_id: Optional[str] = None,
        destination_enrollment_account_id: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class MoveProductEligibilityResult(_Model):
    """Result of the transfer eligibility validation.

    :ivar is_move_eligible: Specifies whether the subscription is eligible to be transferred.
    :vartype is_move_eligible: bool
    :ivar error_details: Error details of the transfer eligibility validation.
    :vartype error_details: ~azure.mgmt.billing.models.MoveProductEligibilityResultErrorDetails
    """

    is_move_eligible: Optional[bool] = rest_field(
        name="isMoveEligible", visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies whether the subscription is eligible to be transferred."""
    error_details: Optional["_models.MoveProductEligibilityResultErrorDetails"] = rest_field(
        name="errorDetails", visibility=["read", "create", "update", "delete", "query"]
    )
    """Error details of the transfer eligibility validation."""

    @overload
    def __init__(
        self,
        *,
        is_move_eligible: Optional[bool] = None,
        error_details: Optional["_models.MoveProductEligibilityResultErrorDetails"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class MoveProductErrorDetails(_Model):
    """Error details of the transfer eligibility validation.

    :ivar code: Error code for the product transfer validation. Known values are: "Other",
     "BillingAccountInactive", "DestinationBillingProfileInactive",
     "DestinationBillingProfileNotFound", "DestinationBillingProfilePastDue",
     "DestinationInvoiceSectionInactive", "DestinationInvoiceSectionNotFound",
     "InsufficientPermissionOnDestination", "InsufficientPermissionOnSource", "InvalidDestination",
     "InvalidSource", "MarketplaceNotEnabledOnDestination", "ProductInactive", "ProductNotFound",
     "ProductTypeNotSupported", "SourceBillingProfilePastDue", and "SourceInvoiceSectionInactive".
    :vartype code: str or ~azure.mgmt.billing.models.MoveValidationErrorCode
    :ivar message: The error message.
    :vartype message: str
    :ivar details: Error details of the transfer eligibility validation.
    :vartype details: str
    """

    code: Optional[Union[str, "_models.MoveValidationErrorCode"]] = rest_field(visibility=["read"])
    """Error code for the product transfer validation. Known values are: \"Other\",
     \"BillingAccountInactive\", \"DestinationBillingProfileInactive\",
     \"DestinationBillingProfileNotFound\", \"DestinationBillingProfilePastDue\",
     \"DestinationInvoiceSectionInactive\", \"DestinationInvoiceSectionNotFound\",
     \"InsufficientPermissionOnDestination\", \"InsufficientPermissionOnSource\",
     \"InvalidDestination\", \"InvalidSource\", \"MarketplaceNotEnabledOnDestination\",
     \"ProductInactive\", \"ProductNotFound\", \"ProductTypeNotSupported\",
     \"SourceBillingProfilePastDue\", and \"SourceInvoiceSectionInactive\"."""
    message: Optional[str] = rest_field(visibility=["read"])
    """The error message."""
    details: Optional[str] = rest_field(visibility=["read"])
    """Error details of the transfer eligibility validation."""


class MoveProductEligibilityResultErrorDetails(MoveProductErrorDetails):
    """Error details of the transfer eligibility validation.

    :ivar code: Error code for the product transfer validation. Known values are: "Other",
     "BillingAccountInactive", "DestinationBillingProfileInactive",
     "DestinationBillingProfileNotFound", "DestinationBillingProfilePastDue",
     "DestinationInvoiceSectionInactive", "DestinationInvoiceSectionNotFound",
     "InsufficientPermissionOnDestination", "InsufficientPermissionOnSource", "InvalidDestination",
     "InvalidSource", "MarketplaceNotEnabledOnDestination", "ProductInactive", "ProductNotFound",
     "ProductTypeNotSupported", "SourceBillingProfilePastDue", and "SourceInvoiceSectionInactive".
    :vartype code: str or ~azure.mgmt.billing.models.MoveValidationErrorCode
    :ivar message: The error message.
    :vartype message: str
    :ivar details: Error details of the transfer eligibility validation.
    :vartype details: str
    """


class MoveProductRequest(_Model):
    """The properties of the product to initiate a transfer.

    :ivar destination_invoice_section_id: The destination invoice section id. Required.
    :vartype destination_invoice_section_id: str
    """

    destination_invoice_section_id: str = rest_field(
        name="destinationInvoiceSectionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The destination invoice section id. Required."""

    @overload
    def __init__(
        self,
        *,
        destination_invoice_section_id: str,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class NextBillingCycleDetails(_Model):
    """Billing cycle details of the product.

    :ivar billing_frequency: Billing frequency of the product under the subscription.
    :vartype billing_frequency: str
    """

    billing_frequency: Optional[str] = rest_field(name="billingFrequency", visibility=["read"])
    """Billing frequency of the product under the subscription."""


class Operation(_Model):
    """Details of a REST API operation, returned from the Resource Provider Operations API.

    :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
     "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
    :vartype name: str
    :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for
     data-plane operations and "false" for ARM/control-plane operations.
    :vartype is_data_action: bool
    :ivar display: Localized display information for this particular operation.
    :vartype display: ~azure.mgmt.billing.models.OperationDisplay
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
     \"Microsoft.Compute/virtualMachines/write\",
     \"Microsoft.Compute/virtualMachines/capture/action\"."""
    is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"])
    """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and
     \"false\" for ARM/control-plane operations."""
    display: Optional["_models.OperationDisplay"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Localized display information for this particular operation."""

    @overload
    def __init__(
        self,
        *,
        display: Optional["_models.OperationDisplay"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class OperationDisplay(_Model):
    """Localized display information for this particular operation.

    :ivar description: The short, localized friendly description of the operation; suitable for
     tool tips and detailed views.
    :vartype description: str
    :ivar operation: The concise, localized friendly name for the operation; suitable for
     dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine".
    :vartype operation: str
    :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft
     Monitoring Insights" or "Microsoft Compute".
    :vartype provider: str
    :ivar resource: The localized friendly name of the resource type related to this operation.
     E.g. "Virtual Machines" or "Job Schedule Collections".
    :vartype resource: str
    """

    description: Optional[str] = rest_field(visibility=["read"])
    """The short, localized friendly description of the operation; suitable for tool tips and detailed
     views."""
    operation: Optional[str] = rest_field(visibility=["read"])
    """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create
     or Update Virtual Machine\", \"Restart Virtual Machine\"."""
    provider: Optional[str] = rest_field(visibility=["read"])
    """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring
     Insights\" or \"Microsoft Compute\"."""
    resource: Optional[str] = rest_field(visibility=["read"])
    """The localized friendly name of the resource type related to this operation. E.g. \"Virtual
     Machines\" or \"Job Schedule Collections\"."""


class Participant(_Model):
    """Billing account name. Available for a specific type of agreement.

    :ivar email: The email address of the participant.
    :vartype email: str
    :ivar status: The acceptance status of the participant.
    :vartype status: str
    :ivar status_date: The date when the status got changed.
    :vartype status_date: ~datetime.datetime
    """

    email: Optional[str] = rest_field(visibility=["read"])
    """The email address of the participant."""
    status: Optional[str] = rest_field(visibility=["read"])
    """The acceptance status of the participant."""
    status_date: Optional[datetime.datetime] = rest_field(name="statusDate", visibility=["read"], format="rfc3339")
    """The date when the status got changed."""


class PartnerInitiateTransferProperties(_Model):
    """Request parameters to initiate transfer.

    :ivar recipient_email_id: The email ID of the recipient to whom the transfer request is sent.
    :vartype recipient_email_id: str
    :ivar reseller_id: Optional MPN ID of the reseller for transfer requests that are sent from a
     Microsoft Partner Agreement billing account.
    :vartype reseller_id: str
    """

    recipient_email_id: Optional[str] = rest_field(
        name="recipientEmailId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The email ID of the recipient to whom the transfer request is sent."""
    reseller_id: Optional[str] = rest_field(
        name="resellerId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Optional MPN ID of the reseller for transfer requests that are sent from a Microsoft Partner
     Agreement billing account."""

    @overload
    def __init__(
        self,
        *,
        recipient_email_id: Optional[str] = None,
        reseller_id: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class PartnerInitiateTransferRequest(_Model):
    """Request parameters to initiate partner transfer.

    :ivar properties: Request parameters to initiate partner transfer.
    :vartype properties: ~azure.mgmt.billing.models.PartnerInitiateTransferProperties
    """

    properties: Optional["_models.PartnerInitiateTransferProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Request parameters to initiate partner transfer."""

    __flattened_items = ["recipient_email_id", "reseller_id"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.PartnerInitiateTransferProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class PartnerTransferDetails(ProxyResource):
    """Details of the transfer.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: Details of the transfer.
    :vartype properties: ~azure.mgmt.billing.models.PartnerTransferProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.PartnerTransferProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Details of the transfer."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    __flattened_items = [
        "expiration_time",
        "transfer_status",
        "recipient_email_id",
        "initiator_customer_type",
        "initiator_email_id",
        "reseller_id",
        "reseller_name",
        "canceled_by",
        "detailed_transfer_status",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.PartnerTransferProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class PartnerTransferProperties(_Model):
    """Transfer Details.

    :ivar expiration_time: The time at which the transfer request expires.
    :vartype expiration_time: ~datetime.datetime
    :ivar transfer_status: Overall transfer status. Known values are: "Expired", "Pending",
     "InProgress", "Completed", "CompletedWithErrors", "Failed", "Canceled", and "Declined".
    :vartype transfer_status: str or ~azure.mgmt.billing.models.TransferStatus
    :ivar recipient_email_id: The email ID of the user to whom the transfer request was sent.
    :vartype recipient_email_id: str
    :ivar initiator_customer_type: The type of customer who sent the transfer request. Known values
     are: "Partner" and "EA".
    :vartype initiator_customer_type: str or ~azure.mgmt.billing.models.InitiatorCustomerType
    :ivar initiator_email_id: The email ID of the user who sent the transfer request.
    :vartype initiator_email_id: str
    :ivar reseller_id: Optional MPN ID of the reseller for transfer requests that are sent from a
     Microsoft Partner Agreement billing account.
    :vartype reseller_id: str
    :ivar reseller_name: Optional name of the reseller for transfer requests that are sent from
     Microsoft Partner Agreement billing account.
    :vartype reseller_name: str
    :ivar canceled_by: The email ID of the user who canceled the transfer request.
    :vartype canceled_by: str
    :ivar detailed_transfer_status: Detailed transfer status.
    :vartype detailed_transfer_status: list[~azure.mgmt.billing.models.DetailedTransferStatus]
    """

    expiration_time: Optional[datetime.datetime] = rest_field(
        name="expirationTime", visibility=["read"], format="rfc3339"
    )
    """The time at which the transfer request expires."""
    transfer_status: Optional[Union[str, "_models.TransferStatus"]] = rest_field(
        name="transferStatus", visibility=["read"]
    )
    """Overall transfer status. Known values are: \"Expired\", \"Pending\", \"InProgress\",
     \"Completed\", \"CompletedWithErrors\", \"Failed\", \"Canceled\", and \"Declined\"."""
    recipient_email_id: Optional[str] = rest_field(name="recipientEmailId", visibility=["read"])
    """The email ID of the user to whom the transfer request was sent."""
    initiator_customer_type: Optional[Union[str, "_models.InitiatorCustomerType"]] = rest_field(
        name="initiatorCustomerType", visibility=["read"]
    )
    """The type of customer who sent the transfer request. Known values are: \"Partner\" and \"EA\"."""
    initiator_email_id: Optional[str] = rest_field(name="initiatorEmailId", visibility=["read"])
    """The email ID of the user who sent the transfer request."""
    reseller_id: Optional[str] = rest_field(name="resellerId", visibility=["read"])
    """Optional MPN ID of the reseller for transfer requests that are sent from a Microsoft Partner
     Agreement billing account."""
    reseller_name: Optional[str] = rest_field(name="resellerName", visibility=["read"])
    """Optional name of the reseller for transfer requests that are sent from Microsoft Partner
     Agreement billing account."""
    canceled_by: Optional[str] = rest_field(name="canceledBy", visibility=["read"])
    """The email ID of the user who canceled the transfer request."""
    detailed_transfer_status: Optional[list["_models.DetailedTransferStatus"]] = rest_field(
        name="detailedTransferStatus", visibility=["read"]
    )
    """Detailed transfer status."""


class Patch(_Model):
    """The request for reservation patch.

    :ivar properties: Properties for reservation patch.
    :vartype properties: ~azure.mgmt.billing.models.PatchProperties
    :ivar sku: The sku information associated to this reservation.
    :vartype sku: ~azure.mgmt.billing.models.ReservationSkuProperty
    :ivar tags: Tags for this reservation.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.PatchProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties for reservation patch."""
    sku: Optional["_models.ReservationSkuProperty"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The sku information associated to this reservation."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Tags for this reservation."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.PatchProperties"] = None,
        sku: Optional["_models.ReservationSkuProperty"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class PatchProperties(_Model):
    """Properties for reservation patch.

    :ivar applied_scope_type: Type of the Applied Scope. Known values are: "Single", "Shared", and
     "ManagementGroup".
    :vartype applied_scope_type: str or ~azure.mgmt.billing.models.AppliedScopeType
    :ivar applied_scope_properties: Properties specific to applied scope type. Not required if not
     applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is
     ManagementGroup.
    :vartype applied_scope_properties: ~azure.mgmt.billing.models.ReservationAppliedScopeProperties
    :ivar instance_flexibility: Turning this on will apply the reservation discount to other VMs in
     the same VM size group. Only specify for VirtualMachines reserved resource type. Known values
     are: "On" and "Off".
    :vartype instance_flexibility: str or ~azure.mgmt.billing.models.InstanceFlexibility
    :ivar display_name: Display name of the reservation.
    :vartype display_name: str
    :ivar renew: Setting this to true will automatically purchase a new benefit on the expiration
     date time.
    :vartype renew: bool
    :ivar renew_properties:
    :vartype renew_properties: ~azure.mgmt.billing.models.PatchPropertiesRenewProperties
    :ivar review_date_time: This is the date-time when the Azure hybrid benefit needs to be
     reviewed.
    :vartype review_date_time: ~datetime.datetime
    """

    applied_scope_type: Optional[Union[str, "_models.AppliedScopeType"]] = rest_field(
        name="appliedScopeType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the Applied Scope. Known values are: \"Single\", \"Shared\", and \"ManagementGroup\"."""
    applied_scope_properties: Optional["_models.ReservationAppliedScopeProperties"] = rest_field(
        name="appliedScopeProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties specific to applied scope type. Not required if not applicable. Required and need to
     provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup."""
    instance_flexibility: Optional[Union[str, "_models.InstanceFlexibility"]] = rest_field(
        name="instanceFlexibility", visibility=["read", "create", "update", "delete", "query"]
    )
    """Turning this on will apply the reservation discount to other VMs in the same VM size group.
     Only specify for VirtualMachines reserved resource type. Known values are: \"On\" and \"Off\"."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name of the reservation."""
    renew: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Setting this to true will automatically purchase a new benefit on the expiration date time."""
    renew_properties: Optional["_models.PatchPropertiesRenewProperties"] = rest_field(
        name="renewProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    review_date_time: Optional[datetime.datetime] = rest_field(
        name="reviewDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """This is the date-time when the Azure hybrid benefit needs to be reviewed."""

    __flattened_items = ["purchase_properties"]

    @overload
    def __init__(
        self,
        *,
        applied_scope_type: Optional[Union[str, "_models.AppliedScopeType"]] = None,
        applied_scope_properties: Optional["_models.ReservationAppliedScopeProperties"] = None,
        instance_flexibility: Optional[Union[str, "_models.InstanceFlexibility"]] = None,
        display_name: Optional[str] = None,
        renew: Optional[bool] = None,
        renew_properties: Optional["_models.PatchPropertiesRenewProperties"] = None,
        review_date_time: Optional[datetime.datetime] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.renew_properties is None:
                return None
            return getattr(self.renew_properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.renew_properties is None:
                self.renew_properties = self._attr_to_rest_field["renew_properties"]._class_type()
            setattr(self.renew_properties, key, value)
        else:
            super().__setattr__(key, value)


class PatchPropertiesRenewProperties(_Model):
    """PatchPropertiesRenewProperties.

    :ivar purchase_properties: The request for reservation purchase.
    :vartype purchase_properties: ~azure.mgmt.billing.models.ReservationPurchaseRequest
    """

    purchase_properties: Optional["_models.ReservationPurchaseRequest"] = rest_field(
        name="purchaseProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """The request for reservation purchase."""

    @overload
    def __init__(
        self,
        *,
        purchase_properties: Optional["_models.ReservationPurchaseRequest"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class Payment(_Model):
    """An invoice payment.

    :ivar amount: The paid amount.
    :vartype amount: ~azure.mgmt.billing.models.PaymentAmount
    :ivar date: The date when the payment was made.
    :vartype date: ~datetime.datetime
    :ivar payment_method_id: The ID that uniquely identifies the payment method used for the
     invoice.
    :vartype payment_method_id: str
    :ivar payment_method_family: The family of payment method. Known values are: "Other", "None",
     "CreditCard", "Credits", "CheckWire", "EWallet", "TaskOrder", and "DirectDebit".
    :vartype payment_method_family: str or ~azure.mgmt.billing.models.PaymentMethodFamily
    :ivar payment_method_type: The type of payment method.
    :vartype payment_method_type: str
    :ivar payment_type: The type of payment.
    :vartype payment_type: str
    """

    amount: Optional["_models.PaymentAmount"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The paid amount."""
    date: Optional[datetime.datetime] = rest_field(visibility=["read"], format="rfc3339")
    """The date when the payment was made."""
    payment_method_id: Optional[str] = rest_field(name="paymentMethodId", visibility=["read"])
    """The ID that uniquely identifies the payment method used for the invoice."""
    payment_method_family: Optional[Union[str, "_models.PaymentMethodFamily"]] = rest_field(
        name="paymentMethodFamily", visibility=["read"]
    )
    """The family of payment method. Known values are: \"Other\", \"None\", \"CreditCard\",
     \"Credits\", \"CheckWire\", \"EWallet\", \"TaskOrder\", and \"DirectDebit\"."""
    payment_method_type: Optional[str] = rest_field(name="paymentMethodType", visibility=["read"])
    """The type of payment method."""
    payment_type: Optional[str] = rest_field(name="paymentType", visibility=["read"])
    """The type of payment."""

    @overload
    def __init__(
        self,
        *,
        amount: Optional["_models.PaymentAmount"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class PaymentAmount(Amount):
    """The paid amount.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class PaymentDetail(_Model):
    """Information about payment related to a savings plan order.

    :ivar due_date: Date when the payment needs to be done.
    :vartype due_date: ~datetime.date
    :ivar payment_date: Date when the transaction is completed. Null when it is scheduled.
    :vartype payment_date: ~datetime.date
    :ivar pricing_currency_total: Amount in pricing currency. Tax not included.
    :vartype pricing_currency_total: ~azure.mgmt.billing.models.Price
    :ivar billing_currency_total: Amount charged in Billing currency. Tax not included. Is null for
     future payments.
    :vartype billing_currency_total: ~azure.mgmt.billing.models.Price
    :ivar status: Describes whether the payment is completed, failed, pending, cancelled or
     scheduled in the future. Known values are: "Succeeded", "Failed", "Scheduled", "Cancelled",
     "Completed", and "Pending".
    :vartype status: str or ~azure.mgmt.billing.models.PaymentStatus
    :ivar extended_status_info: Extended status information.
    :vartype extended_status_info: ~azure.mgmt.billing.models.ExtendedStatusInfo
    """

    due_date: Optional[datetime.date] = rest_field(
        name="dueDate", visibility=["read", "create", "update", "delete", "query"]
    )
    """Date when the payment needs to be done."""
    payment_date: Optional[datetime.date] = rest_field(
        name="paymentDate", visibility=["read", "create", "update", "delete", "query"]
    )
    """Date when the transaction is completed. Null when it is scheduled."""
    pricing_currency_total: Optional["_models.Price"] = rest_field(
        name="pricingCurrencyTotal", visibility=["read", "create", "update", "delete", "query"]
    )
    """Amount in pricing currency. Tax not included."""
    billing_currency_total: Optional["_models.Price"] = rest_field(
        name="billingCurrencyTotal", visibility=["read", "create", "update", "delete", "query"]
    )
    """Amount charged in Billing currency. Tax not included. Is null for future payments."""
    status: Optional[Union[str, "_models.PaymentStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes whether the payment is completed, failed, pending, cancelled or scheduled in the
     future. Known values are: \"Succeeded\", \"Failed\", \"Scheduled\", \"Cancelled\",
     \"Completed\", and \"Pending\"."""
    extended_status_info: Optional["_models.ExtendedStatusInfo"] = rest_field(
        name="extendedStatusInfo", visibility=["read"]
    )
    """Extended status information."""

    @overload
    def __init__(
        self,
        *,
        due_date: Optional[datetime.date] = None,
        payment_date: Optional[datetime.date] = None,
        pricing_currency_total: Optional["_models.Price"] = None,
        billing_currency_total: Optional["_models.Price"] = None,
        status: Optional[Union[str, "_models.PaymentStatus"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class PaymentMethod(ProxyResource):
    """A payment method.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: Payment method properties.
    :vartype properties: ~azure.mgmt.billing.models.PaymentMethodProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.PaymentMethodProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Payment method properties."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    __flattened_items = [
        "id",
        "account_holder_name",
        "display_name",
        "expiration",
        "family",
        "last_four_digits",
        "logos",
        "payment_method_type",
        "status",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.PaymentMethodProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class PaymentMethodLink(ProxyResource):
    """A payment method link.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: Payment method link properties.
    :vartype properties: ~azure.mgmt.billing.models.PaymentMethodLinkProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.PaymentMethodLinkProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Payment method link properties."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    __flattened_items = [
        "account_holder_name",
        "display_name",
        "expiration",
        "family",
        "last_four_digits",
        "logos",
        "payment_method",
        "payment_method_id",
        "payment_method_type",
        "status",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.PaymentMethodLinkProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class PaymentMethodLinkProperties(_Model):
    """The properties of a payment method link.

    :ivar account_holder_name: The account holder name for the payment method. This is only
     supported for payment methods with family CreditCard.
    :vartype account_holder_name: str
    :ivar display_name: The display name of the payment method.
    :vartype display_name: str
    :ivar expiration: The expiration month and year of the payment method. This is only supported
     for payment methods with family CreditCard.
    :vartype expiration: str
    :ivar family: The family of payment method. Known values are: "Other", "None", "CreditCard",
     "Credits", "CheckWire", "EWallet", "TaskOrder", and "DirectDebit".
    :vartype family: str or ~azure.mgmt.billing.models.PaymentMethodFamily
    :ivar last_four_digits: Last four digits of payment method.
    :vartype last_four_digits: str
    :ivar logos: The list of logos for the payment method.
    :vartype logos: list[~azure.mgmt.billing.models.PaymentMethodLogo]
    :ivar payment_method: Projection of a payment method. Will not be returned in this or future
     versions.
    :vartype payment_method: ~azure.mgmt.billing.models.PaymentMethodProperties
    :ivar payment_method_id: Id of payment method. Example:
     /providers/Microsoft.Billing/paymentMethods/ABCDABCDABC0.
    :vartype payment_method_id: str
    :ivar payment_method_type: The type of payment method.
    :vartype payment_method_type: str
    :ivar status: Status of the payment method. Known values are: "active" and "inactive".
    :vartype status: str or ~azure.mgmt.billing.models.PaymentMethodStatus
    """

    account_holder_name: Optional[str] = rest_field(name="accountHolderName", visibility=["read"])
    """The account holder name for the payment method. This is only supported for payment methods with
     family CreditCard."""
    display_name: Optional[str] = rest_field(name="displayName", visibility=["read"])
    """The display name of the payment method."""
    expiration: Optional[str] = rest_field(visibility=["read"])
    """The expiration month and year of the payment method. This is only supported for payment methods
     with family CreditCard."""
    family: Optional[Union[str, "_models.PaymentMethodFamily"]] = rest_field(visibility=["read"])
    """The family of payment method. Known values are: \"Other\", \"None\", \"CreditCard\",
     \"Credits\", \"CheckWire\", \"EWallet\", \"TaskOrder\", and \"DirectDebit\"."""
    last_four_digits: Optional[str] = rest_field(name="lastFourDigits", visibility=["read"])
    """Last four digits of payment method."""
    logos: Optional[list["_models.PaymentMethodLogo"]] = rest_field(visibility=["read"])
    """The list of logos for the payment method."""
    payment_method: Optional["_models.PaymentMethodProperties"] = rest_field(
        name="paymentMethod", visibility=["read", "create", "update", "delete", "query"]
    )
    """Projection of a payment method. Will not be returned in this or future versions."""
    payment_method_id: Optional[str] = rest_field(
        name="paymentMethodId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Id of payment method. Example: /providers/Microsoft.Billing/paymentMethods/ABCDABCDABC0."""
    payment_method_type: Optional[str] = rest_field(name="paymentMethodType", visibility=["read"])
    """The type of payment method."""
    status: Optional[Union[str, "_models.PaymentMethodStatus"]] = rest_field(visibility=["read"])
    """Status of the payment method. Known values are: \"active\" and \"inactive\"."""

    @overload
    def __init__(
        self,
        *,
        payment_method: Optional["_models.PaymentMethodProperties"] = None,
        payment_method_id: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class PaymentMethodLogo(_Model):
    """Logo of payment method.

    :ivar mime_type: MIME type of the logo.
    :vartype mime_type: str
    :ivar url: Public URL of image of the logo.
    :vartype url: str
    """

    mime_type: Optional[str] = rest_field(name="mimeType", visibility=["read"])
    """MIME type of the logo."""
    url: Optional[str] = rest_field(visibility=["read"])
    """Public URL of image of the logo."""


class PaymentMethodProperties(_Model):
    """The properties of a payment method.

    :ivar id: Id of payment method.
    :vartype id: str
    :ivar account_holder_name: The account holder name for the payment method. This is only
     supported for payment methods with family CreditCard.
    :vartype account_holder_name: str
    :ivar display_name: The display name of the payment method.
    :vartype display_name: str
    :ivar expiration: The expiration month and year of the payment method. This is only supported
     for payment methods with family CreditCard.
    :vartype expiration: str
    :ivar family: The family of payment method. Known values are: "Other", "None", "CreditCard",
     "Credits", "CheckWire", "EWallet", "TaskOrder", and "DirectDebit".
    :vartype family: str or ~azure.mgmt.billing.models.PaymentMethodFamily
    :ivar last_four_digits: Last four digits of payment method.
    :vartype last_four_digits: str
    :ivar logos: The list of logos for the payment method.
    :vartype logos: list[~azure.mgmt.billing.models.PaymentMethodLogo]
    :ivar payment_method_type: The type of payment method.
    :vartype payment_method_type: str
    :ivar status: Status of the payment method. Known values are: "active" and "inactive".
    :vartype status: str or ~azure.mgmt.billing.models.PaymentMethodStatus
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Id of payment method."""
    account_holder_name: Optional[str] = rest_field(name="accountHolderName", visibility=["read"])
    """The account holder name for the payment method. This is only supported for payment methods with
     family CreditCard."""
    display_name: Optional[str] = rest_field(name="displayName", visibility=["read"])
    """The display name of the payment method."""
    expiration: Optional[str] = rest_field(visibility=["read"])
    """The expiration month and year of the payment method. This is only supported for payment methods
     with family CreditCard."""
    family: Optional[Union[str, "_models.PaymentMethodFamily"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The family of payment method. Known values are: \"Other\", \"None\", \"CreditCard\",
     \"Credits\", \"CheckWire\", \"EWallet\", \"TaskOrder\", and \"DirectDebit\"."""
    last_four_digits: Optional[str] = rest_field(name="lastFourDigits", visibility=["read"])
    """Last four digits of payment method."""
    logos: Optional[list["_models.PaymentMethodLogo"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of logos for the payment method."""
    payment_method_type: Optional[str] = rest_field(name="paymentMethodType", visibility=["read"])
    """The type of payment method."""
    status: Optional[Union[str, "_models.PaymentMethodStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Status of the payment method. Known values are: \"active\" and \"inactive\"."""

    @overload
    def __init__(
        self,
        *,
        family: Optional[Union[str, "_models.PaymentMethodFamily"]] = None,
        logos: Optional[list["_models.PaymentMethodLogo"]] = None,
        status: Optional[Union[str, "_models.PaymentMethodStatus"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class PaymentOnAccount(_Model):
    """A Payment on Account.

    :ivar amount: Payment on Account amount.
    :vartype amount: ~azure.mgmt.billing.models.PaymentOnAccountAmount
    :ivar billing_profile_id: The ID of the billing profile for the payments on account.
    :vartype billing_profile_id: str
    :ivar billing_profile_display_name: The name of the billing profile for the payments on
     account.
    :vartype billing_profile_display_name: str
    :ivar invoice_id: The ID of the invoice for which the payments on account was generated.
    :vartype invoice_id: str
    :ivar invoice_name: The name of the invoice for the payments on account.
    :vartype invoice_name: str
    :ivar date: The date of the payments on account.
    :vartype date: ~datetime.datetime
    :ivar payment_method_type: Payment on Account type. Known values are: "Other", "None",
     "CreditCard", "Credits", "CheckWire", "EWallet", "TaskOrder", and "DirectDebit".
    :vartype payment_method_type: str or ~azure.mgmt.billing.models.PaymentMethodFamily
    """

    amount: Optional["_models.PaymentOnAccountAmount"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Payment on Account amount."""
    billing_profile_id: Optional[str] = rest_field(name="billingProfileId", visibility=["read"])
    """The ID of the billing profile for the payments on account."""
    billing_profile_display_name: Optional[str] = rest_field(name="billingProfileDisplayName", visibility=["read"])
    """The name of the billing profile for the payments on account."""
    invoice_id: Optional[str] = rest_field(name="invoiceId", visibility=["read"])
    """The ID of the invoice for which the payments on account was generated."""
    invoice_name: Optional[str] = rest_field(name="invoiceName", visibility=["read"])
    """The name of the invoice for the payments on account."""
    date: Optional[datetime.datetime] = rest_field(visibility=["read"], format="rfc3339")
    """The date of the payments on account."""
    payment_method_type: Optional[Union[str, "_models.PaymentMethodFamily"]] = rest_field(
        name="paymentMethodType", visibility=["read"]
    )
    """Payment on Account type. Known values are: \"Other\", \"None\", \"CreditCard\", \"Credits\",
     \"CheckWire\", \"EWallet\", \"TaskOrder\", and \"DirectDebit\"."""

    @overload
    def __init__(
        self,
        *,
        amount: Optional["_models.PaymentOnAccountAmount"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class PaymentOnAccountAmount(Amount):
    """Payment on Account amount.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class PaymentTermsEligibilityDetail(_Model):
    """Details of the payment terms eligibility.

    :ivar code: Indicates the reason for the ineligibility of the payment terms. Known values are:
     "Other", "OverlappingPaymentTerms", "InvalidDateFormat", "InvalidDateRange",
     "InactiveBillingAccount", "InvalidBillingAccountType", "NullOrEmptyPaymentTerms",
     "BillingAccountNotFound", "IneligibleBillingAccountStatus", and "InvalidTerms".
    :vartype code: str or ~azure.mgmt.billing.models.PaymentTermsEligibilityCode
    :ivar message: Indicates the message for the ineligibility of the payment terms.
    :vartype message: str
    """

    code: Optional[Union[str, "_models.PaymentTermsEligibilityCode"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates the reason for the ineligibility of the payment terms. Known values are: \"Other\",
     \"OverlappingPaymentTerms\", \"InvalidDateFormat\", \"InvalidDateRange\",
     \"InactiveBillingAccount\", \"InvalidBillingAccountType\", \"NullOrEmptyPaymentTerms\",
     \"BillingAccountNotFound\", \"IneligibleBillingAccountStatus\", and \"InvalidTerms\"."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Indicates the message for the ineligibility of the payment terms."""

    @overload
    def __init__(
        self,
        *,
        code: Optional[Union[str, "_models.PaymentTermsEligibilityCode"]] = None,
        message: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class PaymentTermsEligibilityResult(_Model):
    """Result of the payment terms eligibility.

    :ivar eligibility_status: Indicates the eligibility status of the payment terms. Known values
     are: "Other", "Valid", and "Invalid".
    :vartype eligibility_status: str or ~azure.mgmt.billing.models.PaymentTermsEligibilityStatus
    :ivar eligibility_details: Details of the payment terms eligibility.
    :vartype eligibility_details: list[~azure.mgmt.billing.models.PaymentTermsEligibilityDetail]
    """

    eligibility_status: Optional[Union[str, "_models.PaymentTermsEligibilityStatus"]] = rest_field(
        name="eligibilityStatus", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates the eligibility status of the payment terms. Known values are: \"Other\", \"Valid\",
     and \"Invalid\"."""
    eligibility_details: Optional[list["_models.PaymentTermsEligibilityDetail"]] = rest_field(
        name="eligibilityDetails", visibility=["read", "create", "update", "delete", "query"]
    )
    """Details of the payment terms eligibility."""

    @overload
    def __init__(
        self,
        *,
        eligibility_status: Optional[Union[str, "_models.PaymentTermsEligibilityStatus"]] = None,
        eligibility_details: Optional[list["_models.PaymentTermsEligibilityDetail"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class PolicySummary(_Model):
    """The summary of the policy.

    :ivar name: The name of the policy.
    :vartype name: str
    :ivar value: The value of the policy.
    :vartype value: str
    :ivar policy_type: The type of the policy. Known values are: "Other", "UserControlled", and
     "SystemControlled".
    :vartype policy_type: str or ~azure.mgmt.billing.models.PolicyType
    :ivar scope: The scope at which the policy is defined.
    :vartype scope: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the policy."""
    value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The value of the policy."""
    policy_type: Optional[Union[str, "_models.PolicyType"]] = rest_field(
        name="policyType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of the policy. Known values are: \"Other\", \"UserControlled\", and
     \"SystemControlled\"."""
    scope: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The scope at which the policy is defined."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        value: Optional[str] = None,
        policy_type: Optional[Union[str, "_models.PolicyType"]] = None,
        scope: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class Product(ProxyResource):
    """A product.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: A product.
    :vartype properties: ~azure.mgmt.billing.models.ProductProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.ProductProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A product."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ProductProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ProductDetails(_Model):
    """Details of the product that is transferred.

    :ivar product_type: Type of the product that is transferred. Known values are:
     "AzureSubscription", "AzureReservation", "Department", "SavingsPlan", and "SAAS".
    :vartype product_type: str or ~azure.mgmt.billing.models.ProductType
    :ivar product_id: The ID of the product that is transferred.
    :vartype product_id: str
    """

    product_type: Optional[Union[str, "_models.ProductType"]] = rest_field(
        name="productType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the product that is transferred. Known values are: \"AzureSubscription\",
     \"AzureReservation\", \"Department\", \"SavingsPlan\", and \"SAAS\"."""
    product_id: Optional[str] = rest_field(name="productId", visibility=["read", "create", "update", "delete", "query"])
    """The ID of the product that is transferred."""

    @overload
    def __init__(
        self,
        *,
        product_type: Optional[Union[str, "_models.ProductType"]] = None,
        product_id: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ProductPatch(ProxyResourceWithTags):
    """A product.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    :ivar properties: A product.
    :vartype properties: ~azure.mgmt.billing.models.ProductProperties
    """

    properties: Optional["_models.ProductProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A product."""

    @overload
    def __init__(
        self,
        *,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.ProductProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ProductProperties(_Model):
    """A product.

    :ivar auto_renew: Indicates whether auto renewal is turned on or off for a product. Known
     values are: "Off" and "On".
    :vartype auto_renew: str or ~azure.mgmt.billing.models.AutoRenew
    :ivar availability_id: The availability of the product.
    :vartype availability_id: str
    :ivar billing_frequency: The frequency at which the product will be billed.
    :vartype billing_frequency: str
    :ivar billing_profile_id: The ID of the billing profile to which the product is billed.
    :vartype billing_profile_id: str
    :ivar billing_profile_display_name: The name of the billing profile to which the product is
     billed.
    :vartype billing_profile_display_name: str
    :ivar customer_id: The ID of the customer for whom the product was purchased. The field is
     applicable only for Microsoft Partner Agreement billing account.
    :vartype customer_id: str
    :ivar customer_display_name: The name of the customer for whom the product was purchased. The
     field is applicable only for Microsoft Partner Agreement billing account.
    :vartype customer_display_name: str
    :ivar display_name: The display name of the product.
    :vartype display_name: str
    :ivar end_date: The date when the product will be renewed or canceled.
    :vartype end_date: str
    :ivar invoice_section_id: The ID of the invoice section to which the product is billed.
    :vartype invoice_section_id: str
    :ivar invoice_section_display_name: The name of the invoice section to which the product is
     billed.
    :vartype invoice_section_display_name: str
    :ivar last_charge: The last month charges.
    :vartype last_charge: ~azure.mgmt.billing.models.ProductPropertiesLastCharge
    :ivar last_charge_date: The date of the last charge.
    :vartype last_charge_date: str
    :ivar product_type: The description of the type of product.
    :vartype product_type: str
    :ivar product_type_id: The ID of the type of product.
    :vartype product_type_id: str
    :ivar sku_id: The sku ID of the product.
    :vartype sku_id: str
    :ivar sku_description: The sku description of the product.
    :vartype sku_description: str
    :ivar purchase_date: The date when the product was purchased.
    :vartype purchase_date: str
    :ivar quantity: The quantity purchased for the product.
    :vartype quantity: int
    :ivar status: The status of the product. Known values are: "Other", "Active", "Disabled",
     "Deleted", "PastDue", "Expiring", "Expired", "AutoRenew", "Canceled", and "Suspended".
    :vartype status: str or ~azure.mgmt.billing.models.ProductStatus
    :ivar tenant_id: The id of the tenant in which the product is used.
    :vartype tenant_id: str
    :ivar reseller: Reseller for this product. The fields is not available for Microsoft Partner
     Agreement products.
    :vartype reseller: ~azure.mgmt.billing.models.ProductPropertiesReseller
    """

    auto_renew: Optional[Union[str, "_models.AutoRenew"]] = rest_field(
        name="autoRenew", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates whether auto renewal is turned on or off for a product. Known values are: \"Off\" and
     \"On\"."""
    availability_id: Optional[str] = rest_field(name="availabilityId", visibility=["read"])
    """The availability of the product."""
    billing_frequency: Optional[str] = rest_field(name="billingFrequency", visibility=["read"])
    """The frequency at which the product will be billed."""
    billing_profile_id: Optional[str] = rest_field(name="billingProfileId", visibility=["read"])
    """The ID of the billing profile to which the product is billed."""
    billing_profile_display_name: Optional[str] = rest_field(name="billingProfileDisplayName", visibility=["read"])
    """The name of the billing profile to which the product is billed."""
    customer_id: Optional[str] = rest_field(name="customerId", visibility=["read"])
    """The ID of the customer for whom the product was purchased. The field is applicable only for
     Microsoft Partner Agreement billing account."""
    customer_display_name: Optional[str] = rest_field(name="customerDisplayName", visibility=["read"])
    """The name of the customer for whom the product was purchased. The field is applicable only for
     Microsoft Partner Agreement billing account."""
    display_name: Optional[str] = rest_field(name="displayName", visibility=["read"])
    """The display name of the product."""
    end_date: Optional[str] = rest_field(name="endDate", visibility=["read"])
    """The date when the product will be renewed or canceled."""
    invoice_section_id: Optional[str] = rest_field(name="invoiceSectionId", visibility=["read"])
    """The ID of the invoice section to which the product is billed."""
    invoice_section_display_name: Optional[str] = rest_field(name="invoiceSectionDisplayName", visibility=["read"])
    """The name of the invoice section to which the product is billed."""
    last_charge: Optional["_models.ProductPropertiesLastCharge"] = rest_field(
        name="lastCharge", visibility=["read", "create", "update", "delete", "query"]
    )
    """The last month charges."""
    last_charge_date: Optional[str] = rest_field(name="lastChargeDate", visibility=["read"])
    """The date of the last charge."""
    product_type: Optional[str] = rest_field(name="productType", visibility=["read"])
    """The description of the type of product."""
    product_type_id: Optional[str] = rest_field(name="productTypeId", visibility=["read"])
    """The ID of the type of product."""
    sku_id: Optional[str] = rest_field(name="skuId", visibility=["read"])
    """The sku ID of the product."""
    sku_description: Optional[str] = rest_field(name="skuDescription", visibility=["read"])
    """The sku description of the product."""
    purchase_date: Optional[str] = rest_field(name="purchaseDate", visibility=["read"])
    """The date when the product was purchased."""
    quantity: Optional[int] = rest_field(visibility=["read"])
    """The quantity purchased for the product."""
    status: Optional[Union[str, "_models.ProductStatus"]] = rest_field(visibility=["read"])
    """The status of the product. Known values are: \"Other\", \"Active\", \"Disabled\", \"Deleted\",
     \"PastDue\", \"Expiring\", \"Expired\", \"AutoRenew\", \"Canceled\", and \"Suspended\"."""
    tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"])
    """The id of the tenant in which the product is used."""
    reseller: Optional["_models.ProductPropertiesReseller"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Reseller for this product. The fields is not available for Microsoft Partner Agreement
     products."""

    @overload
    def __init__(
        self,
        *,
        auto_renew: Optional[Union[str, "_models.AutoRenew"]] = None,
        last_charge: Optional["_models.ProductPropertiesLastCharge"] = None,
        reseller: Optional["_models.ProductPropertiesReseller"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ProductPropertiesLastCharge(Amount):
    """The last month charges.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class Reseller(_Model):
    """Details of the reseller.

    :ivar reseller_id: The MPN ID of the reseller.
    :vartype reseller_id: str
    :ivar description: The name of the reseller.
    :vartype description: str
    """

    reseller_id: Optional[str] = rest_field(name="resellerId", visibility=["read"])
    """The MPN ID of the reseller."""
    description: Optional[str] = rest_field(visibility=["read"])
    """The name of the reseller."""


class ProductPropertiesReseller(Reseller):
    """Reseller for this product. The fields is not available for Microsoft Partner Agreement
    products.

    :ivar reseller_id: The MPN ID of the reseller.
    :vartype reseller_id: str
    :ivar description: The name of the reseller.
    :vartype description: str
    """


class PurchaseRequest(_Model):
    """Purchase request.

    :ivar sku: The SKU to be applied for this resource.
    :vartype sku: ~azure.mgmt.billing.models.Sku
    :ivar properties: Purchase request properties.
    :vartype properties: ~azure.mgmt.billing.models.PurchaseRequestProperties
    """

    sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The SKU to be applied for this resource."""
    properties: Optional["_models.PurchaseRequestProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Purchase request properties."""

    __flattened_items = [
        "display_name",
        "billing_scope_id",
        "term",
        "billing_plan",
        "applied_scope_type",
        "commitment",
        "renew",
        "applied_scope_properties",
    ]

    @overload
    def __init__(
        self,
        *,
        sku: Optional["_models.Sku"] = None,
        properties: Optional["_models.PurchaseRequestProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class PurchaseRequestProperties(_Model):
    """Purchase request properties.

    :ivar display_name: Friendly name of the savings plan.
    :vartype display_name: str
    :ivar billing_scope_id: Subscription that will be charged for purchasing SavingsPlan.
    :vartype billing_scope_id: str
    :ivar term: Represents the Savings plan term in ISO 8601 format. Known values are: "P1Y",
     "P3Y", and "P5Y".
    :vartype term: str or ~azure.mgmt.billing.models.SavingsPlanTerm
    :ivar billing_plan: Represents the billing plan in ISO 8601 format. Required only for monthly
     purchases. "P1M"
    :vartype billing_plan: str or ~azure.mgmt.billing.models.BillingPlan
    :ivar applied_scope_type: Type of the Applied Scope. Known values are: "Single", "Shared", and
     "ManagementGroup".
    :vartype applied_scope_type: str or ~azure.mgmt.billing.models.AppliedScopeType
    :ivar commitment: Commitment towards the benefit.
    :vartype commitment: ~azure.mgmt.billing.models.Commitment
    :ivar renew: Setting this to true will automatically purchase a new benefit on the expiration
     date time.
    :vartype renew: bool
    :ivar applied_scope_properties: Properties specific to applied scope type. Not required if not
     applicable.
    :vartype applied_scope_properties: ~azure.mgmt.billing.models.AppliedScopeProperties
    """

    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Friendly name of the savings plan."""
    billing_scope_id: Optional[str] = rest_field(
        name="billingScopeId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Subscription that will be charged for purchasing SavingsPlan."""
    term: Optional[Union[str, "_models.SavingsPlanTerm"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Represents the Savings plan term in ISO 8601 format. Known values are: \"P1Y\", \"P3Y\", and
     \"P5Y\"."""
    billing_plan: Optional[Union[str, "_models.BillingPlan"]] = rest_field(
        name="billingPlan", visibility=["read", "create", "update", "delete", "query"]
    )
    """Represents the billing plan in ISO 8601 format. Required only for monthly purchases. \"P1M\""""
    applied_scope_type: Optional[Union[str, "_models.AppliedScopeType"]] = rest_field(
        name="appliedScopeType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the Applied Scope. Known values are: \"Single\", \"Shared\", and \"ManagementGroup\"."""
    commitment: Optional["_models.Commitment"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Commitment towards the benefit."""
    renew: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Setting this to true will automatically purchase a new benefit on the expiration date time."""
    applied_scope_properties: Optional["_models.AppliedScopeProperties"] = rest_field(
        name="appliedScopeProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties specific to applied scope type. Not required if not applicable."""

    @overload
    def __init__(
        self,
        *,
        display_name: Optional[str] = None,
        billing_scope_id: Optional[str] = None,
        term: Optional[Union[str, "_models.SavingsPlanTerm"]] = None,
        billing_plan: Optional[Union[str, "_models.BillingPlan"]] = None,
        applied_scope_type: Optional[Union[str, "_models.AppliedScopeType"]] = None,
        commitment: Optional["_models.Commitment"] = None,
        renew: Optional[bool] = None,
        applied_scope_properties: Optional["_models.AppliedScopeProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class RecipientTransferDetails(ProxyResource):
    """Details of the transfer.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: Details of the transfer.
    :vartype properties: ~azure.mgmt.billing.models.RecipientTransferProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.RecipientTransferProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Details of the transfer."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    __flattened_items = [
        "expiration_time",
        "allowed_product_type",
        "transfer_status",
        "recipient_email_id",
        "initiator_email_id",
        "reseller_id",
        "reseller_name",
        "initiator_customer_type",
        "canceled_by",
        "detailed_transfer_status",
        "customer_tenant_id",
        "supported_accounts",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.RecipientTransferProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class RecipientTransferProperties(_Model):
    """Transfer Details.

    :ivar expiration_time: The time at which the transfer request expires.
    :vartype expiration_time: ~datetime.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. Known values are: "Expired", "Pending",
     "InProgress", "Completed", "CompletedWithErrors", "Failed", "Canceled", and "Declined".
    :vartype transfer_status: str or ~azure.mgmt.billing.models.TransferStatus
    :ivar recipient_email_id: The email ID of the user to whom the transfer request was sent.
    :vartype recipient_email_id: str
    :ivar initiator_email_id: The email ID of the user who sent the transfer request.
    :vartype initiator_email_id: str
    :ivar reseller_id: Optional MPN ID of the reseller for transfer requests that are sent from a
     Microsoft Partner Agreement billing account.
    :vartype reseller_id: str
    :ivar reseller_name: Optional name of the reseller for transfer requests that are sent from
     Microsoft Partner Agreement billing account.
    :vartype reseller_name: str
    :ivar initiator_customer_type: The type of customer who sent the transfer request. Known values
     are: "Partner" and "EA".
    :vartype initiator_customer_type: str or ~azure.mgmt.billing.models.InitiatorCustomerType
    :ivar canceled_by: The email ID of the user who canceled the transfer request.
    :vartype canceled_by: str
    :ivar detailed_transfer_status: Detailed transfer status.
    :vartype detailed_transfer_status: list[~azure.mgmt.billing.models.DetailedTransferStatus]
    :ivar customer_tenant_id: The customer tenant id.
    :vartype customer_tenant_id: str
    :ivar supported_accounts: List of supported account types.
    :vartype supported_accounts: list[str or ~azure.mgmt.billing.models.SupportedAccountType]
    """

    expiration_time: Optional[datetime.datetime] = rest_field(
        name="expirationTime", visibility=["read"], format="rfc3339"
    )
    """The time at which the transfer request expires."""
    allowed_product_type: Optional[list[Union[str, "_models.EligibleProductType"]]] = rest_field(
        name="allowedProductType", visibility=["read"]
    )
    """Type of subscriptions that can be transferred."""
    transfer_status: Optional[Union[str, "_models.TransferStatus"]] = rest_field(
        name="transferStatus", visibility=["read"]
    )
    """Overall transfer status. Known values are: \"Expired\", \"Pending\", \"InProgress\",
     \"Completed\", \"CompletedWithErrors\", \"Failed\", \"Canceled\", and \"Declined\"."""
    recipient_email_id: Optional[str] = rest_field(name="recipientEmailId", visibility=["read"])
    """The email ID of the user to whom the transfer request was sent."""
    initiator_email_id: Optional[str] = rest_field(name="initiatorEmailId", visibility=["read"])
    """The email ID of the user who sent the transfer request."""
    reseller_id: Optional[str] = rest_field(name="resellerId", visibility=["read"])
    """Optional MPN ID of the reseller for transfer requests that are sent from a Microsoft Partner
     Agreement billing account."""
    reseller_name: Optional[str] = rest_field(name="resellerName", visibility=["read"])
    """Optional name of the reseller for transfer requests that are sent from Microsoft Partner
     Agreement billing account."""
    initiator_customer_type: Optional[Union[str, "_models.InitiatorCustomerType"]] = rest_field(
        name="initiatorCustomerType", visibility=["read"]
    )
    """The type of customer who sent the transfer request. Known values are: \"Partner\" and \"EA\"."""
    canceled_by: Optional[str] = rest_field(name="canceledBy", visibility=["read"])
    """The email ID of the user who canceled the transfer request."""
    detailed_transfer_status: Optional[list["_models.DetailedTransferStatus"]] = rest_field(
        name="detailedTransferStatus", visibility=["read"]
    )
    """Detailed transfer status."""
    customer_tenant_id: Optional[str] = rest_field(name="customerTenantId", visibility=["read"])
    """The customer tenant id."""
    supported_accounts: Optional[list[Union[str, "_models.SupportedAccountType"]]] = rest_field(
        name="supportedAccounts", visibility=["read"]
    )
    """List of supported account types."""


class RefundDetailsSummaryAmountRefunded(Amount):
    """The amount refunded.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class RefundDetailsSummaryAmountRequested(Amount):
    """The amount of refund requested.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class RefundTransactionDetails(_Model):
    """The refund details of a transaction.

    :ivar amount_requested: The amount of refund requested.
    :vartype amount_requested: ~azure.mgmt.billing.models.RefundTransactionDetailsAmountRequested
    :ivar amount_refunded: The amount refunded.
    :vartype amount_refunded: ~azure.mgmt.billing.models.RefundTransactionDetailsAmountRefunded
    :ivar refund_operation_id: The ID of refund operation.
    :vartype refund_operation_id: str
    """

    amount_requested: Optional["_models.RefundTransactionDetailsAmountRequested"] = rest_field(
        name="amountRequested", visibility=["read", "create", "update", "delete", "query"]
    )
    """The amount of refund requested."""
    amount_refunded: Optional["_models.RefundTransactionDetailsAmountRefunded"] = rest_field(
        name="amountRefunded", visibility=["read", "create", "update", "delete", "query"]
    )
    """The amount refunded."""
    refund_operation_id: Optional[str] = rest_field(
        name="refundOperationId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The ID of refund operation."""

    @overload
    def __init__(
        self,
        *,
        amount_requested: Optional["_models.RefundTransactionDetailsAmountRequested"] = None,
        amount_refunded: Optional["_models.RefundTransactionDetailsAmountRefunded"] = None,
        refund_operation_id: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class RefundTransactionDetailsAmountRefunded(Amount):
    """The amount refunded.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class RefundTransactionDetailsAmountRequested(Amount):
    """The amount of refund requested.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class RenewalTermDetails(_Model):
    """Details for the next renewal term of a subscription.

    :ivar billing_frequency: The billing frequency in ISO8601 format of product in the
     subscription. Example: P1M, P3M, P1Y.
    :vartype billing_frequency: str
    :ivar product_id: Id of the product for which the subscription is purchased.
    :vartype product_id: str
    :ivar product_type_id: Type Id of the product for which the subscription is purchased.
    :vartype product_type_id: str
    :ivar sku_id: The SKU ID of the product for which the subscription is purchased. This field is
     is only available  for Microsoft Customer Agreement billing accounts.
    :vartype sku_id: str
    :ivar term_duration: The duration in ISO8601 format for which you can use the subscription.
     Example: P1M, P3M, P1Y.
    :vartype term_duration: str
    :ivar quantity: The quantity of licenses or fulfillment units for the subscription.
    :vartype quantity: int
    :ivar term_end_date: End date of the term in UTC time.
    :vartype term_end_date: ~datetime.datetime
    """

    billing_frequency: Optional[str] = rest_field(name="billingFrequency", visibility=["read"])
    """The billing frequency in ISO8601 format of product in the subscription. Example: P1M, P3M, P1Y."""
    product_id: Optional[str] = rest_field(name="productId", visibility=["read"])
    """Id of the product for which the subscription is purchased."""
    product_type_id: Optional[str] = rest_field(name="productTypeId", visibility=["read"])
    """Type Id of the product for which the subscription is purchased."""
    sku_id: Optional[str] = rest_field(name="skuId", visibility=["read"])
    """The SKU ID of the product for which the subscription is purchased. This field is is only
     available  for Microsoft Customer Agreement billing accounts."""
    term_duration: Optional[str] = rest_field(name="termDuration", visibility=["read"])
    """The duration in ISO8601 format for which you can use the subscription. Example: P1M, P3M, P1Y."""
    quantity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The quantity of licenses or fulfillment units for the subscription."""
    term_end_date: Optional[datetime.datetime] = rest_field(name="termEndDate", visibility=["read"], format="rfc3339")
    """End date of the term in UTC time."""

    @overload
    def __init__(
        self,
        *,
        quantity: Optional[int] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class RenewProperties(_Model):
    """Properties specific to renew.

    :ivar purchase_properties: Purchase request.
    :vartype purchase_properties: ~azure.mgmt.billing.models.PurchaseRequest
    """

    purchase_properties: Optional["_models.PurchaseRequest"] = rest_field(
        name="purchaseProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Purchase request."""

    @overload
    def __init__(
        self,
        *,
        purchase_properties: Optional["_models.PurchaseRequest"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class RenewPropertiesResponse(_Model):
    """The renew properties for a reservation.

    :ivar purchase_properties: The request for reservation purchase.
    :vartype purchase_properties: ~azure.mgmt.billing.models.ReservationPurchaseRequest
    :ivar pricing_currency_total: Amount that Microsoft uses for record. Used during refund for
     calculating refund limit. Tax is not included. This is locked price 30 days before expiry.
    :vartype pricing_currency_total: ~azure.mgmt.billing.models.Price
    :ivar billing_currency_total: Currency and amount that customer will be charged in customer's
     local currency for renewal purchase. Tax is not included.
    :vartype billing_currency_total: ~azure.mgmt.billing.models.Price
    """

    purchase_properties: Optional["_models.ReservationPurchaseRequest"] = rest_field(
        name="purchaseProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """The request for reservation purchase."""
    pricing_currency_total: Optional["_models.Price"] = rest_field(
        name="pricingCurrencyTotal", visibility=["read", "create", "update", "delete", "query"]
    )
    """Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is
     not included. This is locked price 30 days before expiry."""
    billing_currency_total: Optional["_models.Price"] = rest_field(
        name="billingCurrencyTotal", visibility=["read", "create", "update", "delete", "query"]
    )
    """Currency and amount that customer will be charged in customer's local currency for renewal
     purchase. Tax is not included."""

    @overload
    def __init__(
        self,
        *,
        purchase_properties: Optional["_models.ReservationPurchaseRequest"] = None,
        pricing_currency_total: Optional["_models.Price"] = None,
        billing_currency_total: Optional["_models.Price"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class Reservation(ProxyResource):
    """The definition of the reservation.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: The properties associated to this reservation.
    :vartype properties: ~azure.mgmt.billing.models.ReservationProperty
    :ivar location: The location of the reservation.
    :vartype location: str
    :ivar etag:
    :vartype etag: int
    :ivar tags: Tags for this reservation.
    :vartype tags: dict[str, str]
    :ivar sku: The sku information associated to this reservation.
    :vartype sku: ~azure.mgmt.billing.models.ReservationSkuProperty
    """

    properties: Optional["_models.ReservationProperty"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties associated to this reservation."""
    location: Optional[str] = rest_field(visibility=["read", "create"])
    """The location of the reservation."""
    etag: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Tags for this reservation."""
    sku: Optional["_models.ReservationSkuProperty"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The sku information associated to this reservation."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ReservationProperty"] = None,
        location: Optional[str] = None,
        etag: Optional[int] = None,
        tags: Optional[dict[str, str]] = None,
        sku: Optional["_models.ReservationSkuProperty"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ReservationAppliedScopeProperties(_Model):
    """Properties specific to applied scope type. Not required if not applicable. Required and need to
    provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup.

    :ivar tenant_id: Tenant ID where the reservation should apply benefit.
    :vartype tenant_id: str
    :ivar management_group_id: Fully-qualified identifier of the management group where the benefit
     must be applied.
    :vartype management_group_id: str
    :ivar subscription_id: Fully-qualified identifier of the subscription.
    :vartype subscription_id: str
    :ivar resource_group_id: Fully-qualified identifier of the resource group.
    :vartype resource_group_id: str
    :ivar display_name: Display name.
    :vartype display_name: str
    """

    tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"])
    """Tenant ID where the reservation should apply benefit."""
    management_group_id: Optional[str] = rest_field(
        name="managementGroupId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Fully-qualified identifier of the management group where the benefit must be applied."""
    subscription_id: Optional[str] = rest_field(
        name="subscriptionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Fully-qualified identifier of the subscription."""
    resource_group_id: Optional[str] = rest_field(
        name="resourceGroupId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Fully-qualified identifier of the resource group."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name."""

    @overload
    def __init__(
        self,
        *,
        tenant_id: Optional[str] = None,
        management_group_id: Optional[str] = None,
        subscription_id: Optional[str] = None,
        resource_group_id: Optional[str] = None,
        display_name: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ReservationExtendedStatusInfo(_Model):
    """Extended status information for the reservation.

    :ivar status_code: The status of the reservation. Known values are: "None", "Pending",
     "Processing", "Active", "PurchaseError", "PaymentInstrumentError", "Split", "Merged",
     "Expired", "Succeeded", "CapacityError", "CapacityRestricted", "Exchanged", "UnknownError",
     "RiskCheckFailed", "CreditLineCheckFailed", "Warning", "NoBenefitDueToSubscriptionTransfer",
     "NoBenefitDueToSubscriptionDeletion", and "NoBenefit".
    :vartype status_code: str or ~azure.mgmt.billing.models.ReservationStatusCode
    :ivar message: The message giving detailed information about the status code.
    :vartype message: str
    :ivar properties: Properties for extended status information.
    :vartype properties: ~azure.mgmt.billing.models.ExtendedStatusDefinitionProperties
    """

    status_code: Optional[Union[str, "_models.ReservationStatusCode"]] = rest_field(
        name="statusCode", visibility=["read", "create", "update", "delete", "query"]
    )
    """The status of the reservation. Known values are: \"None\", \"Pending\", \"Processing\",
     \"Active\", \"PurchaseError\", \"PaymentInstrumentError\", \"Split\", \"Merged\", \"Expired\",
     \"Succeeded\", \"CapacityError\", \"CapacityRestricted\", \"Exchanged\", \"UnknownError\",
     \"RiskCheckFailed\", \"CreditLineCheckFailed\", \"Warning\",
     \"NoBenefitDueToSubscriptionTransfer\", \"NoBenefitDueToSubscriptionDeletion\", and
     \"NoBenefit\"."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The message giving detailed information about the status code."""
    properties: Optional["_models.ExtendedStatusDefinitionProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties for extended status information."""

    @overload
    def __init__(
        self,
        *,
        status_code: Optional[Union[str, "_models.ReservationStatusCode"]] = None,
        message: Optional[str] = None,
        properties: Optional["_models.ExtendedStatusDefinitionProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ReservationMergeProperties(_Model):
    """Properties of reservation merge.

    :ivar merge_destination: Reservation resource id Created due to the merge. Format of the
     resource id is
     /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
    :vartype merge_destination: str
    :ivar merge_sources: Resource ids of the source reservation's merged to form this reservation.
     Format of the resource id is
     /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
    :vartype merge_sources: list[str]
    """

    merge_destination: Optional[str] = rest_field(
        name="mergeDestination", visibility=["read", "create", "update", "delete", "query"]
    )
    """Reservation resource id Created due to the merge. Format of the resource id is
     /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}."""
    merge_sources: Optional[list[str]] = rest_field(
        name="mergeSources", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource ids of the source reservation's merged to form this reservation. Format of the
     resource id is
     /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}."""

    @overload
    def __init__(
        self,
        *,
        merge_destination: Optional[str] = None,
        merge_sources: Optional[list[str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ReservationOrder(ProxyResource):
    """Details of a reservation order being returned.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: The properties associated to this reservation order.
    :vartype properties: ~azure.mgmt.billing.models.ReservationOrderProperty
    :ivar etag:
    :vartype etag: int
    :ivar tags: Tags for this reservation.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.ReservationOrderProperty"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties associated to this reservation order."""
    etag: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Tags for this reservation."""

    __flattened_items = [
        "display_name",
        "enrollment_id",
        "customer_id",
        "billing_profile_id",
        "billing_account_id",
        "request_date_time",
        "created_date_time",
        "expiry_date",
        "expiry_date_time",
        "benefit_start_time",
        "original_quantity",
        "term",
        "provisioning_state",
        "billing_plan",
        "plan_information",
        "reservations",
        "review_date_time",
        "extended_status_info",
        "product_code",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ReservationOrderProperty"] = None,
        etag: Optional[int] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class ReservationOrderBillingPlanInformation(_Model):
    """Information describing the type of billing plan for this reservation order.

    :ivar pricing_currency_total: Amount of money to be paid for the Order. Tax is not included.
    :vartype pricing_currency_total: ~azure.mgmt.billing.models.Price
    :ivar start_date: Date when the billing plan has started.
    :vartype start_date: ~datetime.date
    :ivar next_payment_due_date: For recurring billing plans, indicates the date when next payment
     will be processed. Null when total is paid off.
    :vartype next_payment_due_date: ~datetime.date
    :ivar transactions:
    :vartype transactions: list[~azure.mgmt.billing.models.ReservationPaymentDetail]
    """

    pricing_currency_total: Optional["_models.Price"] = rest_field(
        name="pricingCurrencyTotal", visibility=["read", "create", "update", "delete", "query"]
    )
    """Amount of money to be paid for the Order. Tax is not included."""
    start_date: Optional[datetime.date] = rest_field(
        name="startDate", visibility=["read", "create", "update", "delete", "query"]
    )
    """Date when the billing plan has started."""
    next_payment_due_date: Optional[datetime.date] = rest_field(
        name="nextPaymentDueDate", visibility=["read", "create", "update", "delete", "query"]
    )
    """For recurring billing plans, indicates the date when next payment will be processed. Null when
     total is paid off."""
    transactions: Optional[list["_models.ReservationPaymentDetail"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        pricing_currency_total: Optional["_models.Price"] = None,
        start_date: Optional[datetime.date] = None,
        next_payment_due_date: Optional[datetime.date] = None,
        transactions: Optional[list["_models.ReservationPaymentDetail"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ReservationOrderProperty(_Model):
    """Properties of a reservation order.

    :ivar display_name: Friendly name for user to easily identified the reservation order.
    :vartype display_name: str
    :ivar enrollment_id: Enrollment id of the reservation order.
    :vartype enrollment_id: str
    :ivar customer_id: Fully-qualified identifier of the customerId where the benefit is applied.
     Present only for Enterprise Agreement PartnerLed customers.
    :vartype customer_id: str
    :ivar billing_profile_id: Billing profile Id associated to this reservation order.
    :vartype billing_profile_id: str
    :ivar billing_account_id: Billing account Id associated to this reservation order.
    :vartype billing_account_id: str
    :ivar request_date_time: This is the DateTime when the reservation order was initially
     requested for purchase.
    :vartype request_date_time: ~datetime.datetime
    :ivar created_date_time: This is the DateTime when the reservation order was created.
    :vartype created_date_time: ~datetime.datetime
    :ivar expiry_date: This is the date when the reservation order will expire.
    :vartype expiry_date: ~datetime.date
    :ivar expiry_date_time: This is the date-time when the reservation order will expire.
    :vartype expiry_date_time: ~datetime.datetime
    :ivar benefit_start_time: This is the DateTime when the reservation benefit started.
    :vartype benefit_start_time: ~datetime.datetime
    :ivar original_quantity: Total original quantity of the skus purchased in the reservation
     order.
    :vartype original_quantity: int
    :ivar term: The term of the reservation, e.g. P1Y.
    :vartype term: str
    :ivar provisioning_state: The provisioning state of the reservation, e.g. Succeeded.
    :vartype provisioning_state: str
    :ivar billing_plan: Represent the billing plans. Known values are: "Upfront" and "Monthly".
    :vartype billing_plan: str or ~azure.mgmt.billing.models.ReservationBillingPlan
    :ivar plan_information: Information describing the type of billing plan for this reservation
     order.
    :vartype plan_information: ~azure.mgmt.billing.models.ReservationOrderBillingPlanInformation
    :ivar reservations:
    :vartype reservations: list[~azure.mgmt.billing.models.Reservation]
    :ivar review_date_time: This is the date-time when the Azure Hybrid Benefit needs to be
     reviewed.
    :vartype review_date_time: ~datetime.datetime
    :ivar extended_status_info: Extended status information for the reservation.
    :vartype extended_status_info: ~azure.mgmt.billing.models.ReservationExtendedStatusInfo
    :ivar product_code: Represents UPN.
    :vartype product_code: str
    """

    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Friendly name for user to easily identified the reservation order."""
    enrollment_id: Optional[str] = rest_field(
        name="enrollmentId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Enrollment id of the reservation order."""
    customer_id: Optional[str] = rest_field(
        name="customerId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Fully-qualified identifier of the customerId where the benefit is applied. Present only for
     Enterprise Agreement PartnerLed customers."""
    billing_profile_id: Optional[str] = rest_field(
        name="billingProfileId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Billing profile Id associated to this reservation order."""
    billing_account_id: Optional[str] = rest_field(
        name="billingAccountId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Billing account Id associated to this reservation order."""
    request_date_time: Optional[datetime.datetime] = rest_field(
        name="requestDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """This is the DateTime when the reservation order was initially requested for purchase."""
    created_date_time: Optional[datetime.datetime] = rest_field(
        name="createdDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """This is the DateTime when the reservation order was created."""
    expiry_date: Optional[datetime.date] = rest_field(
        name="expiryDate", visibility=["read", "create", "update", "delete", "query"]
    )
    """This is the date when the reservation order will expire."""
    expiry_date_time: Optional[datetime.datetime] = rest_field(
        name="expiryDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """This is the date-time when the reservation order will expire."""
    benefit_start_time: Optional[datetime.datetime] = rest_field(
        name="benefitStartTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """This is the DateTime when the reservation benefit started."""
    original_quantity: Optional[int] = rest_field(
        name="originalQuantity", visibility=["read", "create", "update", "delete", "query"]
    )
    """Total original quantity of the skus purchased in the reservation order."""
    term: Optional[str] = rest_field(visibility=["read"])
    """The term of the reservation, e.g. P1Y."""
    provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"])
    """The provisioning state of the reservation, e.g. Succeeded."""
    billing_plan: Optional[Union[str, "_models.ReservationBillingPlan"]] = rest_field(
        name="billingPlan", visibility=["read", "create", "update", "delete", "query"]
    )
    """Represent the billing plans. Known values are: \"Upfront\" and \"Monthly\"."""
    plan_information: Optional["_models.ReservationOrderBillingPlanInformation"] = rest_field(
        name="planInformation", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information describing the type of billing plan for this reservation order."""
    reservations: Optional[list["_models.Reservation"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    review_date_time: Optional[datetime.datetime] = rest_field(
        name="reviewDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """This is the date-time when the Azure Hybrid Benefit needs to be reviewed."""
    extended_status_info: Optional["_models.ReservationExtendedStatusInfo"] = rest_field(
        name="extendedStatusInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Extended status information for the reservation."""
    product_code: Optional[str] = rest_field(
        name="productCode", visibility=["read", "create", "update", "delete", "query"]
    )
    """Represents UPN."""

    @overload
    def __init__(
        self,
        *,
        display_name: Optional[str] = None,
        enrollment_id: Optional[str] = None,
        customer_id: Optional[str] = None,
        billing_profile_id: Optional[str] = None,
        billing_account_id: Optional[str] = None,
        request_date_time: Optional[datetime.datetime] = None,
        created_date_time: Optional[datetime.datetime] = None,
        expiry_date: Optional[datetime.date] = None,
        expiry_date_time: Optional[datetime.datetime] = None,
        benefit_start_time: Optional[datetime.datetime] = None,
        original_quantity: Optional[int] = None,
        billing_plan: Optional[Union[str, "_models.ReservationBillingPlan"]] = None,
        plan_information: Optional["_models.ReservationOrderBillingPlanInformation"] = None,
        reservations: Optional[list["_models.Reservation"]] = None,
        review_date_time: Optional[datetime.datetime] = None,
        extended_status_info: Optional["_models.ReservationExtendedStatusInfo"] = None,
        product_code: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ReservationPaymentDetail(_Model):
    """Information about payment related to a reservation order.

    :ivar due_date: Date when the payment needs to be done.
    :vartype due_date: ~datetime.date
    :ivar payment_date: Date when the transaction is completed. Is null when it is scheduled.
    :vartype payment_date: ~datetime.date
    :ivar pricing_currency_total: Amount in pricing currency. Tax not included.
    :vartype pricing_currency_total: ~azure.mgmt.billing.models.Price
    :ivar billing_currency_total: Amount charged in Billing currency. Tax not included. Is null for
     future payments.
    :vartype billing_currency_total: ~azure.mgmt.billing.models.Price
    :ivar billing_account: Shows the Account that is charged for this payment.
    :vartype billing_account: str
    :ivar status: Describes whether the payment is completed, failed, pending, cancelled or
     scheduled in the future. Known values are: "Succeeded", "Failed", "Scheduled", "Cancelled",
     "Completed", and "Pending".
    :vartype status: str or ~azure.mgmt.billing.models.PaymentStatus
    :ivar extended_status_info: Extended status information for the reservation.
    :vartype extended_status_info: ~azure.mgmt.billing.models.ReservationExtendedStatusInfo
    """

    due_date: Optional[datetime.date] = rest_field(
        name="dueDate", visibility=["read", "create", "update", "delete", "query"]
    )
    """Date when the payment needs to be done."""
    payment_date: Optional[datetime.date] = rest_field(
        name="paymentDate", visibility=["read", "create", "update", "delete", "query"]
    )
    """Date when the transaction is completed. Is null when it is scheduled."""
    pricing_currency_total: Optional["_models.Price"] = rest_field(
        name="pricingCurrencyTotal", visibility=["read", "create", "update", "delete", "query"]
    )
    """Amount in pricing currency. Tax not included."""
    billing_currency_total: Optional["_models.Price"] = rest_field(
        name="billingCurrencyTotal", visibility=["read", "create", "update", "delete", "query"]
    )
    """Amount charged in Billing currency. Tax not included. Is null for future payments."""
    billing_account: Optional[str] = rest_field(
        name="billingAccount", visibility=["read", "create", "update", "delete", "query"]
    )
    """Shows the Account that is charged for this payment."""
    status: Optional[Union[str, "_models.PaymentStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes whether the payment is completed, failed, pending, cancelled or scheduled in the
     future. Known values are: \"Succeeded\", \"Failed\", \"Scheduled\", \"Cancelled\",
     \"Completed\", and \"Pending\"."""
    extended_status_info: Optional["_models.ReservationExtendedStatusInfo"] = rest_field(
        name="extendedStatusInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Extended status information for the reservation."""

    @overload
    def __init__(
        self,
        *,
        due_date: Optional[datetime.date] = None,
        payment_date: Optional[datetime.date] = None,
        pricing_currency_total: Optional["_models.Price"] = None,
        billing_currency_total: Optional["_models.Price"] = None,
        billing_account: Optional[str] = None,
        status: Optional[Union[str, "_models.PaymentStatus"]] = None,
        extended_status_info: Optional["_models.ReservationExtendedStatusInfo"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ReservationProperty(_Model):
    """The property of reservation object.

    :ivar reserved_resource_type: The reserved source type of the reservation, e.g. virtual
     machine.
    :vartype reserved_resource_type: str
    :ivar instance_flexibility: Allows reservation discount to be applied across skus within the
     same auto fit group. Not all skus support instance size flexibility. Known values are: "On" and
     "Off".
    :vartype instance_flexibility: str or ~azure.mgmt.billing.models.InstanceFlexibility
    :ivar display_name: The display name of the reservation.
    :vartype display_name: str
    :ivar applied_scopes: The array of applied scopes of a reservation. Will be null if the
     reservation is in Shared scope.
    :vartype applied_scopes: list[str]
    :ivar applied_scope_type: The applied scope type of the reservation.
    :vartype applied_scope_type: str
    :ivar archived: Indicates if the reservation is archived.
    :vartype archived: bool
    :ivar capabilities: Capabilities of the reservation.
    :vartype capabilities: str
    :ivar quantity: The number of the reservation.
    :vartype quantity: float
    :ivar provisioning_state: The provisioning state of the reservation, e.g. Succeeded.
    :vartype provisioning_state: str
    :ivar effective_date_time: The effective date time of the reservation.
    :vartype effective_date_time: ~datetime.datetime
    :ivar benefit_start_time: This is the DateTime when the reservation benefit started.
    :vartype benefit_start_time: ~datetime.datetime
    :ivar last_updated_date_time: DateTime of the last time the reservation was updated.
    :vartype last_updated_date_time: ~datetime.datetime
    :ivar expiry_date: The expiry date of the reservation.
    :vartype expiry_date: str
    :ivar expiry_date_time: This is the date-time when the reservation will expire.
    :vartype expiry_date_time: ~datetime.datetime
    :ivar review_date_time: This is the date-time when the Azure Hybrid Benefit needs to be
     reviewed.
    :vartype review_date_time: ~datetime.datetime
    :ivar sku_description: The sku description of the reservation.
    :vartype sku_description: str
    :ivar extended_status_info: The message giving detailed information about the status code.
    :vartype extended_status_info: ~azure.mgmt.billing.models.ReservationExtendedStatusInfo
    :ivar billing_plan: The billing plan options available for this sku. Known values are:
     "Upfront" and "Monthly".
    :vartype billing_plan: str or ~azure.mgmt.billing.models.ReservationBillingPlan
    :ivar display_provisioning_state: The provisioning state of the reservation for display, e.g.
     Succeeded.
    :vartype display_provisioning_state: str
    :ivar provisioning_sub_state: The provisioning state of the reservation, e.g. Succeeded.
    :vartype provisioning_sub_state: str
    :ivar purchase_date: This is the date when the reservation was purchased.
    :vartype purchase_date: ~datetime.date
    :ivar purchase_date_time: This is the date-time when the reservation was purchased.
    :vartype purchase_date_time: ~datetime.datetime
    :ivar split_properties: Properties of reservation split.
    :vartype split_properties: ~azure.mgmt.billing.models.ReservationSplitProperties
    :ivar merge_properties: Properties of reservation merge.
    :vartype merge_properties: ~azure.mgmt.billing.models.ReservationMergeProperties
    :ivar swap_properties: Properties of reservation swap.
    :vartype swap_properties: ~azure.mgmt.billing.models.ReservationSwapProperties
    :ivar applied_scope_properties: Properties specific to applied scope type. Not required if not
     applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is
     ManagementGroup.
    :vartype applied_scope_properties: ~azure.mgmt.billing.models.ReservationAppliedScopeProperties
    :ivar billing_scope_id: Subscription that will be charged for purchasing reservation or savings
     plan.
    :vartype billing_scope_id: str
    :ivar renew: The renew state of the reservation.
    :vartype renew: bool
    :ivar renew_source: The renew source of the reservation.
    :vartype renew_source: str
    :ivar renew_destination: Reservation Id of the reservation which is purchased because of renew.
     Format of the resource Id is
     /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
    :vartype renew_destination: str
    :ivar renew_properties: The renew properties for a reservation.
    :vartype renew_properties: ~azure.mgmt.billing.models.RenewPropertiesResponse
    :ivar term: The term of the reservation, e.g. P1Y.
    :vartype term: str
    :ivar user_friendly_applied_scope_type: The applied scope type of the reservation for display,
     e.g. Shared.
    :vartype user_friendly_applied_scope_type: str
    :ivar user_friendly_renew_state: The renew state of the reservation for display, e.g. On.
    :vartype user_friendly_renew_state: str
    :ivar utilization: Reservation utilization.
    :vartype utilization: ~azure.mgmt.billing.models.ReservationPropertyUtilization
    :ivar product_code: Represents UPN.
    :vartype product_code: str
    """

    reserved_resource_type: Optional[str] = rest_field(name="reservedResourceType", visibility=["read"])
    """The reserved source type of the reservation, e.g. virtual machine."""
    instance_flexibility: Optional[Union[str, "_models.InstanceFlexibility"]] = rest_field(
        name="instanceFlexibility", visibility=["read", "create", "update", "delete", "query"]
    )
    """Allows reservation discount to be applied across skus within the same auto fit group. Not all
     skus support instance size flexibility. Known values are: \"On\" and \"Off\"."""
    display_name: Optional[str] = rest_field(name="displayName", visibility=["read"])
    """The display name of the reservation."""
    applied_scopes: Optional[list[str]] = rest_field(
        name="appliedScopes", visibility=["read", "create", "update", "delete", "query"]
    )
    """The array of applied scopes of a reservation. Will be null if the reservation is in Shared
     scope."""
    applied_scope_type: Optional[str] = rest_field(name="appliedScopeType", visibility=["read"])
    """The applied scope type of the reservation."""
    archived: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Indicates if the reservation is archived."""
    capabilities: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Capabilities of the reservation."""
    quantity: Optional[float] = rest_field(visibility=["read"])
    """The number of the reservation."""
    provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"])
    """The provisioning state of the reservation, e.g. Succeeded."""
    effective_date_time: Optional[datetime.datetime] = rest_field(
        name="effectiveDateTime", visibility=["read"], format="rfc3339"
    )
    """The effective date time of the reservation."""
    benefit_start_time: Optional[datetime.datetime] = rest_field(
        name="benefitStartTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """This is the DateTime when the reservation benefit started."""
    last_updated_date_time: Optional[datetime.datetime] = rest_field(
        name="lastUpdatedDateTime", visibility=["read"], format="rfc3339"
    )
    """DateTime of the last time the reservation was updated."""
    expiry_date: Optional[str] = rest_field(name="expiryDate", visibility=["read"])
    """The expiry date of the reservation."""
    expiry_date_time: Optional[datetime.datetime] = rest_field(
        name="expiryDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """This is the date-time when the reservation will expire."""
    review_date_time: Optional[datetime.datetime] = rest_field(
        name="reviewDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """This is the date-time when the Azure Hybrid Benefit needs to be reviewed."""
    sku_description: Optional[str] = rest_field(name="skuDescription", visibility=["read"])
    """The sku description of the reservation."""
    extended_status_info: Optional["_models.ReservationExtendedStatusInfo"] = rest_field(
        name="extendedStatusInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """The message giving detailed information about the status code."""
    billing_plan: Optional[Union[str, "_models.ReservationBillingPlan"]] = rest_field(
        name="billingPlan", visibility=["read", "create", "update", "delete", "query"]
    )
    """The billing plan options available for this sku. Known values are: \"Upfront\" and \"Monthly\"."""
    display_provisioning_state: Optional[str] = rest_field(name="displayProvisioningState", visibility=["read"])
    """The provisioning state of the reservation for display, e.g. Succeeded."""
    provisioning_sub_state: Optional[str] = rest_field(name="provisioningSubState", visibility=["read"])
    """The provisioning state of the reservation, e.g. Succeeded."""
    purchase_date: Optional[datetime.date] = rest_field(
        name="purchaseDate", visibility=["read", "create", "update", "delete", "query"]
    )
    """This is the date when the reservation was purchased."""
    purchase_date_time: Optional[datetime.datetime] = rest_field(
        name="purchaseDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """This is the date-time when the reservation was purchased."""
    split_properties: Optional["_models.ReservationSplitProperties"] = rest_field(
        name="splitProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of reservation split."""
    merge_properties: Optional["_models.ReservationMergeProperties"] = rest_field(
        name="mergeProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of reservation merge."""
    swap_properties: Optional["_models.ReservationSwapProperties"] = rest_field(
        name="swapProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of reservation swap."""
    applied_scope_properties: Optional["_models.ReservationAppliedScopeProperties"] = rest_field(
        name="appliedScopeProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties specific to applied scope type. Not required if not applicable. Required and need to
     provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup."""
    billing_scope_id: Optional[str] = rest_field(name="billingScopeId", visibility=["read"])
    """Subscription that will be charged for purchasing reservation or savings plan."""
    renew: Optional[bool] = rest_field(visibility=["read"])
    """The renew state of the reservation."""
    renew_source: Optional[str] = rest_field(name="renewSource", visibility=["read"])
    """The renew source of the reservation."""
    renew_destination: Optional[str] = rest_field(
        name="renewDestination", visibility=["read", "create", "update", "delete", "query"]
    )
    """Reservation Id of the reservation which is purchased because of renew. Format of the resource
     Id is
     /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}."""
    renew_properties: Optional["_models.RenewPropertiesResponse"] = rest_field(
        name="renewProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """The renew properties for a reservation."""
    term: Optional[str] = rest_field(visibility=["read"])
    """The term of the reservation, e.g. P1Y."""
    user_friendly_applied_scope_type: Optional[str] = rest_field(
        name="userFriendlyAppliedScopeType", visibility=["read"]
    )
    """The applied scope type of the reservation for display, e.g. Shared."""
    user_friendly_renew_state: Optional[str] = rest_field(name="userFriendlyRenewState", visibility=["read"])
    """The renew state of the reservation for display, e.g. On."""
    utilization: Optional["_models.ReservationPropertyUtilization"] = rest_field(visibility=["read"])
    """Reservation utilization."""
    product_code: Optional[str] = rest_field(
        name="productCode", visibility=["read", "create", "update", "delete", "query"]
    )
    """Represents UPN."""

    __flattened_items = ["trend", "aggregates"]

    @overload
    def __init__(  # pylint: disable=too-many-locals
        self,
        *,
        instance_flexibility: Optional[Union[str, "_models.InstanceFlexibility"]] = None,
        applied_scopes: Optional[list[str]] = None,
        archived: Optional[bool] = None,
        capabilities: Optional[str] = None,
        benefit_start_time: Optional[datetime.datetime] = None,
        expiry_date_time: Optional[datetime.datetime] = None,
        review_date_time: Optional[datetime.datetime] = None,
        extended_status_info: Optional["_models.ReservationExtendedStatusInfo"] = None,
        billing_plan: Optional[Union[str, "_models.ReservationBillingPlan"]] = None,
        purchase_date: Optional[datetime.date] = None,
        purchase_date_time: Optional[datetime.datetime] = None,
        split_properties: Optional["_models.ReservationSplitProperties"] = None,
        merge_properties: Optional["_models.ReservationMergeProperties"] = None,
        swap_properties: Optional["_models.ReservationSwapProperties"] = None,
        applied_scope_properties: Optional["_models.ReservationAppliedScopeProperties"] = None,
        renew_destination: Optional[str] = None,
        renew_properties: Optional["_models.RenewPropertiesResponse"] = None,
        product_code: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.utilization is None:
                return None
            return getattr(self.utilization, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.utilization is None:
                self.utilization = self._attr_to_rest_field["utilization"]._class_type()
            setattr(self.utilization, key, value)
        else:
            super().__setattr__(key, value)


class ReservationPropertyUtilization(_Model):
    """Reservation utilization.

    :ivar trend: last 7 day utilization trend for a reservation.
    :vartype trend: str
    :ivar aggregates: The array of aggregates of a reservation's utilization.
    :vartype aggregates: list[~azure.mgmt.billing.models.ReservationUtilizationAggregates]
    """

    trend: Optional[str] = rest_field(visibility=["read"])
    """last 7 day utilization trend for a reservation."""
    aggregates: Optional[list["_models.ReservationUtilizationAggregates"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The array of aggregates of a reservation's utilization."""

    @overload
    def __init__(
        self,
        *,
        aggregates: Optional[list["_models.ReservationUtilizationAggregates"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ReservationPurchaseRequest(_Model):
    """The request for reservation purchase.

    :ivar sku: The name of sku.
    :vartype sku: ~azure.mgmt.billing.models.SkuName
    :ivar location: The Azure region where the reserved resource lives.
    :vartype location: str
    :ivar properties: Properties of reservation purchase request.
    :vartype properties: ~azure.mgmt.billing.models.ReservationPurchaseRequestProperties
    """

    sku: Optional["_models.SkuName"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of sku."""
    location: Optional[str] = rest_field(visibility=["read", "create"])
    """The Azure region where the reserved resource lives."""
    properties: Optional["_models.ReservationPurchaseRequestProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of reservation purchase request."""

    @overload
    def __init__(
        self,
        *,
        sku: Optional["_models.SkuName"] = None,
        location: Optional[str] = None,
        properties: Optional["_models.ReservationPurchaseRequestProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ReservationPurchaseRequestProperties(_Model):
    """Properties of reservation purchase request.

    :ivar reserved_resource_type: The reserved source type of the reservation, e.g. virtual
     machine.
    :vartype reserved_resource_type: str
    :ivar billing_scope_id: Subscription that will be charged for purchasing reservation or savings
     plan.
    :vartype billing_scope_id: str
    :ivar term: The term of the reservation, e.g. P1Y.
    :vartype term: str
    :ivar billing_plan: Represent the billing plans. Known values are: "Upfront" and "Monthly".
    :vartype billing_plan: str or ~azure.mgmt.billing.models.ReservationBillingPlan
    :ivar quantity: Quantity of the skus that are part of the reservation. Must be greater than
     zero.
    :vartype quantity: int
    :ivar display_name: Friendly name of the reservation.
    :vartype display_name: str
    :ivar applied_scope_type: Type of the Applied Scope. Known values are: "Single", "Shared", and
     "ManagementGroup".
    :vartype applied_scope_type: str or ~azure.mgmt.billing.models.AppliedScopeType
    :ivar applied_scopes: List of the subscriptions that the benefit will be applied. Do not
     specify if AppliedScopeType is Shared.
    :vartype applied_scopes: list[str]
    :ivar applied_scope_properties: Properties specific to applied scope type. Not required if not
     applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is
     ManagementGroup.
    :vartype applied_scope_properties: ~azure.mgmt.billing.models.ReservationAppliedScopeProperties
    :ivar renew: Setting this to true will automatically purchase a new benefit on the expiration
     date time.
    :vartype renew: bool
    :ivar reserved_resource_properties: Properties specific to each reserved resource type. Not
     required if not applicable.
    :vartype reserved_resource_properties:
     ~azure.mgmt.billing.models.ReservationPurchaseRequestPropertiesReservedResourceProperties
    :ivar instance_flexibility: Allows reservation discount to be applied across skus within the
     same auto fit group. Not all skus support instance size flexibility. Known values are: "On" and
     "Off".
    :vartype instance_flexibility: str or ~azure.mgmt.billing.models.InstanceFlexibility
    :ivar review_date_time: This is the date-time when the Azure hybrid benefit needs to be
     reviewed.
    :vartype review_date_time: ~datetime.datetime
    """

    reserved_resource_type: Optional[str] = rest_field(name="reservedResourceType", visibility=["read"])
    """The reserved source type of the reservation, e.g. virtual machine."""
    billing_scope_id: Optional[str] = rest_field(name="billingScopeId", visibility=["read"])
    """Subscription that will be charged for purchasing reservation or savings plan."""
    term: Optional[str] = rest_field(visibility=["read"])
    """The term of the reservation, e.g. P1Y."""
    billing_plan: Optional[Union[str, "_models.ReservationBillingPlan"]] = rest_field(
        name="billingPlan", visibility=["read", "create", "update", "delete", "query"]
    )
    """Represent the billing plans. Known values are: \"Upfront\" and \"Monthly\"."""
    quantity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Quantity of the skus that are part of the reservation. Must be greater than zero."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Friendly name of the reservation."""
    applied_scope_type: Optional[Union[str, "_models.AppliedScopeType"]] = rest_field(
        name="appliedScopeType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the Applied Scope. Known values are: \"Single\", \"Shared\", and \"ManagementGroup\"."""
    applied_scopes: Optional[list[str]] = rest_field(
        name="appliedScopes", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType
     is Shared."""
    applied_scope_properties: Optional["_models.ReservationAppliedScopeProperties"] = rest_field(
        name="appliedScopeProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties specific to applied scope type. Not required if not applicable. Required and need to
     provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup."""
    renew: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Setting this to true will automatically purchase a new benefit on the expiration date time."""
    reserved_resource_properties: Optional["_models.ReservationPurchaseRequestPropertiesReservedResourceProperties"] = (
        rest_field(name="reservedResourceProperties", visibility=["read", "create", "update", "delete", "query"])
    )
    """Properties specific to each reserved resource type. Not required if not applicable."""
    instance_flexibility: Optional[Union[str, "_models.InstanceFlexibility"]] = rest_field(
        name="instanceFlexibility", visibility=["read", "create", "update", "delete", "query"]
    )
    """Allows reservation discount to be applied across skus within the same auto fit group. Not all
     skus support instance size flexibility. Known values are: \"On\" and \"Off\"."""
    review_date_time: Optional[datetime.datetime] = rest_field(
        name="reviewDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """This is the date-time when the Azure hybrid benefit needs to be reviewed."""

    __flattened_items = ["instance_flexibility"]

    @overload
    def __init__(
        self,
        *,
        billing_plan: Optional[Union[str, "_models.ReservationBillingPlan"]] = None,
        quantity: Optional[int] = None,
        display_name: Optional[str] = None,
        applied_scope_type: Optional[Union[str, "_models.AppliedScopeType"]] = None,
        applied_scopes: Optional[list[str]] = None,
        applied_scope_properties: Optional["_models.ReservationAppliedScopeProperties"] = None,
        renew: Optional[bool] = None,
        reserved_resource_properties: Optional[
            "_models.ReservationPurchaseRequestPropertiesReservedResourceProperties"
        ] = None,
        instance_flexibility: Optional[Union[str, "_models.InstanceFlexibility"]] = None,
        review_date_time: Optional[datetime.datetime] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.reserved_resource_properties is None:
                return None
            return getattr(self.reserved_resource_properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.reserved_resource_properties is None:
                self.reserved_resource_properties = self._attr_to_rest_field[
                    "reserved_resource_properties"
                ]._class_type()
            setattr(self.reserved_resource_properties, key, value)
        else:
            super().__setattr__(key, value)


class ReservationPurchaseRequestPropertiesReservedResourceProperties(_Model):  # pylint: disable=name-too-long
    """Properties specific to each reserved resource type. Not required if not applicable.

    :ivar instance_flexibility: Turning this on will apply the reservation discount to other VMs in
     the same VM size group. Only specify for VirtualMachines reserved resource type. Known values
     are: "On" and "Off".
    :vartype instance_flexibility: str or ~azure.mgmt.billing.models.InstanceFlexibility
    """

    instance_flexibility: Optional[Union[str, "_models.InstanceFlexibility"]] = rest_field(
        name="instanceFlexibility", visibility=["read", "create", "update", "delete", "query"]
    )
    """Turning this on will apply the reservation discount to other VMs in the same VM size group.
     Only specify for VirtualMachines reserved resource type. Known values are: \"On\" and \"Off\"."""

    @overload
    def __init__(
        self,
        *,
        instance_flexibility: Optional[Union[str, "_models.InstanceFlexibility"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ReservationSkuProperty(_Model):
    """The property of reservation sku object.

    :ivar name: The name of the reservation sku.
    :vartype name: str
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """The name of the reservation sku."""


class ReservationSplitProperties(_Model):
    """Properties of reservation split.

    :ivar split_destinations: List of destination resource id that are created due to split. Format
     of the resource id is
     /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
    :vartype split_destinations: list[str]
    :ivar split_source: Resource id of the reservation from which this is split. Format of the
     resource id is
     /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
    :vartype split_source: str
    """

    split_destinations: Optional[list[str]] = rest_field(
        name="splitDestinations", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of destination resource id that are created due to split. Format of the resource id is
     /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}."""
    split_source: Optional[str] = rest_field(
        name="splitSource", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource id of the reservation from which this is split. Format of the resource id is
     /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}."""

    @overload
    def __init__(
        self,
        *,
        split_destinations: Optional[list[str]] = None,
        split_source: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ReservationSummary(_Model):
    """The roll up count summary of reservations in each state.

    :ivar cancelled_count: The number of reservation in Cancelled state.
    :vartype cancelled_count: float
    :ivar expired_count: The number of reservation in Expired state.
    :vartype expired_count: float
    :ivar expiring_count: The number of reservation in Expiring state.
    :vartype expiring_count: float
    :ivar failed_count: The number of reservation in Failed state.
    :vartype failed_count: float
    :ivar pending_count: The number of reservation in Pending state.
    :vartype pending_count: float
    :ivar succeeded_count: The number of reservation in Succeeded state.
    :vartype succeeded_count: float
    :ivar no_benefit_count: The number of reservation in 'No Benefit' state.
    :vartype no_benefit_count: float
    :ivar warning_count: The number of reservation in Warning state.
    :vartype warning_count: float
    :ivar processing_count: The number of reservation in Processing state.
    :vartype processing_count: float
    """

    cancelled_count: Optional[float] = rest_field(name="cancelledCount", visibility=["read"])
    """The number of reservation in Cancelled state."""
    expired_count: Optional[float] = rest_field(name="expiredCount", visibility=["read"])
    """The number of reservation in Expired state."""
    expiring_count: Optional[float] = rest_field(name="expiringCount", visibility=["read"])
    """The number of reservation in Expiring state."""
    failed_count: Optional[float] = rest_field(name="failedCount", visibility=["read"])
    """The number of reservation in Failed state."""
    pending_count: Optional[float] = rest_field(name="pendingCount", visibility=["read"])
    """The number of reservation in Pending state."""
    succeeded_count: Optional[float] = rest_field(name="succeededCount", visibility=["read"])
    """The number of reservation in Succeeded state."""
    no_benefit_count: Optional[float] = rest_field(name="noBenefitCount", visibility=["read"])
    """The number of reservation in 'No Benefit' state."""
    warning_count: Optional[float] = rest_field(name="warningCount", visibility=["read"])
    """The number of reservation in Warning state."""
    processing_count: Optional[float] = rest_field(name="processingCount", visibility=["read"])
    """The number of reservation in Processing state."""


class ReservationSwapProperties(_Model):
    """Properties of reservation swap.

    :ivar swap_source: Resource id of the source reservation that gets swapped. Format of the
     resource id is
     /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
    :vartype swap_source: str
    :ivar swap_destination: Reservation resource id that the original resource gets swapped to.
     Format of the resource id is
     /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
    :vartype swap_destination: str
    """

    swap_source: Optional[str] = rest_field(
        name="swapSource", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource id of the source reservation that gets swapped. Format of the resource id is
     /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}."""
    swap_destination: Optional[str] = rest_field(
        name="swapDestination", visibility=["read", "create", "update", "delete", "query"]
    )
    """Reservation resource id that the original resource gets swapped to. Format of the resource id
     is
     /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}."""

    @overload
    def __init__(
        self,
        *,
        swap_source: Optional[str] = None,
        swap_destination: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ReservationUtilizationAggregates(_Model):
    """The aggregate values of reservation utilization.

    :ivar grain: The grain of the aggregate.
    :vartype grain: float
    :ivar grain_unit: The grain unit of the aggregate.
    :vartype grain_unit: str
    :ivar value: The aggregate value.
    :vartype value: float
    :ivar value_unit: The aggregate value unit.
    :vartype value_unit: str
    """

    grain: Optional[float] = rest_field(visibility=["read"])
    """The grain of the aggregate."""
    grain_unit: Optional[str] = rest_field(name="grainUnit", visibility=["read"])
    """The grain unit of the aggregate."""
    value: Optional[float] = rest_field(visibility=["read"])
    """The aggregate value."""
    value_unit: Optional[str] = rest_field(name="valueUnit", visibility=["read"])
    """The aggregate value unit."""


class SavingsPlanModel(ProxyResource):
    """Savings plan.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: Savings plan properties.
    :vartype properties: ~azure.mgmt.billing.models.SavingsPlanModelProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    :ivar sku: Savings plan SKU. Required.
    :vartype sku: ~azure.mgmt.billing.models.Sku
    """

    properties: Optional["_models.SavingsPlanModelProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Savings plan properties."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""
    sku: "_models.Sku" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Savings plan SKU. Required."""

    __flattened_items = [
        "display_name",
        "provisioning_state",
        "display_provisioning_state",
        "user_friendly_applied_scope_type",
        "billing_scope_id",
        "billing_profile_id",
        "customer_id",
        "billing_account_id",
        "term",
        "renew",
        "renew_source",
        "renew_destination",
        "renew_properties",
        "billing_plan",
        "applied_scope_type",
        "applied_scope_properties",
        "commitment",
        "effective_date_time",
        "benefit_start_time",
        "expiry_date_time",
        "purchase_date_time",
        "utilization",
        "extended_status_info",
        "product_code",
    ]

    @overload
    def __init__(
        self,
        *,
        sku: "_models.Sku",
        properties: Optional["_models.SavingsPlanModelProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class SavingsPlanModelProperties(_Model):
    """Savings plan properties.

    :ivar display_name: Display name.
    :vartype display_name: str
    :ivar provisioning_state: The provisioning state of the resource during a long-running
     operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending",
     "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired".
    :vartype provisioning_state: str or ~azure.mgmt.billing.models.ProvisioningState
    :ivar display_provisioning_state: The provisioning state of the savings plan for display, e.g.
     Succeeded.
    :vartype display_provisioning_state: str
    :ivar user_friendly_applied_scope_type: The applied scope type of the savings plan for display,
     e.g. Shared.
    :vartype user_friendly_applied_scope_type: str
    :ivar billing_scope_id: Subscription that will be charged for purchasing SavingsPlan.
    :vartype billing_scope_id: str
    :ivar billing_profile_id: Fully-qualified identifier of the billing profile where the savings
     plan is applied. Present only for Field-led or Customer-led customers.
    :vartype billing_profile_id: str
    :ivar customer_id: Fully-qualified identifier of the customer where the savings plan is
     applied. Present only for Partner-led customers.
    :vartype customer_id: str
    :ivar billing_account_id: Fully-qualified identifier of the billing account where the savings
     plan is applied.
    :vartype billing_account_id: str
    :ivar term: Represents the Savings plan term in ISO 8601 format. Known values are: "P1Y",
     "P3Y", and "P5Y".
    :vartype term: str or ~azure.mgmt.billing.models.SavingsPlanTerm
    :ivar renew: Setting this to true will automatically purchase a new benefit on the expiration
     date time.
    :vartype renew: bool
    :ivar renew_source: SavingsPlan Id of the SavingsPlan from which this SavingsPlan is renewed.
    :vartype renew_source: str
    :ivar renew_destination: SavingsPlan Id of the SavingsPlan which is purchased because of renew.
    :vartype renew_destination: str
    :ivar renew_properties: Properties specific to renew.
    :vartype renew_properties: ~azure.mgmt.billing.models.RenewProperties
    :ivar billing_plan: Represents the billing plan in ISO 8601 format. Required only for monthly
     purchases. "P1M"
    :vartype billing_plan: str or ~azure.mgmt.billing.models.BillingPlan
    :ivar applied_scope_type: Type of the Applied Scope. Known values are: "Single", "Shared", and
     "ManagementGroup".
    :vartype applied_scope_type: str or ~azure.mgmt.billing.models.AppliedScopeType
    :ivar applied_scope_properties: Properties specific to applied scope type. Not required if not
     applicable.
    :vartype applied_scope_properties: ~azure.mgmt.billing.models.AppliedScopeProperties
    :ivar commitment: Commitment towards the benefit.
    :vartype commitment: ~azure.mgmt.billing.models.Commitment
    :ivar effective_date_time: DateTime of the savings plan starting when this version is effective
     from.
    :vartype effective_date_time: ~datetime.datetime
    :ivar benefit_start_time: This is the DateTime when the savings plan benefit starts.
    :vartype benefit_start_time: ~datetime.datetime
    :ivar expiry_date_time: This is the date-time when the savings plan will expire.
    :vartype expiry_date_time: ~datetime.datetime
    :ivar purchase_date_time: Date time when the savings plan was purchased.
    :vartype purchase_date_time: ~datetime.datetime
    :ivar utilization: Savings plan utilization.
    :vartype utilization: ~azure.mgmt.billing.models.Utilization
    :ivar extended_status_info: Extended status information.
    :vartype extended_status_info: ~azure.mgmt.billing.models.ExtendedStatusInfo
    :ivar product_code: Represents UPN.
    :vartype product_code: str
    """

    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the resource during a long-running operation. Known values are:
     \"Succeeded\", \"Canceled\", \"Failed\", \"New\", \"Pending\", \"Provisioning\",
     \"PendingBilling\", \"ConfirmedBilling\", \"Creating\", \"Created\", and \"Expired\"."""
    display_provisioning_state: Optional[str] = rest_field(name="displayProvisioningState", visibility=["read"])
    """The provisioning state of the savings plan for display, e.g. Succeeded."""
    user_friendly_applied_scope_type: Optional[str] = rest_field(
        name="userFriendlyAppliedScopeType", visibility=["read"]
    )
    """The applied scope type of the savings plan for display, e.g. Shared."""
    billing_scope_id: Optional[str] = rest_field(
        name="billingScopeId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Subscription that will be charged for purchasing SavingsPlan."""
    billing_profile_id: Optional[str] = rest_field(name="billingProfileId", visibility=["read"])
    """Fully-qualified identifier of the billing profile where the savings plan is applied. Present
     only for Field-led or Customer-led customers."""
    customer_id: Optional[str] = rest_field(name="customerId", visibility=["read"])
    """Fully-qualified identifier of the customer where the savings plan is applied. Present only for
     Partner-led customers."""
    billing_account_id: Optional[str] = rest_field(name="billingAccountId", visibility=["read"])
    """Fully-qualified identifier of the billing account where the savings plan is applied."""
    term: Optional[Union[str, "_models.SavingsPlanTerm"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Represents the Savings plan term in ISO 8601 format. Known values are: \"P1Y\", \"P3Y\", and
     \"P5Y\"."""
    renew: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Setting this to true will automatically purchase a new benefit on the expiration date time."""
    renew_source: Optional[str] = rest_field(
        name="renewSource", visibility=["read", "create", "update", "delete", "query"]
    )
    """SavingsPlan Id of the SavingsPlan from which this SavingsPlan is renewed."""
    renew_destination: Optional[str] = rest_field(
        name="renewDestination", visibility=["read", "create", "update", "delete", "query"]
    )
    """SavingsPlan Id of the SavingsPlan which is purchased because of renew."""
    renew_properties: Optional["_models.RenewProperties"] = rest_field(
        name="renewProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties specific to renew."""
    billing_plan: Optional[Union[str, "_models.BillingPlan"]] = rest_field(
        name="billingPlan", visibility=["read", "create", "update", "delete", "query"]
    )
    """Represents the billing plan in ISO 8601 format. Required only for monthly purchases. \"P1M\""""
    applied_scope_type: Optional[Union[str, "_models.AppliedScopeType"]] = rest_field(
        name="appliedScopeType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the Applied Scope. Known values are: \"Single\", \"Shared\", and \"ManagementGroup\"."""
    applied_scope_properties: Optional["_models.AppliedScopeProperties"] = rest_field(
        name="appliedScopeProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties specific to applied scope type. Not required if not applicable."""
    commitment: Optional["_models.Commitment"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Commitment towards the benefit."""
    effective_date_time: Optional[datetime.datetime] = rest_field(
        name="effectiveDateTime", visibility=["read"], format="rfc3339"
    )
    """DateTime of the savings plan starting when this version is effective from."""
    benefit_start_time: Optional[datetime.datetime] = rest_field(
        name="benefitStartTime", visibility=["read"], format="rfc3339"
    )
    """This is the DateTime when the savings plan benefit starts."""
    expiry_date_time: Optional[datetime.datetime] = rest_field(
        name="expiryDateTime", visibility=["read"], format="rfc3339"
    )
    """This is the date-time when the savings plan will expire."""
    purchase_date_time: Optional[datetime.datetime] = rest_field(
        name="purchaseDateTime", visibility=["read"], format="rfc3339"
    )
    """Date time when the savings plan was purchased."""
    utilization: Optional["_models.Utilization"] = rest_field(visibility=["read"])
    """Savings plan utilization."""
    extended_status_info: Optional["_models.ExtendedStatusInfo"] = rest_field(
        name="extendedStatusInfo", visibility=["read"]
    )
    """Extended status information."""
    product_code: Optional[str] = rest_field(
        name="productCode", visibility=["read", "create", "update", "delete", "query"]
    )
    """Represents UPN."""

    @overload
    def __init__(
        self,
        *,
        display_name: Optional[str] = None,
        billing_scope_id: Optional[str] = None,
        term: Optional[Union[str, "_models.SavingsPlanTerm"]] = None,
        renew: Optional[bool] = None,
        renew_source: Optional[str] = None,
        renew_destination: Optional[str] = None,
        renew_properties: Optional["_models.RenewProperties"] = None,
        billing_plan: Optional[Union[str, "_models.BillingPlan"]] = None,
        applied_scope_type: Optional[Union[str, "_models.AppliedScopeType"]] = None,
        applied_scope_properties: Optional["_models.AppliedScopeProperties"] = None,
        commitment: Optional["_models.Commitment"] = None,
        product_code: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SavingsPlanOrderModel(ProxyResource):
    """Savings plan order.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: Savings plan order properties.
    :vartype properties: ~azure.mgmt.billing.models.SavingsPlanOrderModelProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    :ivar sku: Savings plan SKU. Required.
    :vartype sku: ~azure.mgmt.billing.models.Sku
    """

    properties: Optional["_models.SavingsPlanOrderModelProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Savings plan order properties."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""
    sku: "_models.Sku" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Savings plan SKU. Required."""

    __flattened_items = [
        "display_name",
        "provisioning_state",
        "billing_scope_id",
        "billing_profile_id",
        "customer_id",
        "billing_account_id",
        "term",
        "billing_plan",
        "benefit_start_time",
        "expiry_date_time",
        "plan_information",
        "savings_plans",
        "extended_status_info",
        "product_code",
    ]

    @overload
    def __init__(
        self,
        *,
        sku: "_models.Sku",
        properties: Optional["_models.SavingsPlanOrderModelProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class SavingsPlanOrderModelProperties(_Model):
    """Savings plan order properties.

    :ivar display_name: Display name.
    :vartype display_name: str
    :ivar provisioning_state: The provisioning state of the savings plan, e.g. Succeeded.
    :vartype provisioning_state: str
    :ivar billing_scope_id: Subscription that will be charged for purchasing SavingsPlan.
    :vartype billing_scope_id: str
    :ivar billing_profile_id: Fully-qualified identifier of the billing profile where the savings
     plan is applied. Present only for Field-led or Customer-led customers.
    :vartype billing_profile_id: str
    :ivar customer_id: Fully-qualified identifier of the customer where the savings plan is
     applied. Present only for Partner-led customers.
    :vartype customer_id: str
    :ivar billing_account_id: Fully-qualified identifier of the billing account where the savings
     plan is applied.
    :vartype billing_account_id: str
    :ivar term: Represents the Savings plan term in ISO 8601 format. Known values are: "P1Y",
     "P3Y", and "P5Y".
    :vartype term: str or ~azure.mgmt.billing.models.SavingsPlanTerm
    :ivar billing_plan: Represents the billing plan in ISO 8601 format. Required only for monthly
     purchases. "P1M"
    :vartype billing_plan: str or ~azure.mgmt.billing.models.BillingPlan
    :ivar benefit_start_time: DateTime when the savings plan benefit started.
    :vartype benefit_start_time: ~datetime.datetime
    :ivar expiry_date_time: DateTime when the savings plan will expire.
    :vartype expiry_date_time: ~datetime.datetime
    :ivar plan_information: Information describing the type of billing plan for this savings plan.
    :vartype plan_information: ~azure.mgmt.billing.models.BillingPlanInformation
    :ivar savings_plans:
    :vartype savings_plans: list[str]
    :ivar extended_status_info: Extended status information.
    :vartype extended_status_info: ~azure.mgmt.billing.models.ExtendedStatusInfo
    :ivar product_code: Represents UPN.
    :vartype product_code: str
    """

    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name."""
    provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"])
    """The provisioning state of the savings plan, e.g. Succeeded."""
    billing_scope_id: Optional[str] = rest_field(
        name="billingScopeId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Subscription that will be charged for purchasing SavingsPlan."""
    billing_profile_id: Optional[str] = rest_field(name="billingProfileId", visibility=["read"])
    """Fully-qualified identifier of the billing profile where the savings plan is applied. Present
     only for Field-led or Customer-led customers."""
    customer_id: Optional[str] = rest_field(name="customerId", visibility=["read"])
    """Fully-qualified identifier of the customer where the savings plan is applied. Present only for
     Partner-led customers."""
    billing_account_id: Optional[str] = rest_field(name="billingAccountId", visibility=["read"])
    """Fully-qualified identifier of the billing account where the savings plan is applied."""
    term: Optional[Union[str, "_models.SavingsPlanTerm"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Represents the Savings plan term in ISO 8601 format. Known values are: \"P1Y\", \"P3Y\", and
     \"P5Y\"."""
    billing_plan: Optional[Union[str, "_models.BillingPlan"]] = rest_field(
        name="billingPlan", visibility=["read", "create", "update", "delete", "query"]
    )
    """Represents the billing plan in ISO 8601 format. Required only for monthly purchases. \"P1M\""""
    benefit_start_time: Optional[datetime.datetime] = rest_field(
        name="benefitStartTime", visibility=["read"], format="rfc3339"
    )
    """DateTime when the savings plan benefit started."""
    expiry_date_time: Optional[datetime.datetime] = rest_field(
        name="expiryDateTime", visibility=["read"], format="rfc3339"
    )
    """DateTime when the savings plan will expire."""
    plan_information: Optional["_models.BillingPlanInformation"] = rest_field(
        name="planInformation", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information describing the type of billing plan for this savings plan."""
    savings_plans: Optional[list[str]] = rest_field(
        name="savingsPlans", visibility=["read", "create", "update", "delete", "query"]
    )
    extended_status_info: Optional["_models.ExtendedStatusInfo"] = rest_field(
        name="extendedStatusInfo", visibility=["read"]
    )
    """Extended status information."""
    product_code: Optional[str] = rest_field(
        name="productCode", visibility=["read", "create", "update", "delete", "query"]
    )
    """Represents UPN."""

    @overload
    def __init__(
        self,
        *,
        display_name: Optional[str] = None,
        billing_scope_id: Optional[str] = None,
        term: Optional[Union[str, "_models.SavingsPlanTerm"]] = None,
        billing_plan: Optional[Union[str, "_models.BillingPlan"]] = None,
        plan_information: Optional["_models.BillingPlanInformation"] = None,
        savings_plans: Optional[list[str]] = None,
        product_code: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SavingsPlanSummaryCount(_Model):
    """The roll up count summary of savings plans in each state.

    :ivar succeeded_count: The number of savings plans in Succeeded state.
    :vartype succeeded_count: float
    :ivar failed_count: The number of savings plans in Failed state.
    :vartype failed_count: float
    :ivar expiring_count: The number of savings plans in Expiring state.
    :vartype expiring_count: float
    :ivar expired_count: The number of savings plans in Expired state.
    :vartype expired_count: float
    :ivar pending_count: The number of savings plans in Pending state.
    :vartype pending_count: float
    :ivar cancelled_count: The number of savings plans in Cancelled state.
    :vartype cancelled_count: float
    :ivar processing_count: The number of savings plans in Processing state.
    :vartype processing_count: float
    :ivar no_benefit_count: The number of savings plans in No Benefit state.
    :vartype no_benefit_count: float
    :ivar warning_count: The number of savings plans in Warning state.
    :vartype warning_count: float
    """

    succeeded_count: Optional[float] = rest_field(name="succeededCount", visibility=["read"])
    """The number of savings plans in Succeeded state."""
    failed_count: Optional[float] = rest_field(name="failedCount", visibility=["read"])
    """The number of savings plans in Failed state."""
    expiring_count: Optional[float] = rest_field(name="expiringCount", visibility=["read"])
    """The number of savings plans in Expiring state."""
    expired_count: Optional[float] = rest_field(name="expiredCount", visibility=["read"])
    """The number of savings plans in Expired state."""
    pending_count: Optional[float] = rest_field(name="pendingCount", visibility=["read"])
    """The number of savings plans in Pending state."""
    cancelled_count: Optional[float] = rest_field(name="cancelledCount", visibility=["read"])
    """The number of savings plans in Cancelled state."""
    processing_count: Optional[float] = rest_field(name="processingCount", visibility=["read"])
    """The number of savings plans in Processing state."""
    no_benefit_count: Optional[float] = rest_field(name="noBenefitCount", visibility=["read"])
    """The number of savings plans in No Benefit state."""
    warning_count: Optional[float] = rest_field(name="warningCount", visibility=["read"])
    """The number of savings plans in Warning state."""


class SavingsPlanUpdateRequest(_Model):
    """Savings plan patch request.

    :ivar properties: Savings plan patch request.
    :vartype properties: ~azure.mgmt.billing.models.SavingsPlanUpdateRequestProperties
    :ivar sku: The SKU to be applied for this resource.
    :vartype sku: ~azure.mgmt.billing.models.Sku
    :ivar tags: Tags for this reservation.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.SavingsPlanUpdateRequestProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Savings plan patch request."""
    sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The SKU to be applied for this resource."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Tags for this reservation."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.SavingsPlanUpdateRequestProperties"] = None,
        sku: Optional["_models.Sku"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SavingsPlanUpdateRequestProperties(_Model):
    """Savings plan patch request.

    :ivar display_name: Display name.
    :vartype display_name: str
    :ivar applied_scope_type: Type of the Applied Scope. Known values are: "Single", "Shared", and
     "ManagementGroup".
    :vartype applied_scope_type: str or ~azure.mgmt.billing.models.AppliedScopeType
    :ivar applied_scope_properties: Properties specific to applied scope type. Not required if not
     applicable.
    :vartype applied_scope_properties: ~azure.mgmt.billing.models.AppliedScopeProperties
    :ivar renew: Setting this to true will automatically purchase a new benefit on the expiration
     date time.
    :vartype renew: bool
    :ivar renew_properties: Properties specific to renew.
    :vartype renew_properties: ~azure.mgmt.billing.models.RenewProperties
    """

    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name."""
    applied_scope_type: Optional[Union[str, "_models.AppliedScopeType"]] = rest_field(
        name="appliedScopeType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the Applied Scope. Known values are: \"Single\", \"Shared\", and \"ManagementGroup\"."""
    applied_scope_properties: Optional["_models.AppliedScopeProperties"] = rest_field(
        name="appliedScopeProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties specific to applied scope type. Not required if not applicable."""
    renew: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Setting this to true will automatically purchase a new benefit on the expiration date time."""
    renew_properties: Optional["_models.RenewProperties"] = rest_field(
        name="renewProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties specific to renew."""

    @overload
    def __init__(
        self,
        *,
        display_name: Optional[str] = None,
        applied_scope_type: Optional[Union[str, "_models.AppliedScopeType"]] = None,
        applied_scope_properties: Optional["_models.AppliedScopeProperties"] = None,
        renew: Optional[bool] = None,
        renew_properties: Optional["_models.RenewProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SavingsPlanUpdateValidateRequest(_Model):
    """Savings plan update validate request.

    :ivar benefits: The benefits of a savings plan.
    :vartype benefits: list[~azure.mgmt.billing.models.SavingsPlanUpdateRequestProperties]
    """

    benefits: Optional[list["_models.SavingsPlanUpdateRequestProperties"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The benefits of a savings plan."""

    @overload
    def __init__(
        self,
        *,
        benefits: Optional[list["_models.SavingsPlanUpdateRequestProperties"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SavingsPlanValidateResponse(_Model):
    """Savings plan update validate response.

    :ivar benefits:
    :vartype benefits: list[~azure.mgmt.billing.models.SavingsPlanValidResponseProperty]
    :ivar next_link: Url to get the next page.
    :vartype next_link: str
    """

    benefits: Optional[list["_models.SavingsPlanValidResponseProperty"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    next_link: Optional[str] = rest_field(name="nextLink", visibility=["read", "create", "update", "delete", "query"])
    """Url to get the next page."""

    @overload
    def __init__(
        self,
        *,
        benefits: Optional[list["_models.SavingsPlanValidResponseProperty"]] = None,
        next_link: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SavingsPlanValidResponseProperty(_Model):
    """Benefit scope response property.

    :ivar valid: Indicates if the provided input is valid.
    :vartype valid: bool
    :ivar reason_code: Failure reason code if the provided input is invalid.
    :vartype reason_code: str
    :ivar reason: Failure reason if the provided input is invalid.
    :vartype reason: str
    """

    valid: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Indicates if the provided input is valid."""
    reason_code: Optional[str] = rest_field(
        name="reasonCode", visibility=["read", "create", "update", "delete", "query"]
    )
    """Failure reason code if the provided input is invalid."""
    reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Failure reason if the provided input is invalid."""

    @overload
    def __init__(
        self,
        *,
        valid: Optional[bool] = None,
        reason_code: Optional[str] = None,
        reason: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class Sku(_Model):
    """The SKU to be applied for this resource.

    :ivar name: Name of the SKU to be applied.
    :vartype name: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the SKU to be applied."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SkuName(_Model):
    """The name of sku.

    :ivar name:
    :vartype name: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SpendingLimitDetails(_Model):
    """The billing profile spending limit.

    :ivar amount: The initial amount for the billing profile.
    :vartype amount: float
    :ivar currency: The currency in which the charges for the billing profile are billed.
    :vartype currency: str
    :ivar start_date: The date when this spending limit goes into effect.
    :vartype start_date: ~datetime.datetime
    :ivar end_date: The date when this spending limit is no longer in effect.
    :vartype end_date: ~datetime.datetime
    :ivar type: The type of spending limit. Known values are: "Other", "None", "FreeAccount",
     "Sandbox", "AzureForStudents", "AcademicSponsorship", "AzureConsumptionCredit",
     "AzurePassSponsorship", "MpnSponsorship", "MSDN", "NonProfitSponsorship", "Sponsorship",
     "StartupSponsorship", "AzureForStudentsStarter", and "VisualStudio".
    :vartype type: str or ~azure.mgmt.billing.models.SpendingLimitType
    :ivar status: The status of current spending limit. Known values are: "Other", "None",
     "Active", "Expired", "LimitReached", and "LimitRemoved".
    :vartype status: str or ~azure.mgmt.billing.models.SpendingLimitStatus
    """

    amount: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The initial amount for the billing profile."""
    currency: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The currency in which the charges for the billing profile are billed."""
    start_date: Optional[datetime.datetime] = rest_field(
        name="startDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The date when this spending limit goes into effect."""
    end_date: Optional[datetime.datetime] = rest_field(
        name="endDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The date when this spending limit is no longer in effect."""
    type: Optional[Union[str, "_models.SpendingLimitType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of spending limit. Known values are: \"Other\", \"None\", \"FreeAccount\",
     \"Sandbox\", \"AzureForStudents\", \"AcademicSponsorship\", \"AzureConsumptionCredit\",
     \"AzurePassSponsorship\", \"MpnSponsorship\", \"MSDN\", \"NonProfitSponsorship\",
     \"Sponsorship\", \"StartupSponsorship\", \"AzureForStudentsStarter\", and \"VisualStudio\"."""
    status: Optional[Union[str, "_models.SpendingLimitStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The status of current spending limit. Known values are: \"Other\", \"None\", \"Active\",
     \"Expired\", \"LimitReached\", and \"LimitRemoved\"."""

    @overload
    def __init__(
        self,
        *,
        amount: Optional[float] = None,
        currency: Optional[str] = None,
        start_date: Optional[datetime.datetime] = None,
        end_date: Optional[datetime.datetime] = None,
        type: Optional[Union[str, "_models.SpendingLimitType"]] = None,
        status: Optional[Union[str, "_models.SpendingLimitStatus"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SubscriptionPolicy(ProxyResource):
    """A policy at subscription scope.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: A policy at subscription scope.
    :vartype properties: ~azure.mgmt.billing.models.SubscriptionPolicyProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.SubscriptionPolicyProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A policy at subscription scope."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.SubscriptionPolicyProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SubscriptionPolicyProperties(_Model):
    """A policy at subscription scope.

    :ivar provisioning_state: The provisioning state of the resource during a long-running
     operation. Known values are: "Succeeded", "Canceled", "Failed", "New", "Pending",
     "Provisioning", "PendingBilling", "ConfirmedBilling", "Creating", "Created", and "Expired".
    :vartype provisioning_state: str or ~azure.mgmt.billing.models.ProvisioningState
    :ivar policies: List of all policies defined at the billing scope.
    :vartype policies: list[~azure.mgmt.billing.models.PolicySummary]
    """

    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the resource during a long-running operation. Known values are:
     \"Succeeded\", \"Canceled\", \"Failed\", \"New\", \"Pending\", \"Provisioning\",
     \"PendingBilling\", \"ConfirmedBilling\", \"Creating\", \"Created\", and \"Expired\"."""
    policies: Optional[list["_models.PolicySummary"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of all policies defined at the billing scope."""

    @overload
    def __init__(
        self,
        *,
        policies: Optional[list["_models.PolicySummary"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SystemData(_Model):
    """Metadata pertaining to creation and last modification of the resource.

    :ivar created_by: The identity that created the resource.
    :vartype created_by: str
    :ivar created_by_type: The type of identity that created the resource. Known values are:
     "User", "Application", "ManagedIdentity", and "Key".
    :vartype created_by_type: str or ~azure.mgmt.billing.models.CreatedByType
    :ivar created_at: The timestamp of resource creation (UTC).
    :vartype created_at: ~datetime.datetime
    :ivar last_modified_by: The identity that last modified the resource.
    :vartype last_modified_by: str
    :ivar last_modified_by_type: The type of identity that last modified the resource. Known values
     are: "User", "Application", "ManagedIdentity", and "Key".
    :vartype last_modified_by_type: str or ~azure.mgmt.billing.models.CreatedByType
    :ivar last_modified_at: The timestamp of resource last modification (UTC).
    :vartype last_modified_at: ~datetime.datetime
    """

    created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"])
    """The identity that created the resource."""
    created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(
        name="createdByType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of identity that created the resource. Known values are: \"User\", \"Application\",
     \"ManagedIdentity\", and \"Key\"."""
    created_at: Optional[datetime.datetime] = rest_field(
        name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The timestamp of resource creation (UTC)."""
    last_modified_by: Optional[str] = rest_field(
        name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity that last modified the resource."""
    last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(
        name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of identity that last modified the resource. Known values are: \"User\",
     \"Application\", \"ManagedIdentity\", and \"Key\"."""
    last_modified_at: Optional[datetime.datetime] = rest_field(
        name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The timestamp of resource last modification (UTC)."""

    @overload
    def __init__(
        self,
        *,
        created_by: Optional[str] = None,
        created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
        created_at: Optional[datetime.datetime] = None,
        last_modified_by: Optional[str] = None,
        last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
        last_modified_at: Optional[datetime.datetime] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SystemOverrides(_Model):
    """System imposed policies that regulate behavior of the subscription.

    :ivar cancellation: The policy override for the subscription indicates whether the self-serve
     cancellation or seat reduction is allowed. Known values are: "NotAllowed" and "Allowed".
    :vartype cancellation: str or ~azure.mgmt.billing.models.Cancellation
    :ivar cancellation_allowed_end_date: The end date in UTC time by when the self-serve
     cancellation ends.
    :vartype cancellation_allowed_end_date: ~datetime.datetime
    """

    cancellation: Optional[Union[str, "_models.Cancellation"]] = rest_field(visibility=["read"])
    """The policy override for the subscription indicates whether the self-serve cancellation or seat
     reduction is allowed. Known values are: \"NotAllowed\" and \"Allowed\"."""
    cancellation_allowed_end_date: Optional[datetime.datetime] = rest_field(
        name="cancellationAllowedEndDate", visibility=["read"], format="rfc3339"
    )
    """The end date in UTC time by when the self-serve cancellation ends."""


class TaxIdentifier(_Model):
    """A tax identifier for the billing account.

    :ivar id: The id of the tax identifier.
    :vartype id: str
    :ivar type: The type of the tax identifier. Known values are: "Other", "BrazilCcmId",
     "BrazilCnpjId", "BrazilCpfId", "CanadianFederalExempt", "CanadianProvinceExempt",
     "ExternalTaxation", "IndiaFederalTanId", "IndiaFederalServiceTaxId", "IndiaPanId",
     "IndiaStateCstId", "IndiaStateGstINId", "IndiaStateVatId", "IntlExempt", "USExempt", "VatId",
     "LoveCode", "MobileBarCode", "NationalIdentificationNumber", and "PublicSectorId".
    :vartype type: str or ~azure.mgmt.billing.models.TaxIdentifierType
    :ivar scope: The scope of the tax identifier.
    :vartype scope: str
    :ivar country: The country of the tax identifier.
    :vartype country: str
    :ivar status: The status of the tax identifier. Known values are: "Other", "Valid", and
     "Invalid".
    :vartype status: str or ~azure.mgmt.billing.models.TaxIdentifierStatus
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The id of the tax identifier."""
    type: Optional[Union[str, "_models.TaxIdentifierType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of the tax identifier. Known values are: \"Other\", \"BrazilCcmId\", \"BrazilCnpjId\",
     \"BrazilCpfId\", \"CanadianFederalExempt\", \"CanadianProvinceExempt\", \"ExternalTaxation\",
     \"IndiaFederalTanId\", \"IndiaFederalServiceTaxId\", \"IndiaPanId\", \"IndiaStateCstId\",
     \"IndiaStateGstINId\", \"IndiaStateVatId\", \"IntlExempt\", \"USExempt\", \"VatId\",
     \"LoveCode\", \"MobileBarCode\", \"NationalIdentificationNumber\", and \"PublicSectorId\"."""
    scope: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The scope of the tax identifier."""
    country: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The country of the tax identifier."""
    status: Optional[Union[str, "_models.TaxIdentifierStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The status of the tax identifier. Known values are: \"Other\", \"Valid\", and \"Invalid\"."""

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        type: Optional[Union[str, "_models.TaxIdentifierType"]] = None,
        scope: Optional[str] = None,
        country: Optional[str] = None,
        status: Optional[Union[str, "_models.TaxIdentifierStatus"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class Transaction(ProxyResourceWithTags):
    """A transaction.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    :ivar properties: A transaction.
    :vartype properties: ~azure.mgmt.billing.models.TransactionProperties
    """

    properties: Optional["_models.TransactionProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A transaction."""

    @overload
    def __init__(
        self,
        *,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.TransactionProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class TransactionProperties(_Model):
    """A transaction.

    :ivar azure_credit_applied: The amount of any Azure credits automatically applied to this
     transaction.
    :vartype azure_credit_applied:
     ~azure.mgmt.billing.models.TransactionPropertiesAzureCreditApplied
    :ivar azure_plan: Details of the Azure plan.
    :vartype azure_plan: str
    :ivar billing_currency: The ISO 4217 code for the currency in which this transaction is billed.
    :vartype billing_currency: str
    :ivar billing_profile_display_name: The name of the billing profile.
    :vartype billing_profile_display_name: any
    :ivar billing_profile_id: The fully qualified ID that uniquely identifies a billing profile.
    :vartype billing_profile_id: str
    :ivar consumption_commitment_decremented: The amount of Microsoft Azure Consumption
     Commitment(MACC) decrement through the transaction.
    :vartype consumption_commitment_decremented:
     ~azure.mgmt.billing.models.TransactionPropertiesConsumptionCommitmentDecremented
    :ivar customer_display_name: The name of the customer.
    :vartype customer_display_name: str
    :ivar customer_id: The fully qualified ID that uniquely identifies a customer.
    :vartype customer_id: str
    :ivar credit_type: The credit type of the transaction. Applies only to credited transactions.
     Known values are: "Other", "AzureFreeCredit", "AzureCreditOffer", "ServiceInterruption", and
     "Refund".
    :vartype credit_type: str or ~azure.mgmt.billing.models.CreditType
    :ivar date: The date of transaction.
    :vartype date: ~datetime.datetime
    :ivar discount: The percentage discount, if any, applied to this transaction.
    :vartype discount: float
    :ivar effective_price: The price of the product after applying any discounts.
    :vartype effective_price: ~azure.mgmt.billing.models.TransactionPropertiesEffectivePrice
    :ivar exchange_rate: The exchange rate used to convert charged amount to billing currency, if
     applicable.
    :vartype exchange_rate: float
    :ivar invoice: Invoice name on which the transaction was billed or 'Pending' if the transaction
     is not billed.
    :vartype invoice: str
    :ivar invoice_id: The fully qualified ID of the invoice on which the transaction was billed.
     This field is only applicable for transactions which are billed.
    :vartype invoice_id: str
    :ivar invoice_section_display_name: The name of the invoice section.
    :vartype invoice_section_display_name: str
    :ivar invoice_section_id: The fully qualified ID that uniquely identifies an invoice section.
    :vartype invoice_section_id: str
    :ivar is_third_party: Whether or not the transaction is third party.
    :vartype is_third_party: bool
    :ivar kind: Type of the transaction, billed or unbilled. Known values are: "Other", "All", and
     "Reservation".
    :vartype kind: str or ~azure.mgmt.billing.models.TransactionKind
    :ivar market_price: The retail price of the product.
    :vartype market_price: ~azure.mgmt.billing.models.TransactionPropertiesMarketPrice
    :ivar part_number: The part number of the product for which the transaction took place. The
     field is only applicable for Enterprise Agreement invoices.
    :vartype part_number: str
    :ivar pricing_currency: The ISO 4217 code for the currency in which the product is priced.
    :vartype pricing_currency: str
    :ivar product_description: The description of the product for which the transaction took place.
    :vartype product_description: str
    :ivar product_family: The family of the product for which the transaction took place.
    :vartype product_family: str
    :ivar product_type_id: The ID of the product type for which the transaction took place.
    :vartype product_type_id: str
    :ivar product_type: The type of the product for which the transaction took place.
    :vartype product_type: str
    :ivar quantity: The quantity purchased in the transaction.
    :vartype quantity: int
    :ivar reason_code: There reason code for the transaction.
    :vartype reason_code: str
    :ivar service_period_start_date: The date of the purchase of the product, or the start date of
     the month in which usage started.
    :vartype service_period_start_date: ~datetime.datetime
    :ivar service_period_end_date: The end date of the product term, or the end date of the month
     in which usage ended.
    :vartype service_period_end_date: ~datetime.datetime
    :ivar sub_total: The pre-tax charged amount for the transaction.
    :vartype sub_total: ~azure.mgmt.billing.models.TransactionPropertiesSubTotal
    :ivar tax: The tax amount applied to the transaction.
    :vartype tax: ~azure.mgmt.billing.models.TransactionPropertiesTax
    :ivar transaction_amount: The charge associated with the transaction.
    :vartype transaction_amount: ~azure.mgmt.billing.models.TransactionPropertiesTransactionAmount
    :ivar transaction_type: The type of transaction.
    :vartype transaction_type: str
    :ivar units: The number of units used for a given product.
    :vartype units: float
    :ivar unit_of_measure: The unit of measure used to bill for the product. For example, compute
     services are billed per hour.
    :vartype unit_of_measure: str
    :ivar unit_type: The description for the unit of measure for a given product.
    :vartype unit_type: str
    :ivar special_taxation_type: Identifies the type of tax calculation used for the invoice. The
     field is applicable only to invoices with special tax calculation logic. Known values are:
     "SubtotalLevel" and "InvoiceLevel".
    :vartype special_taxation_type: str or ~azure.mgmt.billing.models.SpecialTaxationType
    :ivar refund_transaction_details: The refund details of a transaction.
    :vartype refund_transaction_details:
     ~azure.mgmt.billing.models.TransactionPropertiesRefundTransactionDetails
    """

    azure_credit_applied: Optional["_models.TransactionPropertiesAzureCreditApplied"] = rest_field(
        name="azureCreditApplied", visibility=["read", "create", "update", "delete", "query"]
    )
    """The amount of any Azure credits automatically applied to this transaction."""
    azure_plan: Optional[str] = rest_field(name="azurePlan", visibility=["read", "create", "update", "delete", "query"])
    """Details of the Azure plan."""
    billing_currency: Optional[str] = rest_field(
        name="billingCurrency", visibility=["read", "create", "update", "delete", "query"]
    )
    """The ISO 4217 code for the currency in which this transaction is billed."""
    billing_profile_display_name: Optional[Any] = rest_field(
        name="billingProfileDisplayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the billing profile."""
    billing_profile_id: Optional[str] = rest_field(
        name="billingProfileId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The fully qualified ID that uniquely identifies a billing profile."""
    consumption_commitment_decremented: Optional["_models.TransactionPropertiesConsumptionCommitmentDecremented"] = (
        rest_field(name="consumptionCommitmentDecremented", visibility=["read", "create", "update", "delete", "query"])
    )
    """The amount of Microsoft Azure Consumption Commitment(MACC) decrement through the transaction."""
    customer_display_name: Optional[str] = rest_field(
        name="customerDisplayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the customer."""
    customer_id: Optional[str] = rest_field(
        name="customerId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The fully qualified ID that uniquely identifies a customer."""
    credit_type: Optional[Union[str, "_models.CreditType"]] = rest_field(
        name="creditType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The credit type of the transaction. Applies only to credited transactions. Known values are:
     \"Other\", \"AzureFreeCredit\", \"AzureCreditOffer\", \"ServiceInterruption\", and \"Refund\"."""
    date: Optional[datetime.datetime] = rest_field(
        visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The date of transaction."""
    discount: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The percentage discount, if any, applied to this transaction."""
    effective_price: Optional["_models.TransactionPropertiesEffectivePrice"] = rest_field(
        name="effectivePrice", visibility=["read", "create", "update", "delete", "query"]
    )
    """The price of the product after applying any discounts."""
    exchange_rate: Optional[float] = rest_field(
        name="exchangeRate", visibility=["read", "create", "update", "delete", "query"]
    )
    """The exchange rate used to convert charged amount to billing currency, if applicable."""
    invoice: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Invoice name on which the transaction was billed or 'Pending' if the transaction is not billed."""
    invoice_id: Optional[str] = rest_field(name="invoiceId", visibility=["read", "create", "update", "delete", "query"])
    """The fully qualified ID of the invoice on which the transaction was billed. This field is only
     applicable for transactions which are billed."""
    invoice_section_display_name: Optional[str] = rest_field(
        name="invoiceSectionDisplayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the invoice section."""
    invoice_section_id: Optional[str] = rest_field(
        name="invoiceSectionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The fully qualified ID that uniquely identifies an invoice section."""
    is_third_party: Optional[bool] = rest_field(
        name="isThirdParty", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether or not the transaction is third party."""
    kind: Optional[Union[str, "_models.TransactionKind"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the transaction, billed or unbilled. Known values are: \"Other\", \"All\", and
     \"Reservation\"."""
    market_price: Optional["_models.TransactionPropertiesMarketPrice"] = rest_field(
        name="marketPrice", visibility=["read", "create", "update", "delete", "query"]
    )
    """The retail price of the product."""
    part_number: Optional[str] = rest_field(
        name="partNumber", visibility=["read", "create", "update", "delete", "query"]
    )
    """The part number of the product for which the transaction took place. The field is only
     applicable for Enterprise Agreement invoices."""
    pricing_currency: Optional[str] = rest_field(
        name="pricingCurrency", visibility=["read", "create", "update", "delete", "query"]
    )
    """The ISO 4217 code for the currency in which the product is priced."""
    product_description: Optional[str] = rest_field(
        name="productDescription", visibility=["read", "create", "update", "delete", "query"]
    )
    """The description of the product for which the transaction took place."""
    product_family: Optional[str] = rest_field(
        name="productFamily", visibility=["read", "create", "update", "delete", "query"]
    )
    """The family of the product for which the transaction took place."""
    product_type_id: Optional[str] = rest_field(
        name="productTypeId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The ID of the product type for which the transaction took place."""
    product_type: Optional[str] = rest_field(
        name="productType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of the product for which the transaction took place."""
    quantity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The quantity purchased in the transaction."""
    reason_code: Optional[str] = rest_field(
        name="reasonCode", visibility=["read", "create", "update", "delete", "query"]
    )
    """There reason code for the transaction."""
    service_period_start_date: Optional[datetime.datetime] = rest_field(
        name="servicePeriodStartDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The date of the purchase of the product, or the start date of the month in which usage started."""
    service_period_end_date: Optional[datetime.datetime] = rest_field(
        name="servicePeriodEndDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The end date of the product term, or the end date of the month in which usage ended."""
    sub_total: Optional["_models.TransactionPropertiesSubTotal"] = rest_field(
        name="subTotal", visibility=["read", "create", "update", "delete", "query"]
    )
    """The pre-tax charged amount for the transaction."""
    tax: Optional["_models.TransactionPropertiesTax"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The tax amount applied to the transaction."""
    transaction_amount: Optional["_models.TransactionPropertiesTransactionAmount"] = rest_field(
        name="transactionAmount", visibility=["read", "create", "update", "delete", "query"]
    )
    """The charge associated with the transaction."""
    transaction_type: Optional[str] = rest_field(
        name="transactionType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of transaction."""
    units: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The number of units used for a given product."""
    unit_of_measure: Optional[str] = rest_field(
        name="unitOfMeasure", visibility=["read", "create", "update", "delete", "query"]
    )
    """The unit of measure used to bill for the product. For example, compute services are billed per
     hour."""
    unit_type: Optional[str] = rest_field(name="unitType", visibility=["read", "create", "update", "delete", "query"])
    """The description for the unit of measure for a given product."""
    special_taxation_type: Optional[Union[str, "_models.SpecialTaxationType"]] = rest_field(
        name="specialTaxationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Identifies the type of tax calculation used for the invoice. The field is applicable only to
     invoices with special tax calculation logic. Known values are: \"SubtotalLevel\" and
     \"InvoiceLevel\"."""
    refund_transaction_details: Optional["_models.TransactionPropertiesRefundTransactionDetails"] = rest_field(
        name="refundTransactionDetails", visibility=["read", "create", "update", "delete", "query"]
    )
    """The refund details of a transaction."""

    @overload
    def __init__(  # pylint: disable=too-many-locals
        self,
        *,
        azure_credit_applied: Optional["_models.TransactionPropertiesAzureCreditApplied"] = None,
        azure_plan: Optional[str] = None,
        billing_currency: Optional[str] = None,
        billing_profile_display_name: Optional[Any] = None,
        billing_profile_id: Optional[str] = None,
        consumption_commitment_decremented: Optional[
            "_models.TransactionPropertiesConsumptionCommitmentDecremented"
        ] = None,
        customer_display_name: Optional[str] = None,
        customer_id: Optional[str] = None,
        credit_type: Optional[Union[str, "_models.CreditType"]] = None,
        date: Optional[datetime.datetime] = None,
        discount: Optional[float] = None,
        effective_price: Optional["_models.TransactionPropertiesEffectivePrice"] = None,
        exchange_rate: Optional[float] = None,
        invoice: Optional[str] = None,
        invoice_id: Optional[str] = None,
        invoice_section_display_name: Optional[str] = None,
        invoice_section_id: Optional[str] = None,
        is_third_party: Optional[bool] = None,
        kind: Optional[Union[str, "_models.TransactionKind"]] = None,
        market_price: Optional["_models.TransactionPropertiesMarketPrice"] = None,
        part_number: Optional[str] = None,
        pricing_currency: Optional[str] = None,
        product_description: Optional[str] = None,
        product_family: Optional[str] = None,
        product_type_id: Optional[str] = None,
        product_type: Optional[str] = None,
        quantity: Optional[int] = None,
        reason_code: Optional[str] = None,
        service_period_start_date: Optional[datetime.datetime] = None,
        service_period_end_date: Optional[datetime.datetime] = None,
        sub_total: Optional["_models.TransactionPropertiesSubTotal"] = None,
        tax: Optional["_models.TransactionPropertiesTax"] = None,
        transaction_amount: Optional["_models.TransactionPropertiesTransactionAmount"] = None,
        transaction_type: Optional[str] = None,
        units: Optional[float] = None,
        unit_of_measure: Optional[str] = None,
        unit_type: Optional[str] = None,
        special_taxation_type: Optional[Union[str, "_models.SpecialTaxationType"]] = None,
        refund_transaction_details: Optional["_models.TransactionPropertiesRefundTransactionDetails"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class TransactionPropertiesAzureCreditApplied(Amount):
    """The amount of any Azure credits automatically applied to this transaction.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class TransactionPropertiesConsumptionCommitmentDecremented(Amount):  # pylint: disable=name-too-long
    """The amount of Microsoft Azure Consumption Commitment(MACC) decrement through the transaction.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class TransactionPropertiesEffectivePrice(Amount):
    """The price of the product after applying any discounts.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class TransactionPropertiesMarketPrice(Amount):
    """The retail price of the product.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class TransactionPropertiesRefundTransactionDetails(RefundTransactionDetails):  # pylint: disable=name-too-long
    """The refund details of a transaction.

    :ivar amount_requested: The amount of refund requested.
    :vartype amount_requested: ~azure.mgmt.billing.models.RefundTransactionDetailsAmountRequested
    :ivar amount_refunded: The amount refunded.
    :vartype amount_refunded: ~azure.mgmt.billing.models.RefundTransactionDetailsAmountRefunded
    :ivar refund_operation_id: The ID of refund operation.
    :vartype refund_operation_id: str
    """

    @overload
    def __init__(
        self,
        *,
        amount_requested: Optional["_models.RefundTransactionDetailsAmountRequested"] = None,
        amount_refunded: Optional["_models.RefundTransactionDetailsAmountRefunded"] = None,
        refund_operation_id: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class TransactionPropertiesSubTotal(Amount):
    """The pre-tax charged amount for the transaction.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class TransactionPropertiesTax(Amount):
    """The tax amount applied to the transaction.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class TransactionPropertiesTransactionAmount(Amount):
    """The charge associated with the transaction.

    :ivar currency: The currency for the amount value.
    :vartype currency: str
    :ivar value: The amount value. For example, if the currency is USD, then a value of 600 would
     be $600.00.
    :vartype value: float
    """


class TransactionSummary(_Model):
    """A transaction summary.

    :ivar azure_credit_applied: The total amount of any Azure credits applied.
    :vartype azure_credit_applied: float
    :ivar billing_currency: The ISO 4217 code for the currency in which the transactions are
     billed.
    :vartype billing_currency: str
    :ivar consumption_commitment_decremented: The total Microsoft Azure Consumption Commitment
     (MACC) decrement through the invoice.
    :vartype consumption_commitment_decremented: float
    :ivar sub_total: The total pre-tax charged amount.
    :vartype sub_total: float
    :ivar tax: The total tax amount applied.
    :vartype tax: float
    :ivar total: The total charges.
    :vartype total: float
    """

    azure_credit_applied: Optional[float] = rest_field(name="azureCreditApplied", visibility=["read"])
    """The total amount of any Azure credits applied."""
    billing_currency: Optional[str] = rest_field(name="billingCurrency", visibility=["read"])
    """The ISO 4217 code for the currency in which the transactions are billed."""
    consumption_commitment_decremented: Optional[float] = rest_field(
        name="consumptionCommitmentDecremented", visibility=["read"]
    )
    """The total Microsoft Azure Consumption Commitment (MACC) decrement through the invoice."""
    sub_total: Optional[float] = rest_field(name="subTotal", visibility=["read"])
    """The total pre-tax charged amount."""
    tax: Optional[float] = rest_field(visibility=["read"])
    """The total tax amount applied."""
    total: Optional[float] = rest_field(visibility=["read"])
    """The total charges."""


class TransferDetails(ProxyResource):
    """Details of the transfer.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.billing.models.SystemData
    :ivar properties: Details of the transfer.
    :vartype properties: ~azure.mgmt.billing.models.TransferProperties
    :ivar tags: Dictionary of metadata associated with the resource. It may not be populated for
     all resource types. Maximum key/value length supported of 256 characters. Keys/value should not
     empty value nor null. Keys can not contain < > % & \\ ? /.
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.TransferProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Details of the transfer."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of metadata associated with the resource. It may not be populated for all resource
     types. Maximum key/value length supported of 256 characters. Keys/value should not empty value
     nor null. Keys can not contain < > % & \\ ? /."""

    __flattened_items = [
        "expiration_time",
        "transfer_status",
        "recipient_email_id",
        "initiator_email_id",
        "canceled_by",
        "detailed_transfer_status",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.TransferProperties"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class TransferError(_Model):
    """Error details for transfer execution.

    :ivar code: Error code.
    :vartype code: str
    :ivar message: Error message.
    :vartype message: str
    """

    code: Optional[str] = rest_field(visibility=["read"])
    """Error code."""
    message: Optional[str] = rest_field(visibility=["read"])
    """Error message."""


class TransferProperties(_Model):
    """Transfer details.

    :ivar expiration_time: The time at which the transfer request expires.
    :vartype expiration_time: ~datetime.datetime
    :ivar transfer_status: Overall transfer status. Known values are: "Expired", "Pending",
     "InProgress", "Completed", "CompletedWithErrors", "Failed", "Canceled", and "Declined".
    :vartype transfer_status: str or ~azure.mgmt.billing.models.TransferStatus
    :ivar recipient_email_id: The email ID of the user to whom the transfer request was sent.
    :vartype recipient_email_id: str
    :ivar initiator_email_id: The email ID of the user who sent the transfer request.
    :vartype initiator_email_id: str
    :ivar canceled_by: The email ID of the user who canceled the transfer request.
    :vartype canceled_by: str
    :ivar detailed_transfer_status: Detailed transfer status.
    :vartype detailed_transfer_status: list[~azure.mgmt.billing.models.DetailedTransferStatus]
    """

    expiration_time: Optional[datetime.datetime] = rest_field(
        name="expirationTime", visibility=["read"], format="rfc3339"
    )
    """The time at which the transfer request expires."""
    transfer_status: Optional[Union[str, "_models.TransferStatus"]] = rest_field(
        name="transferStatus", visibility=["read"]
    )
    """Overall transfer status. Known values are: \"Expired\", \"Pending\", \"InProgress\",
     \"Completed\", \"CompletedWithErrors\", \"Failed\", \"Canceled\", and \"Declined\"."""
    recipient_email_id: Optional[str] = rest_field(name="recipientEmailId", visibility=["read"])
    """The email ID of the user to whom the transfer request was sent."""
    initiator_email_id: Optional[str] = rest_field(name="initiatorEmailId", visibility=["read"])
    """The email ID of the user who sent the transfer request."""
    canceled_by: Optional[str] = rest_field(name="canceledBy", visibility=["read"])
    """The email ID of the user who canceled the transfer request."""
    detailed_transfer_status: Optional[list["_models.DetailedTransferStatus"]] = rest_field(
        name="detailedTransferStatus", visibility=["read"]
    )
    """Detailed transfer status."""


class TransitionDetails(_Model):
    """The details for a billing account transitioned from agreement type Microsoft Online Services
    Program to agreement type Microsoft Customer Agreement.

    :ivar transition_date: The transition completion date.
    :vartype transition_date: ~datetime.datetime
    :ivar anniversary_day: The anniversary day of the pre-transitioned account of type Microsoft
     Online Services Program.
    :vartype anniversary_day: int
    """

    transition_date: Optional[datetime.datetime] = rest_field(
        name="transitionDate", visibility=["read"], format="rfc3339"
    )
    """The transition completion date."""
    anniversary_day: Optional[int] = rest_field(name="anniversaryDay", visibility=["read"])
    """The anniversary day of the pre-transitioned account of type Microsoft Online Services Program."""


class Utilization(_Model):
    """Savings plan utilization.

    :ivar trend: The trend for a savings plan's utilization.
    :vartype trend: str
    :ivar aggregates: The array of aggregates of a savings plan's utilization.
    :vartype aggregates: list[~azure.mgmt.billing.models.UtilizationAggregates]
    """

    trend: Optional[str] = rest_field(visibility=["read"])
    """The trend for a savings plan's utilization."""
    aggregates: Optional[list["_models.UtilizationAggregates"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The array of aggregates of a savings plan's utilization."""

    @overload
    def __init__(
        self,
        *,
        aggregates: Optional[list["_models.UtilizationAggregates"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class UtilizationAggregates(_Model):
    """The aggregate values of savings plan utilization.

    :ivar grain: The grain of the aggregate.
    :vartype grain: float
    :ivar grain_unit: The grain unit of the aggregate.
    :vartype grain_unit: str
    :ivar value: The aggregate value.
    :vartype value: float
    :ivar value_unit: The aggregate value unit.
    :vartype value_unit: str
    """

    grain: Optional[float] = rest_field(visibility=["read"])
    """The grain of the aggregate."""
    grain_unit: Optional[str] = rest_field(name="grainUnit", visibility=["read"])
    """The grain unit of the aggregate."""
    value: Optional[float] = rest_field(visibility=["read"])
    """The aggregate value."""
    value_unit: Optional[str] = rest_field(name="valueUnit", visibility=["read"])
    """The aggregate value unit."""


class ValidateTransferListResponse(_Model):
    """Result of transfer validation.

    :ivar value: The list of transfer validation results.
    :vartype value: list[~azure.mgmt.billing.models.ValidateTransferResponse]
    """

    value: Optional[list["_models.ValidateTransferResponse"]] = rest_field(visibility=["read"])
    """The list of transfer validation results."""


class ValidateTransferResponse(_Model):
    """Transfer validation response.

    :ivar properties: The properties of transfer validation response.
    :vartype properties: ~azure.mgmt.billing.models.ValidateTransferResponseProperties
    """

    properties: Optional["_models.ValidateTransferResponseProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of transfer validation response."""

    __flattened_items = ["status", "product_id", "results"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ValidateTransferResponseProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class ValidateTransferResponseProperties(_Model):
    """The properties of transfer validation response.

    :ivar status: The status of validation.
    :vartype status: str
    :ivar product_id: The product id for which this result applies.
    :vartype product_id: str
    :ivar results: The array of validation results.
    :vartype results: list[~azure.mgmt.billing.models.ValidationResultProperties]
    """

    status: Optional[str] = rest_field(visibility=["read"])
    """The status of validation."""
    product_id: Optional[str] = rest_field(name="productId", visibility=["read"])
    """The product id for which this result applies."""
    results: Optional[list["_models.ValidationResultProperties"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The array of validation results."""

    @overload
    def __init__(
        self,
        *,
        results: Optional[list["_models.ValidationResultProperties"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ValidationResultProperties(_Model):
    """The properties of the validation result.

    :ivar level: Result Level.
    :vartype level: str
    :ivar code: Result Code.
    :vartype code: str
    :ivar message: The validation message.
    :vartype message: str
    """

    level: Optional[str] = rest_field(visibility=["read"])
    """Result Level."""
    code: Optional[str] = rest_field(visibility=["read"])
    """Result Code."""
    message: Optional[str] = rest_field(visibility=["read"])
    """The validation message."""
