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

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


class ListCustomerCustomAttributesResponse(UncheckedBaseModel):
    """
    Represents a [ListCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-ListCustomerCustomAttributes) response.
    Either `custom_attributes`, an empty object, or `errors` is present in the response. If additional
    results are available, the `cursor` field is also present along with `custom_attributes`.
    """

    custom_attributes: typing.Optional[typing.List[CustomAttribute]] = pydantic.Field(default=None)
    """
    The retrieved custom attributes. If `with_definitions` was set to `true` in the request,
    the custom attribute definition is returned in the `definition` field of each custom attribute.
    
    If no custom attributes are found, Square returns an empty object (`{}`).
    """

    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).
    """

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

    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
