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

from __future__ import annotations

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
from ..core.unchecked_base_model import UncheckedBaseModel
from .error import Error


class SearchCatalogItemsResponse(UncheckedBaseModel):
    """
    Defines the response body returned from the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) endpoint.
    """

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

    items: typing.Optional[typing.List["CatalogObject"]] = pydantic.Field(default=None)
    """
    Returned items matching the specified query expressions.
    """

    cursor: typing.Optional[str] = pydantic.Field(default=None)
    """
    Pagination token used in the next request to return more of the search result.
    """

    matched_variation_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Ids of returned item variations matching the specified query expression.
    """

    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


from .catalog_category import CatalogCategory  # noqa: E402, F401, I001
from .catalog_item import CatalogItem  # noqa: E402, F401, I001
from .catalog_item_option import CatalogItemOption  # noqa: E402, F401, I001
from .catalog_modifier_list import CatalogModifierList  # noqa: E402, F401, I001
from .catalog_object_category import CatalogObjectCategory  # noqa: E402, F401, I001
from .catalog_object_item import CatalogObjectItem  # noqa: E402, F401, I001
from .catalog_object_item_option import CatalogObjectItemOption  # noqa: E402, F401, I001
from .catalog_object_modifier_list import CatalogObjectModifierList  # noqa: E402, F401, I001
from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan  # noqa: E402, F401, I001
from .catalog_subscription_plan import CatalogSubscriptionPlan  # noqa: E402, F401, I001
from .catalog_object import CatalogObject  # noqa: E402, F401, I001

update_forward_refs(SearchCatalogItemsResponse)
