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

import typing

import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class PostInvoicesRootRequestItemsItem(UniversalBaseModel):
    name: str
    sku: typing.Optional[str] = None
    quantity: float
    price: float
    is_taxed: typing.Optional[bool] = None
    dimensions: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Item-level dimension mappings. Same format as header-level dimensions: keys are dimension types and values are `erp_dimension_id` strings. If omitted, no item-level dimensions are set.
    """

    custom_fields: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Item-level custom metadata fields. Keys and value types are validated against the invoice item custom field spec configured for your account in Ottimate.
    
    **Requirements**: Invoice item custom fields must be configured for your account before use. Returns a `400` error if no spec is found or if unrecognised keys are sent.
    
    **Behaviour**: Omitted keys are filled with their configured default values.
    """

    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
