# 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_entry_bulk_item_prices_item_price_type import CatalogEntryBulkItemPricesItemPriceType


class CatalogEntryBulkItemPricesItem(UniversalBaseModel):
    """
    Request body for creating a catalog price
    """

    price: float = pydantic.Field()
    """
    Price amount
    """

    unit_price: typing.Optional[float] = pydantic.Field(default=None)
    """
    Unit price
    """

    price_type: typing.Optional[CatalogEntryBulkItemPricesItemPriceType] = pydantic.Field(default=None)
    """
    Price type: company (default), location_group, or location
    """

    ottimate_location_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Location ID (required when price_type is 'location')
    """

    ottimate_group_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Location group ID (required when price_type is 'location_group')
    """

    start_date: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Price start date
    """

    end_date: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Price end date
    """

    reference_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Unique key for upsert
    """

    properties: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Additional properties
    """

    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
