# 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 .loyalty_promotion import LoyaltyPromotion
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class ListLoyaltyPromotionsResponse(UncheckedBaseModel):
    """
    Represents a [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions) response.
    One of `loyalty_promotions`, an empty object, or `errors` is present in the response.
    If additional results are available, the `cursor` field is also present along with `loyalty_promotions`.
    """

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

    loyalty_promotions: typing.Optional[typing.List[LoyaltyPromotion]] = pydantic.Field(default=None)
    """
    The retrieved loyalty promotions.
    """

    cursor: typing.Optional[str] = pydantic.Field(default=None)
    """
    The cursor to use in your next call to this endpoint to retrieve the next page of results
    for your original request. This field is present only if the request succeeded and additional
    results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
    """

    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
