# Auto-generated by DjangoCFG - see CLAUDE.md

from __future__ import annotations
import datetime
from typing import Any

from pydantic import BaseModel, ConfigDict, Field

from ..enums import CfgRqTestingScheduleDemoCreateRequestScheduleType, RunDemoRequestRequestScenario, StressTestRequestRequestScenario


class TestScenario(BaseModel):
    """
    Serializer for available test scenarios.

    Response model (includes read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    id: str = Field(description='Scenario ID')
    name: str = Field(description='Scenario name')
    description: str = Field(description='Scenario description')
    task_func: str = Field(description='Task function path')
    default_args: list[dict[str, Any]] | None = Field(
    None,
    description='Default arguments (array of any ...',
)
    default_kwargs: dict[str, Any] | None = Field(None, description='Default keyword arguments')
    estimated_duration: int | None = Field(None, description='Estimated duration in seconds')



class TestingActionResponse(BaseModel):
    """
    Serializer for testing action responses.

    Response model (includes read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    success: bool = Field(description='Action success status')
    message: str = Field(description='Action message')
    job_ids: list[str] | None = Field(None, description='Created job IDs')
    count: int | None = Field(None, description='Number of items affected')
    metadata: dict[str, Any] | None = Field(None, description='Additional metadata')



class RunDemoRequestRequest(BaseModel):
    """
    Serializer for running demo tasks.

    Request model (no read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    scenario: RunDemoRequestRequestScenario = Field(
    description='Demo scenario to run  * `success...',
)
    queue: str | None = Field(None, description='Queue name', min_length=1)
    args: list[dict[str, Any]] | None = Field(
    None,
    description='Task arguments (array of any JSO...',
)
    kwargs: dict[str, Any] | None = Field(None, description='Task keyword arguments')
    timeout: int | None = Field(None, description='Job timeout in seconds')



class CfgRqTestingScheduleDemoCreateRequest(BaseModel):
    """
    
    Request model (no read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    scenario: str = ...
    schedule_type: CfgRqTestingScheduleDemoCreateRequestScheduleType = ...
    interval: int | None = None
    cron: str | None = None
    scheduled_time: datetime.datetime | None = None
    queue: str | None = None
    repeat: int | None = None



class StressTestRequestRequest(BaseModel):
    """
    Serializer for stress testing.

    Request model (no read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    num_jobs: int | None = Field(None, description='Number of jobs to create', ge=1, le=1000)
    queue: str | None = Field(None, description='Queue name', min_length=1)
    scenario: StressTestRequestRequestScenario | None = Field(
    None,
    description='Task scenario  * `success` - suc...',
)
    duration: int | None = Field(None, description='Task duration in seconds', ge=1, le=60)



