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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from .money import Money
from .modifier_location_overrides import ModifierLocationOverrides
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class CatalogModifier(UncheckedBaseModel):
    """
    A modifier that can be applied to items at the time of sale. For example, a cheese modifier for a burger, or a flavor modifier for a serving of ice cream.
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The modifier name.  This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.
    """

    price_money: typing.Optional[Money] = pydantic.Field(default=None)
    """
    The modifier price.
    """

    on_by_default: typing.Optional[bool] = pydantic.Field(default=None)
    """
    When `true`, this modifier is selected by default when displaying the modifier list.
    This setting can be overridden at the item level using `CatalogModifierListInfo.modifier_overrides`.
    """

    ordinal: typing.Optional[int] = pydantic.Field(default=None)
    """
    Determines where this `CatalogModifier` appears in the `CatalogModifierList`.
    """

    modifier_list_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the `CatalogModifierList` associated with this modifier.
    """

    location_overrides: typing.Optional[typing.List[ModifierLocationOverrides]] = pydantic.Field(default=None)
    """
    Location-specific price overrides.
    """

    image_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the image associated with this `CatalogModifier` instance.
    Currently this image is not displayed by Square, but is free to be displayed in 3rd party applications.
    """

    hidden_online: typing.Optional[bool] = pydantic.Field(default=None)
    """
    When `true`, this modifier is hidden from online ordering channels. This setting can be overridden at the item level using `CatalogModifierListInfo.modifier_overrides`.
    """

    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
