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

import datetime as dt
import typing

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


class CatalogAllowanceBulkItem(UniversalBaseModel):
    """
    Single allowance in bulk create request
    """

    catalog_entry_id: int = pydantic.Field()
    """
    Associated catalog entry ID
    """

    allowance_type: typing.Optional[CatalogAllowanceBulkItemAllowanceType] = None
    amount: float
    unit_allowance: typing.Optional[float] = None
    target: typing.Optional[int] = None
    ottimate_location_id: typing.Optional[int] = None
    ottimate_group_id: typing.Optional[int] = None
    start_date: dt.datetime
    end_date: typing.Optional[dt.datetime] = None
    reference_id: typing.Optional[str] = None
    properties: typing.Optional[typing.Dict[str, 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
