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

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

from pydantic import Field as FieldInfo

from .media import Media
from .account import Account
from ..category import Category
from .promotion import Promotion
from ...._models import BaseModel
from .media_image import MediaImage
from .product_type import ProductType
from .rush_settings import RushSettings
from .shows.showtime import Showtime
from .customers.theater import Theater
from .minified_location import MinifiedLocation
from .shows.admission_type import AdmissionType
from .carts.currency_object import CurrencyObject
from .shows.lottery_settings import LotterySettings
from .customers.social_share_config import SocialShareConfig

__all__ = [
    "Show",
    "Area",
    "Filter",
    "FilterOptions",
    "Genre",
    "Metadata",
    "Rewards",
    "RunningTime",
    "SeatingChart",
    "TicketsThisWeek",
]


class Area(BaseModel):
    id: Optional[int] = None
    """Numeric identifier for a resource"""

    api_type: Optional[str] = FieldInfo(alias="_type", default=None)

    name: Optional[str] = None
    """Display name"""

    url: Optional[str] = None
    """the url that the linked page can be accessed with"""


class FilterOptions(BaseModel):
    max_price: CurrencyObject = FieldInfo(alias="maxPrice")
    """The maximum value of the range. Null if the range goes to infinity."""

    min_price: CurrencyObject = FieldInfo(alias="minPrice")
    """The minimum value of the range. Null if the range goes to 0."""

    name: str

    subtitle: str

    api_type: Optional[str] = FieldInfo(alias="_type", default=None)


class Filter(BaseModel):
    api_type: str = FieldInfo(alias="_type")

    options: FilterOptions
    """A range of values for filtering prices"""


class Genre(BaseModel):
    id: Optional[int] = None
    """Numeric identifier for a resource"""

    api_type: Optional[str] = FieldInfo(alias="_type", default=None)

    name: Optional[str] = None
    """Display name"""


class Metadata(BaseModel):
    about: str
    """A longer description about the show. Required."""

    savings_message: str = FieldInfo(alias="savingsMessage")
    """
    Message displayed in the basket about the total amount of money the customer is
    saving
    """

    short_description: str = FieldInfo(alias="shortDescription")
    """A short description about the show. Required."""

    additional_email_text: Optional[str] = FieldInfo(alias="additionalEmailText", default=None)
    """Ad-hoc HTML for additional info needed in emails."""

    age_description: Optional[str] = FieldInfo(alias="ageDescription", default=None)
    """A recommendation for age appropriateness."""

    cancellation_hours_after_purchase: Optional[int] = FieldInfo(alias="cancellationHoursAfterPurchase", default=None)
    """The window in hours after the purchase the customers can cancel their order."""

    display_seated_together: Optional[bool] = FieldInfo(alias="displaySeatedTogether", default=None)
    """
    Whether to inform customers that they are guaranteed to be seated together (not
    applicable in the case of General Admission, etc.)
    """

    exchange_hours_before_showtime: Optional[int] = FieldInfo(alias="exchangeHoursBeforeShowtime", default=None)
    """
    Number of hours before a showtime where an exchange voucher can be issued by the
    chatbot
    """

    optional_text: Optional[str] = FieldInfo(alias="optionalText", default=None)
    """Optional text for special info in the checkout flow."""

    optional_title: Optional[str] = FieldInfo(alias="optionalTitle", default=None)
    """Optional title for special info in the checkout flow."""

    override_cancellation_policy_text: Optional[str] = FieldInfo(alias="overrideCancellationPolicyText", default=None)
    """Optional text to override the default cancellation policy"""

    presale_hero_text: Optional[str] = FieldInfo(alias="presaleHeroText", default=None)
    """Hero text for shows available for presale."""

    presale_text: Optional[str] = FieldInfo(alias="presaleText", default=None)
    """Body text for shows available for presale."""

    presale_title: Optional[str] = FieldInfo(alias="presaleTitle", default=None)
    """Title for shows available for presale."""

    special_note: Optional[str] = FieldInfo(alias="specialNote", default=None)
    """A special note to be tied a particular show."""

    today_tix_take: Optional[str] = FieldInfo(alias="todayTixTake", default=None)
    """A CMS-generated synopsis of the show, for SEO purposes."""

    what_to_watch_for: Optional[List[str]] = FieldInfo(alias="whatToWatchFor", default=None)
    """A list of facts about the show, for SEO purposes."""


class Rewards(BaseModel):
    max_amount: Optional[float] = FieldInfo(alias="maxAmount", default=None)
    """
    The maximum rewards amount (percentage) among all showtimes, represented as
    BigDecimal value rounded to scale 2.
    """

    type: Optional[Literal["BOOSTED", "DEFAULT"]] = None
    """Types of rewards depending on the way the rewards amount was set."""


class RunningTime(BaseModel):
    display: Optional[str] = None
    """The running time text to display in extended show info."""

    total_running_minutes: Optional[int] = FieldInfo(alias="totalRunningMinutes", default=None)
    """The number of minutes that a show runs (including intermission)."""


class SeatingChart(BaseModel):
    id: Optional[int] = None
    """Numeric identifier for a resource"""

    api_type: Optional[str] = FieldInfo(alias="_type", default=None)

    alternative_url: Optional[str] = FieldInfo(alias="alternativeUrl", default=None)
    """A link points to an external resource. For images we using IMGX.

    To get the right size see link "https://docs.imgix.com/apis/url/size"
    """

    url: Optional[str] = None
    """A link points to an external resource. For images we using IMGX.

    To get the right size see link "https://docs.imgix.com/apis/url/size"
    """


class TicketsThisWeek(BaseModel):
    day_of_week: str = FieldInfo(alias="dayOfWeek")

    has_tickets: bool = FieldInfo(alias="hasTickets")


class Show(BaseModel):
    id: int
    """Numeric identifier for a resource"""

    api_type: Literal["ShowHeroEssentials", "Show"] = FieldInfo(alias="_type")
    """(non-null, const)"""

    location_id: int = FieldInfo(alias="locationId")
    """Numeric identifier for a resource"""

    lottery_settings: LotterySettings = FieldInfo(alias="lotterySettings")

    name: str

    product_type: ProductType = FieldInfo(alias="productType")
    """The type of show being sold (Attraction, Show, Streaming and Bus Tour)"""

    rush_settings: RushSettings = FieldInfo(alias="rushSettings")

    showtimes: List[Showtime]
    """
    An array of showtimes (non-null, could be empty list). Not included if fieldset
    is `HeroSuperEssentials`
    """

    theater: Theater

    about: Optional[str] = None
    """A description of the show"""

    account: Optional[Account] = None
    """TodayTix partner account"""

    admission_type: Optional[AdmissionType] = FieldInfo(alias="admissionType", default=None)
    """
    The type of admission allowed for the Show. TIMED = regular theater performance,
    e.g. on date X at time Y. DATED = open-ended admission on a specific date, like
    a museum. OPEN = open-ended admission on any date, like a streamed performance.
    """

    age_description: Optional[str] = FieldInfo(alias="ageDescription", default=None)
    """A free-form text field describing the age appropriateness of the show."""

    areas: Optional[List[Area]] = None

    are_lottery_tickets_available: Optional[bool] = FieldInfo(alias="areLotteryTicketsAvailable", default=None)

    are_regular_tickets_available: Optional[bool] = FieldInfo(alias="areRegularTicketsAvailable", default=None)

    are_rush_tickets_available: Optional[bool] = FieldInfo(alias="areRushTicketsAvailable", default=None)

    available_promotion_description: Optional[str] = FieldInfo(alias="availablePromotionDescription", default=None)
    """
    The description of a Promotion that is associated with this show. Only returned
    if there is at least 1 promotional allocation available for the show right now.
    """

    avg_rating: Optional[float] = FieldInfo(alias="avgRating", default=None)
    """The average customer rating for this show (from 1 to 5 stars)."""

    carousel_media: Optional[List[Media]] = FieldInfo(alias="carouselMedia", default=None)

    category: Optional[Category] = None
    """Category of product, e.g. Musicals, Plays, Concerts"""

    closing_datetime: Optional[datetime] = FieldInfo(alias="closingDatetime", default=None)
    """
    The show is closed after this timestamp. If null, the show's closing datetime is
    unknown and will be considered running forever.
    """

    display_seated_together: Optional[bool] = FieldInfo(alias="displaySeatedTogether", default=None)
    """
    Whether to inform customers that they are guaranteed to be seated together (not
    applicable in the case of General Admission, etc.)
    """

    filters: Optional[List[Filter]] = None
    """array of filters"""

    genres: Optional[List[Genre]] = None

    hero_media: Optional[MediaImage] = FieldInfo(alias="heroMedia", default=None)
    """\\__type = Image"""

    is_lottery_active: Optional[bool] = FieldInfo(alias="isLotteryActive", default=None)
    """
    Whether or not lottery is supported for this show, i.e., if the show has an
    active lotterySetting. N.B. `isLotteryActive` can be true even if
    `areLotteryTicketsAvailable` is false.
    """

    is_pyos: Optional[bool] = FieldInfo(alias="isPyos", default=None)
    """True if customers can pick their own seats for this Show, or false otherwise."""

    is_rush_active: Optional[bool] = FieldInfo(alias="isRushActive", default=None)
    """
    Whether or not rush is supported for this show, i.e., if the show has an active
    rushSetting. N.B. `isRushActive` can be true even if `areRushTicketsAvailable`
    is false.
    """

    is_two_parts: Optional[bool] = FieldInfo(alias="isTwoParts", default=None)
    """
    Whether or not this show is presented in 2 parts. If true, we alter the Calendar
    UI to support a 2-part purchase. N.B. This is intended only for Harry Potter and
    the Cursed Child regular tickets (for BOTH Part 1 & Part 2, together only).
    """

    location: Optional[MinifiedLocation] = None
    """Object representing a subset of properties of a 'Location' object."""

    low_price_for_lottery_tickets: Optional[CurrencyObject] = FieldInfo(alias="lowPriceForLotteryTickets", default=None)

    low_price_for_regular_tickets: Optional[CurrencyObject] = FieldInfo(alias="lowPriceForRegularTickets", default=None)

    low_price_for_rush_tickets: Optional[CurrencyObject] = FieldInfo(alias="lowPriceForRushTickets", default=None)

    marketable_locations: Optional[List[MinifiedLocation]] = FieldInfo(alias="marketableLocations", default=None)

    max_discount: Optional[int] = FieldInfo(alias="maxDiscount", default=None)
    """
    The maximum percentage discount available for regular tickets across all
    available showtimes.
    """

    metadata: Optional[Metadata] = None

    performance_dates: Optional[List[date]] = FieldInfo(alias="performanceDates", default=None)
    """The list of calendar dates that have performances."""

    poster_media: Optional[MediaImage] = FieldInfo(alias="posterMedia", default=None)
    """\\__type = Image"""

    presale_text: Optional[str] = FieldInfo(alias="presaleText", default=None)
    """A description that may be shown on shows for which presaleShowtimes is true."""

    promotion: Optional[Promotion] = None

    promotion_label: Optional[str] = FieldInfo(alias="promotionLabel", default=None)
    """
    The promotionLabel that is associated with this show. Only returned if there is
    at least 1 promotional allocation available for the show right now.
    """

    rating_count: Optional[float] = FieldInfo(alias="ratingCount", default=None)
    """The total count of ratings received for this show."""

    related_shows: Optional[List[int]] = FieldInfo(alias="relatedShows", default=None)
    """array of related shows"""

    rewards: Optional[Rewards] = None

    running_time: Optional[RunningTime] = FieldInfo(alias="runningTime", default=None)
    """
    The running time of a production, described in hours and/or minutes, and
    number/length of intermission(s). Note that shows may choose to describe their
    run time in terms of ONLY minutes (i.e. 90 minutes), rather than a combination
    of hours and minutes. The sum of the `hours` and `minutes` fields should equal
    the total runtime.
    """

    seating_chart: Optional[SeatingChart] = FieldInfo(alias="seatingChart", default=None)
    """Currently app supports 3 types of seating charts:

    - `csv` (will be deprecated)
    - `png`
    - `html` (could contain svg inside)
    """

    share_config: Optional[SocialShareConfig] = FieldInfo(alias="shareConfig", default=None)

    short_description: Optional[str] = FieldInfo(alias="shortDescription", default=None)

    short_name: Optional[str] = FieldInfo(alias="shortName", default=None)

    should_show_promotions_on_cards: Optional[str] = FieldInfo(alias="shouldShowPromotionsOnCards", default=None)
    """
    Flag to indicates whether promo highlights should be displayed on show cards on
    web and apps.
    """

    show_group_id: Optional[int] = FieldInfo(alias="showGroupId", default=None)
    """Numeric identifier for a resource"""

    show_group_name: Optional[str] = FieldInfo(alias="showGroupName", default=None)

    special_note: Optional[str] = FieldInfo(alias="specialNote", default=None)
    """Special notes signify any cast changes, included drink vouchers, etc.

    Displayed in Show Info Card on Show Details
    """

    starting_datetime: Optional[datetime] = FieldInfo(alias="startingDatetime", default=None)
    """
    "Right now, this is a cosmetic starting date that will be displayed on the Show
    Details page/screen. If null, the show's opening datetime is unknown."
    """

    subcategories: Optional[List[Category]] = None
    """array of subcategories"""

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

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

    tickets_this_week: Optional[List[TicketsThisWeek]] = FieldInfo(alias="ticketsThisWeek", default=None)

    timezone: Optional[str] = None
    """Timezone e.g. America/New_York, Europe/London (ISO)"""

    today_tix_take: Optional[str] = FieldInfo(alias="todayTixTake", default=None)
    """A plaintext editorial developed in-house for a given Show."""

    tour_id: Optional[float] = FieldInfo(alias="tourId", default=None)
    """DEPRECATED. Tour that is associated with the show (nullable)"""

    two_part_show_description: Optional[str] = FieldInfo(alias="twoPartShowDescription", default=None)
    """Text describing showtimes for a show with two parts.

    Currently, it is used only for Harry Potter and is hardcoded on platform.
    """

    v1_concierge_image: Optional[MediaImage] = FieldInfo(alias="v1ConciergeImage", default=None)
    """\\__type = Image"""

    v1_has_where_my_seats: Optional[bool] = FieldInfo(alias="v1HasWhereMySeats", default=None)
    """Whether show contains whereAreMySeats text"""

    v1_instruction_text: Optional[str] = FieldInfo(alias="v1InstructionText", default=None)
    """
    Instruction text how to pickup tickets. Display on checkout page in the end of
    screen.
    """

    v1_is_concierge: Optional[bool] = FieldInfo(alias="v1IsConcierge", default=None)
    """Whether show is concierge"""

    venue_chart_key: Optional[str] = FieldInfo(alias="venueChartKey", default=None)
    """The key that associates the In House chart to this show."""

    what_to_watch_for: Optional[List[str]] = FieldInfo(alias="whatToWatchFor", default=None)
    """
    An array of strings that account managers can configure to highlight notable
    aspects of a show. If not configured, this defaults to empty list.

    NOTE: if this property grows to require more in the response than the string
    itself, this should be refactored out into a `WhatToWatchFor` model definition.
    """
