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

import datetime as dt
import typing

from ...core.datetime_utils import serialize_datetime
from .call_params import CallParams

try:
    import pydantic.v1 as pydantic  # type: ignore
except ImportError:
    import pydantic  # type: ignore


class BatchParams(pydantic.BaseModel):
    id: str = pydantic.Field()
    """
    The unique identifier of the batch - used as the `batch_id` parameter in other API calls.
    """

    campaign_id: typing.Optional[str] = None
    created_at: dt.datetime = pydantic.Field()
    """
    The creation timestamp of the batch.
    """

    label: str = pydantic.Field()
    """
    The label or description of the batch.
    """

    base_prompt: str = pydantic.Field()
    """
    The base prompt used for calls in this batch.
    """

    endpoint_code: str = pydantic.Field()
    """
    The endpoint code used for API integration.
    """

    call_params: CallParams = pydantic.Field()
    """
    An object containing parameters for the calls in the batch.
    """

    def json(self, **kwargs: typing.Any) -> str:
        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
        return super().json(**kwargs_with_defaults)

    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
        return super().dict(**kwargs_with_defaults)

    class Config:
        frozen = True
        smart_union = True
        json_encoders = {dt.datetime: serialize_datetime}
