# This file was auto-generated by Fern from our API Definition.

from ..core.unchecked_base_model import UncheckedBaseModel
from .loyalty_promotion_incentive_type import LoyaltyPromotionIncentiveType
import pydantic
import typing
from .loyalty_promotion_incentive_points_multiplier_data import LoyaltyPromotionIncentivePointsMultiplierData
from .loyalty_promotion_incentive_points_addition_data import LoyaltyPromotionIncentivePointsAdditionData
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class LoyaltyPromotionIncentive(UncheckedBaseModel):
    """
    Represents how points for a [loyalty promotion](entity:LoyaltyPromotion) are calculated,
    either by multiplying the points earned from the base program or by adding a specified number
    of points to the points earned from the base program.
    """

    type: LoyaltyPromotionIncentiveType = pydantic.Field()
    """
    The type of points incentive.
    See [LoyaltyPromotionIncentiveType](#type-loyaltypromotionincentivetype) for possible values
    """

    points_multiplier_data: typing.Optional[LoyaltyPromotionIncentivePointsMultiplierData] = pydantic.Field(
        default=None
    )
    """
    Additional data for a `POINTS_MULTIPLIER` incentive type.
    """

    points_addition_data: typing.Optional[LoyaltyPromotionIncentivePointsAdditionData] = pydantic.Field(default=None)
    """
    Additional data for a `POINTS_ADDITION` incentive type.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
