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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .error import Error
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class CalculateLoyaltyPointsResponse(UncheckedBaseModel):
    """
    Represents a [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints) response.
    """

    errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None)
    """
    Any errors that occurred during the request.
    """

    points: typing.Optional[int] = pydantic.Field(default=None)
    """
    The number of points that the buyer can earn from the base loyalty program.
    """

    promotion_points: typing.Optional[int] = pydantic.Field(default=None)
    """
    The number of points that the buyer can earn from a loyalty promotion. To be eligible
    to earn promotion points, the purchase must first qualify for program points. When `order_id`
    is not provided in the request, this value is always 0.
    """

    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
