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

from typing import List, Optional
from typing_extensions import TypeAlias

from pydantic import Field as FieldInfo

from ..rewards import Rewards
from ....._models import BaseModel
from .fee_summary import FeeSummary
from ..carts.currency_object import CurrencyObject

__all__ = [
    "ShowtimeRetrieveInventoryItemsResponse",
    "ShowtimeRetrieveInventoryItemsResponseItem",
    "ShowtimeRetrieveInventoryItemsResponseItemPriceType",
    "ShowtimeRetrieveInventoryItemsResponseItemTwoPartTotals",
]


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

    description: Optional[str] = None
    """A description of the seat block, if any."""

    face_value: Optional[CurrencyObject] = FieldInfo(alias="faceValue", default=None)

    is_default_price_type: Optional[bool] = FieldInfo(alias="isDefaultPriceType", default=None)

    name: Optional[str] = None

    sale_price: Optional[CurrencyObject] = FieldInfo(alias="salePrice", default=None)


class ShowtimeRetrieveInventoryItemsResponseItemTwoPartTotals(BaseModel):
    discount: Optional[CurrencyObject] = None

    fee_summary: Optional[FeeSummary] = FieldInfo(alias="feeSummary", default=None)

    fee_text: Optional[str] = FieldInfo(alias="feeText", default=None)

    fee_text_per_ticket: Optional[str] = FieldInfo(alias="feeTextPerTicket", default=None)

    price: Optional[CurrencyObject] = None


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

    discount: CurrencyObject

    fee_summary: FeeSummary = FieldInfo(alias="feeSummary")

    is_general_admission: bool = FieldInfo(alias="isGeneralAdmission")
    """Whether this InventoryItem is GA or not."""

    max_contiguous_seats: int = FieldInfo(alias="maxContiguousSeats")
    """Max contiguous seats in this Inventory Item (price band)"""

    price: CurrencyObject

    provider_params: str = FieldInfo(alias="providerParams")
    """
    Client should not parse this field. Forward value of this field as a parameter
    to create a Hold.
    """

    section_id: int = FieldInfo(alias="sectionId")
    """The Id of the Section"""

    section_name: str = FieldInfo(alias="sectionName")
    """Section name"""

    fee_text: Optional[str] = FieldInfo(alias="feeText", default=None)
    """
    A text to describe the fees for seats.io seat cards. Empty string if fees are
    already baked into the price display. Otherwise, will display "no fee" or "+
    $12.50 fee." N.B. Any fee amount displayed includes BOTH concierge & service
    fees.
    """

    fee_text_per_ticket: Optional[str] = FieldInfo(alias="feeTextPerTicket", default=None)
    """Text to describe the fees per ticket that apply to the current inventory item."""

    fractional_discount: Optional[float] = FieldInfo(alias="fractionalDiscount", default=None)
    """
    The percent saved on the ticket, defined as (discount / discount + price). Will
    be null if the show's hideDiscounts property is true. Calculation will include
    total price with fees only if the location's includeFees property is true.
    """

    order_num: Optional[int] = FieldInfo(alias="orderNum", default=None)
    """
    Field to order inventory items in the app (sorted by orderNum ASC). If orderNum
    is the same then sort by price DESC.
    """

    price_types: Optional[List[ShowtimeRetrieveInventoryItemsResponseItemPriceType]] = FieldInfo(
        alias="priceTypes", default=None
    )
    """
    A list of price types that override other pricing information, if applicable, or
    null otherwise.
    """

    promotion_label: Optional[str] = FieldInfo(alias="promotionLabel", default=None)
    """The promotion label for this section, if any."""

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

    restricted_label: Optional[str] = FieldInfo(alias="restrictedLabel", default=None)
    """The restricted view label for this section, if any."""

    rewards: Optional[Rewards] = None

    two_part_totals: Optional[ShowtimeRetrieveInventoryItemsResponseItemTwoPartTotals] = FieldInfo(
        alias="twoPartTotals", default=None
    )
    """
    If the showtime has a second part, this object reflects the pricing used when
    buying both performances.
    """


ShowtimeRetrieveInventoryItemsResponse: TypeAlias = List[ShowtimeRetrieveInventoryItemsResponseItem]
