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

import typing_extensions
from ..types.loyalty_event_type import LoyaltyEventType
import typing_extensions
from .loyalty_event_accumulate_points import LoyaltyEventAccumulatePointsParams
from .loyalty_event_create_reward import LoyaltyEventCreateRewardParams
from .loyalty_event_redeem_reward import LoyaltyEventRedeemRewardParams
from .loyalty_event_delete_reward import LoyaltyEventDeleteRewardParams
from .loyalty_event_adjust_points import LoyaltyEventAdjustPointsParams
from ..types.loyalty_event_source import LoyaltyEventSource
from .loyalty_event_expire_points import LoyaltyEventExpirePointsParams
from .loyalty_event_other import LoyaltyEventOtherParams
from .loyalty_event_accumulate_promotion_points import LoyaltyEventAccumulatePromotionPointsParams


class LoyaltyEventParams(typing_extensions.TypedDict):
    """
    Provides information about a loyalty event.
    For more information, see [Search for Balance-Changing Loyalty Events](https://developer.squareup.com/docs/loyalty-api/loyalty-events).
    """

    id: str
    """
    The Square-assigned ID of the loyalty event.
    """

    type: LoyaltyEventType
    """
    The type of the loyalty event.
    See [LoyaltyEventType](#type-loyaltyeventtype) for possible values
    """

    created_at: str
    """
    The timestamp when the event was created, in RFC 3339 format.
    """

    accumulate_points: typing_extensions.NotRequired[LoyaltyEventAccumulatePointsParams]
    """
    Provides metadata when the event `type` is `ACCUMULATE_POINTS`.
    """

    create_reward: typing_extensions.NotRequired[LoyaltyEventCreateRewardParams]
    """
    Provides metadata when the event `type` is `CREATE_REWARD`.
    """

    redeem_reward: typing_extensions.NotRequired[LoyaltyEventRedeemRewardParams]
    """
    Provides metadata when the event `type` is `REDEEM_REWARD`.
    """

    delete_reward: typing_extensions.NotRequired[LoyaltyEventDeleteRewardParams]
    """
    Provides metadata when the event `type` is `DELETE_REWARD`.
    """

    adjust_points: typing_extensions.NotRequired[LoyaltyEventAdjustPointsParams]
    """
    Provides metadata when the event `type` is `ADJUST_POINTS`.
    """

    loyalty_account_id: str
    """
    The ID of the [loyalty account](entity:LoyaltyAccount) associated with the event.
    """

    location_id: typing_extensions.NotRequired[str]
    """
    The ID of the [location](entity:Location) where the event occurred.
    """

    source: LoyaltyEventSource
    """
    Defines whether the event was generated by the Square Point of Sale.
    See [LoyaltyEventSource](#type-loyaltyeventsource) for possible values
    """

    expire_points: typing_extensions.NotRequired[LoyaltyEventExpirePointsParams]
    """
    Provides metadata when the event `type` is `EXPIRE_POINTS`.
    """

    other_event: typing_extensions.NotRequired[LoyaltyEventOtherParams]
    """
    Provides metadata when the event `type` is `OTHER`.
    """

    accumulate_promotion_points: typing_extensions.NotRequired[LoyaltyEventAccumulatePromotionPointsParams]
    """
    Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`.
    """
