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

from ..core.unchecked_base_model import UncheckedBaseModel
import pydantic
import typing
from .catalog_modifier_override import CatalogModifierOverride
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class CatalogItemModifierListInfo(UncheckedBaseModel):
    """
    Controls how a modifier list is applied to a specific item. This object allows for item-specific customization of modifier list behavior
    and provides the ability to override global modifier list settings.
    """

    modifier_list_id: str = pydantic.Field()
    """
    The ID of the `CatalogModifierList` controlled by this `CatalogModifierListInfo`.
    """

    modifier_overrides: typing.Optional[typing.List[CatalogModifierOverride]] = pydantic.Field(default=None)
    """
    A set of `CatalogModifierOverride` objects that override default modifier settings for this item.
    """

    min_selected_modifiers: typing.Optional[int] = pydantic.Field(default=None)
    """
    The minimum number of modifiers that must be selected from this modifier list.
    Values:
    
    - 0: No selection is required.
    - -1: Default value, the attribute was not set by the client. When `max_selected_modifiers` is
    also -1, use the minimum and maximum selection values set on the `CatalogItemModifierList`.
    - &gt;0: The required minimum modifier selections. This can be larger than the total `CatalogModifiers` when `allow_quantities` is enabled.
    - &lt; -1: Invalid. Treated as no selection required.
    """

    max_selected_modifiers: typing.Optional[int] = pydantic.Field(default=None)
    """
    The maximum number of modifiers that can be selected.
    Values:
    
    - 0: No maximum limit.
    - -1: Default value, the attribute was not set by the client. When `min_selected_modifiers` is
    also -1, use the minimum and maximum selection values set on the `CatalogItemModifierList`.
    - &gt;0: The maximum total modifier selections. This can be larger than the total `CatalogModifiers` when `allow_quantities` is enabled.
    - &lt; -1: Invalid. Treated as no maximum limit.
    """

    enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    If `true`, enable this `CatalogModifierList`. The default value is `true`.
    """

    ordinal: typing.Optional[int] = pydantic.Field(default=None)
    """
    The position of this `CatalogItemModifierListInfo` object within the `modifier_list_info` list applied 
    to a `CatalogItem` instance.
    """

    allow_quantities: typing.Optional[typing.Optional[typing.Any]] = None
    is_conversational: typing.Optional[typing.Optional[typing.Any]] = None
    hidden_from_customer_override: typing.Optional[typing.Optional[typing.Any]] = None

    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
