# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Optional
from datetime import datetime

from pydantic import Field as FieldInfo

from ..._models import BaseModel

__all__ = ["WorkflowGetResponse", "Instances", "Schedule"]


class Instances(BaseModel):
    complete: Optional[float] = None

    errored: Optional[float] = None

    paused: Optional[float] = None

    queued: Optional[float] = None

    rolling_back: Optional[float] = FieldInfo(alias="rollingBack", default=None)

    running: Optional[float] = None

    terminated: Optional[float] = None

    waiting: Optional[float] = None

    waiting_for_pause: Optional[float] = FieldInfo(alias="waitingForPause", default=None)


class Schedule(BaseModel):
    cron: str

    next_instance: str


class WorkflowGetResponse(BaseModel):
    id: str

    class_name: str

    created_on: datetime

    instances: Instances

    modified_on: datetime

    name: str

    script_name: str

    triggered_on: Optional[datetime] = None

    schedules: Optional[List[Schedule]] = None
