# 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 .subscription import Subscription
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class SearchSubscriptionsResponse(UncheckedBaseModel):
    """
    Defines output parameters in a response from the
    [SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) endpoint.
    """

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

    subscriptions: typing.Optional[typing.List[Subscription]] = pydantic.Field(default=None)
    """
    The subscriptions matching the specified query expressions.
    """

    cursor: typing.Optional[str] = pydantic.Field(default=None)
    """
    When the total number of resulting subscription exceeds the limit of a paged response, 
    the response includes a cursor for you to use in a subsequent request to fetch the next set of results.
    If the cursor is unset, the response contains the last page of the results.
    
    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
