# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Optional
from datetime import date
from typing_extensions import Literal, TypeAlias

from pydantic import Field as FieldInfo

from ...._models import BaseModel
from .rewards_tier_map import RewardsTierMap

__all__ = [
    "CustomerRetrieveRewardsSummaryResponse",
    "CustomerRetrieveRewardsSummaryResponseItem",
    "CustomerRetrieveRewardsSummaryResponseItemTier",
    "CustomerRetrieveRewardsSummaryResponseItemTierBenefits",
    "CustomerRetrieveRewardsSummaryResponseItemUnlockMessagesByNumTickets",
]


class CustomerRetrieveRewardsSummaryResponseItemTierBenefits(BaseModel):
    can_earn_again_this_year: Optional[bool] = FieldInfo(alias="canEarnAgainThisYear", default=None)
    """Indicates whether the benefit can be earned again within the current year"""

    description: Optional[str] = None
    """The description of the benefit"""

    expiration_date: Optional[date] = FieldInfo(alias="expirationDate", default=None)
    """The expiration date of this benefit"""

    expiration_type: Optional[Literal["TIER", "VOUCHER", "BENEFIT_RECORD"]] = FieldInfo(
        alias="expirationType", default=None
    )

    icon: Optional[str] = None
    """The URL of the icon for this benefit"""

    is_earned_for_current_year: Optional[bool] = FieldInfo(alias="isEarnedForCurrentYear", default=None)
    """Indicates whether the benefit is earned for the current year"""

    is_featured: Optional[bool] = FieldInfo(alias="isFeatured", default=None)
    """Whether this benefit is featured"""

    is_unlocked: Optional[bool] = FieldInfo(alias="isUnlocked", default=None)
    """Indicates whether the benefit should be presented as locked/unlocked."""

    name: Optional[str] = None
    """The name of the benefit"""

    short_description: Optional[str] = FieldInfo(alias="shortDescription", default=None)
    """A short description of the benefit"""


class CustomerRetrieveRewardsSummaryResponseItemTier(BaseModel):
    id: Optional[int] = None
    """The ID of the rewards tier"""

    benefits: Optional[CustomerRetrieveRewardsSummaryResponseItemTierBenefits] = None
    """Map of a reward benefit"""

    color: Optional[str] = None
    """Color in hex "FFFFFF" | "FFF" (nullable, valid hex color)"""

    gradient_colors: Optional[List[str]] = FieldInfo(alias="gradientColors", default=None)

    is_earned_for_current_year: Optional[bool] = FieldInfo(alias="isEarnedForCurrentYear", default=None)
    """Whether this tier is earned for the current year"""

    is_earned_for_next_year: Optional[bool] = FieldInfo(alias="isEarnedForNextYear", default=None)
    """Whether this tier is earned for the next year"""

    max_tickets_purchased: Optional[int] = FieldInfo(alias="maxTicketsPurchased", default=None)
    """The maximum number of tickets a user purchases to stay in this tier"""

    min_tickets_purchased: Optional[int] = FieldInfo(alias="minTicketsPurchased", default=None)
    """The minimum number of tickets required to reach this tier"""

    name: Optional[str] = None
    """The name of the rewards tier"""


class CustomerRetrieveRewardsSummaryResponseItemUnlockMessagesByNumTickets(BaseModel):
    gradient_colors: Optional[List[str]] = FieldInfo(alias="gradientColors", default=None)

    message: Optional[str] = None
    """
    Rewards message shown to the customer before they complete their purchase. This
    message previews the tier and benefits they are about to unlock.
    """

    post_purchase_message1: Optional[str] = FieldInfo(alias="postPurchaseMessage1", default=None)
    """
    Rewards message title shown to the customer after they complete their purchase.
    This title indicates the next tier the customer will earn after the show.
    """

    post_purchase_message2: Optional[str] = FieldInfo(alias="postPurchaseMessage2", default=None)
    """
    Rewards message body shown to the customer after they complete their purchase.
    This message indicates the next tier the customer will earn after the show.
    """

    rewards_next_tier_message: Optional[str] = FieldInfo(alias="rewardsNextTierMessage", default=None)
    """
    Rewards message body shown to the customer after they complete their purchase.
    This message indicates the next tier the customer will earn after the show.
    """

    rewards_next_tier_title: Optional[str] = FieldInfo(alias="rewardsNextTierTitle", default=None)
    """
    Rewards message title shown to the customer after they complete their purchase.
    This title indicates the next tier the customer will earn after the show.
    """

    unlock_rewards_tier_message: Optional[str] = FieldInfo(alias="unlockRewardsTierMessage", default=None)
    """
    Informational message shown to the customer about their current rewards tier
    progress. This refers to either unlocking a new tier or maintaining a tier
    earned in the previous year.
    """

    unlock_rewards_tier_title: Optional[str] = FieldInfo(alias="unlockRewardsTierTitle", default=None)
    """
    Informational title shown to the customer about their current rewards tier
    progress. This refers to either unlocking a new tier or maintaining a tier
    earned in the previous year.
    """


class CustomerRetrieveRewardsSummaryResponseItem(BaseModel):
    can_access_exclusive_deals: Optional[bool] = FieldInfo(alias="canAccessExclusiveDeals", default=None)

    current_tier: Optional[RewardsTierMap] = FieldInfo(alias="currentTier", default=None)
    """Map of a single rewards tier, not specific to a customer"""

    earned_tier: Optional[RewardsTierMap] = FieldInfo(alias="earnedTier", default=None)
    """Map of a single rewards tier, not specific to a customer"""

    num_pending_tickets: Optional[int] = FieldInfo(alias="numPendingTickets", default=None)
    """
    The number of purchased tickets that are eligible for rewards but not yet
    reflected in the customer's status
    """

    num_tickets_purchased_this_year: Optional[int] = FieldInfo(alias="numTicketsPurchasedThisYear", default=None)
    """The number of tickets purchased this year"""

    profile_tagline: Optional[str] = FieldInfo(alias="profileTagline", default=None)
    """A rewards-related tagline to display with the customer's profile"""

    tiers: Optional[List[CustomerRetrieveRewardsSummaryResponseItemTier]] = None

    unlock_messages_by_num_tickets: Optional[CustomerRetrieveRewardsSummaryResponseItemUnlockMessagesByNumTickets] = (
        FieldInfo(alias="unlockMessagesByNumTickets", default=None)
    )
    """
    Provides the messages displayed throughout the purchase journey informing the
    customer that the selected quantity for their purchase will cause them to unlock
    a particular tier.
    """


CustomerRetrieveRewardsSummaryResponse: TypeAlias = List[CustomerRetrieveRewardsSummaryResponseItem]
