# 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 OGImageGenerateRequestSize, OGImageManagedResponseMethod, OGImageManagedResponseStatus


class OGImageManagedCreateRequest(BaseModel):
    """
    Input for POST /api/ogimage/managed/

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

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

    slug: str = Field(min_length=1, max_length=80, pattern='^[-a-zA-Z0-9_]+$')
    title: str = Field(min_length=1, max_length=300)
    description: str | None = Field(None, max_length=600)
    locale: str | None = Field(None, min_length=1, max_length=10)
    preset_slug: str | None = Field(None, min_length=1, pattern='^[-a-zA-Z0-9_]+$')
    size: OGImageGenerateRequestSize | None = Field(
    None,
    description='* `1200x630` - 1200x630 * `1200x...',
)
    llm_model: str | None = Field(None, min_length=1, max_length=100)
    image_model: str | None = Field(None, min_length=1, max_length=100)
    style_hint: str | None = Field(None, min_length=1, max_length=80)



class OGImageManagedResponse(BaseModel):
    """
    Output for all managed OGImage responses.

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

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

    id: str = ...
    slug: Any | None = Field(
    None,
    description='Stable identifier for managed LL...',
    pattern='^[-a-zA-Z0-9_]+$',
)
    title: Any = ...
    description: Any = ...
    locale: Any = ...
    method: OGImageManagedResponseMethod = Field(description='* `direct` - Direct (PicTex canv...')
    status: OGImageManagedResponseStatus = Field(description='* `pending` - Pending * `queued`...')
    stable_url: Any = ...
    cdn_url: Any | None = None
    cost_usd: Any = Field(pattern='^-?\\d{0,4}(?:\\.\\d{0,6})?$')
    duration_ms: int = ...
    job_id: Any = Field(description='django-rq job ID for async gener...')
    llm_prompt: Any = Field(description='Final prompt sent to image gener...')
    error_message: Any = ...
    created_at: datetime.datetime = ...
    updated_at: datetime.datetime = ...



class PatchedOGImageManagedPatchRequest(BaseModel):
    """
    Input for PATCH /api/ogimage/managed/{slug}/

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

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

    title: str | None = Field(None, min_length=1, max_length=300)
    description: str | None = Field(None, max_length=600)
    locale: str | None = Field(None, min_length=1, max_length=10)
    preset_slug: str | None = Field(None, min_length=1, pattern='^[-a-zA-Z0-9_]+$')
    size: OGImageGenerateRequestSize | None = Field(
    None,
    description='* `1200x630` - 1200x630 * `1200x...',
)



class OGImageManagedRegenerateResponse(BaseModel):
    """
    Output for POST /api/ogimage/managed/{slug}/regenerate/

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

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

    slug: str = ...
    status: str = ...
    job_id: str = ...
    stable_url: str = ...



