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

from __future__ import annotations

from typing import Iterable
from typing_extensions import Required, Annotated, TypedDict

from ...._utils import PropertyInfo
from .pyos_hold_seat_param import PyosHoldSeatParam
from .customers.ticket_type import TicketType
from .price_type_selection_param import PriceTypeSelectionParam

__all__ = ["HoldUpdateParams", "AddOn"]


class HoldUpdateParams(TypedDict, total=False):
    add_ons: Annotated[Iterable[AddOn], PropertyInfo(alias="addOns")]

    agent_payment_reference: Annotated[str, PropertyInfo(alias="agentPaymentReference")]
    """
    A unique string to identify the booking within a payment on-account retailer's
    internal system
    """

    apply_rewards_credit: Annotated[bool, PropertyInfo(alias="applyRewardsCredit")]
    """Apply customer rewards credit (TixCash)."""

    apply_ticket_protection: Annotated[bool, PropertyInfo(alias="applyTicketProtection")]
    """Link the hold with the show.ticketProtectionPlan if exist"""

    email: str
    """Email of the customer, used to validate the voucher in case of guest checkout."""

    hold_type: Annotated[TicketType, PropertyInfo(alias="holdType")]
    """Type of the tickets (Lottery, Rush and Regular tickets)"""

    is_rewards_benefit: Annotated[bool, PropertyInfo(alias="isRewardsBenefit")]
    """
    A flag indicating whether the hold should use the Ticket Protection Rewards
    Benefit (if available for this customer) instead of the Standard Ticket
    Protection.
    """

    num_tickets: Annotated[int, PropertyInfo(alias="numTickets")]

    phone_country_code: Annotated[str, PropertyInfo(alias="phoneCountryCode")]
    """
    Phone country code to validate if we should apply PILC (Pay In Local Currency)
    or not.
    """

    provider: int
    """Numeric identifier for a resource"""

    provider_params: Annotated[str, PropertyInfo(alias="providerParams")]
    """
    Some server information necessary to hold seats. This is generally a stringified
    json blob.
    """

    seats: Iterable[PyosHoldSeatParam]
    """The list of seats to be held for the customer."""

    secret: str
    """Secret key used to authorize hold permissions."""

    section: int
    """Numeric identifier for a resource"""

    should_override_ticket_protection_plan: Annotated[bool, PropertyInfo(alias="shouldOverrideTicketProtectionPlan")]
    """
    If true, the hold will not be linked to the show's/rules ticketProtectionPlan
    but the configured alternative
    """

    showtime: int
    """Numeric identifier for a resource"""

    tickets_by_price_type: Annotated[Iterable[PriceTypeSelectionParam], PropertyInfo(alias="ticketsByPriceType")]

    use_unified_checkout: Annotated[bool, PropertyInfo(alias="useUnifiedCheckout")]

    voucher: str
    """Optional voucher code when initiating a hold with a voucher (e.g.

    Link to Hold).
    """


class AddOn(TypedDict, total=False):
    id: Required[int]
    """Numeric identifier for a resource"""

    quantity: Required[int]
    """The quantity of the add-on."""

    provider_id: Annotated[int, PropertyInfo(alias="providerId")]
    """The provider that offers this add-on."""
