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

from ..core.unchecked_base_model import UncheckedBaseModel
from .money import Money
import pydantic
import typing
from .gift_card_activity_redeem_status import GiftCardActivityRedeemStatus
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class GiftCardActivityRedeem(UncheckedBaseModel):
    """
    Represents details about a `REDEEM` [gift card activity type](entity:GiftCardActivityType).
    """

    amount_money: Money = pydantic.Field()
    """
    The amount deducted from the gift card for the redemption. This value is a positive integer.
    
    Applications that use a custom payment processing system must specify this amount in the 
    [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.
    """

    payment_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the payment that represents the gift card redemption. Square populates this field 
    if the payment was processed by Square.
    """

    reference_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    A client-specified ID that associates the gift card activity with an entity in another system. 
    
    Applications that use a custom payment processing system can use this field to track information
    related to an order or payment.
    """

    status: typing.Optional[GiftCardActivityRedeemStatus] = pydantic.Field(default=None)
    """
    The status of the gift card redemption. Gift cards redeemed from Square Point of Sale or the 
    Square Seller Dashboard use a two-state process: `PENDING` 
    to `COMPLETED` or `PENDING` to  `CANCELED`. Gift cards redeemed using the Gift Card Activities API 
    always have a `COMPLETED` status.
    See [Status](#type-status) for possible values
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
