# 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


class StreamlineAutomationResponse(UniversalBaseModel):
    """
    Schema for automation response.
    """

    id: str
    organization_id: str
    created_by_user_id: str
    name: str
    description: typing.Optional[str] = None
    automation_id: str
    upload_method: str
    git_repository_url: typing.Optional[str] = None
    git_branch: typing.Optional[str] = None
    git_last_commit_sha: typing.Optional[str] = None
    git_last_sync_at: typing.Optional[dt.datetime] = None
    execution_file_path: str
    execution_return_mode: str
    parameters: typing.Optional[typing.Dict[str, typing.Any]] = None
    schedule_enabled: bool
    schedule_cron: typing.Optional[str] = None
    schedule_timezone: str
    schedule_next_run_at: typing.Optional[dt.datetime] = None
    is_active: bool
    last_executed_at: typing.Optional[dt.datetime] = None
    execution_count: int
    created_at: dt.datetime
    updated_at: dt.datetime

    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
