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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .catalog_item_food_and_beverage_details_dietary_preference_type import (
    CatalogItemFoodAndBeverageDetailsDietaryPreferenceType,
)
import pydantic
from .catalog_item_food_and_beverage_details_ingredient_standard_ingredient import (
    CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient,
)
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class CatalogItemFoodAndBeverageDetailsIngredient(UncheckedBaseModel):
    """
    Describes the ingredient used in a `FOOD_AND_BEV` item.
    """

    type: typing.Optional[CatalogItemFoodAndBeverageDetailsDietaryPreferenceType] = pydantic.Field(default=None)
    """
    The dietary preference type of the ingredient. Supported values include `STANDARD` and `CUSTOM` as specified in `FoodAndBeverageDetails.DietaryPreferenceType`.
    See [DietaryPreferenceType](#type-dietarypreferencetype) for possible values
    """

    standard_name: typing.Optional[CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient] = pydantic.Field(
        default=None
    )
    """
    The name of the ingredient from a standard pre-defined list. This should be null if it's a custom dietary preference.
    See [StandardIngredient](#type-standardingredient) for possible values
    """

    custom_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of a custom user-defined ingredient. This should be null if it's a standard dietary preference.
    """

    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
