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

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


class BatchChangeInventoryRequest(UncheckedBaseModel):
    idempotency_key: str = pydantic.Field()
    """
    A client-supplied, universally unique identifier (UUID) for the
    request.
    
    See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) in the
    [API Development 101](https://developer.squareup.com/docs/buildbasics) section for more
    information.
    """

    changes: typing.Optional[typing.List[InventoryChange]] = pydantic.Field(default=None)
    """
    The set of physical counts and inventory adjustments to be made.
    Changes are applied based on the client-supplied timestamp and may be sent
    out of order.
    """

    ignore_unchanged_counts: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates whether the current physical count should be ignored if
    the quantity is unchanged since the last physical count. Default: `true`.
    """

    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
