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

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


class MeasurementUnitCustom(UncheckedBaseModel):
    """
    The information needed to define a custom unit, provided by the seller.
    """

    name: str = pydantic.Field()
    """
    The name of the custom unit, for example "bushel".
    """

    abbreviation: str = pydantic.Field()
    """
    The abbreviation of the custom unit, such as "bsh" (bushel). This appears
    in the cart for the Point of Sale app, and in reports.
    """

    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
