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

import typing_extensions
import typing_extensions
import typing
from ..types.subscription_cadence import SubscriptionCadence
from .money import MoneyParams
from .subscription_pricing import SubscriptionPricingParams


class SubscriptionPhaseParams(typing_extensions.TypedDict):
    """
    Describes a phase in a subscription plan variation. For more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations).
    """

    uid: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The Square-assigned ID of the subscription phase. This field cannot be changed after a `SubscriptionPhase` is created.
    """

    cadence: SubscriptionCadence
    """
    The billing cadence of the phase. For example, weekly or monthly. This field cannot be changed after a `SubscriptionPhase` is created.
    See [SubscriptionCadence](#type-subscriptioncadence) for possible values
    """

    periods: typing_extensions.NotRequired[typing.Optional[int]]
    """
    The number of `cadence`s the phase lasts. If not set, the phase never ends. Only the last phase can be indefinite. This field cannot be changed after a `SubscriptionPhase` is created.
    """

    recurring_price_money: typing_extensions.NotRequired[MoneyParams]
    """
    The amount to bill for each `cadence`. Failure to specify this field results in a `MISSING_REQUIRED_PARAMETER` error at runtime.
    """

    ordinal: typing_extensions.NotRequired[typing.Optional[int]]
    """
    The position this phase appears in the sequence of phases defined for the plan, indexed from 0. This field cannot be changed after a `SubscriptionPhase` is created.
    """

    pricing: typing_extensions.NotRequired[SubscriptionPricingParams]
    """
    The subscription pricing.
    """
