"Store all of the pydantic models for the API"

from typing import Literal

from pydantic import BaseModel, Field

from services.ppt_generator.data_classes.graph_classes import (Bar, Line, Pie,
                                                               Scatter)


class icon(BaseModel):
    "The icon for a given input"
    icon_description: str = Field(..., description="Icon description")
    icon_text: str = Field(..., description="Icon text")
    icon_search_query: str = Field(
        ..., description="search query for google to find this icon"
    )


class summary_text(BaseModel):
    "The summary text for a given input"
    content: str = Field(..., description="Catchy summary text less than 20 words")


class summary_text_icon(BaseModel):
    "The summary text for a given input"
    content: str = Field(..., description="Catchy summary text less than 20 words")
    icons: list[icon] = Field(
        ..., description="List of icon for the summary text with a minimum of 4"
    )


class bullet_text(BaseModel):
    "The bullet text for a given input"
    content: list[str] = Field(..., description="Bullet points")


class icon_text_data(BaseModel):
    "The icon text data for a given input"
    bullet_text: str = Field(..., description="Bullet point with 20-30 tokens of text")
    icon_content: icon = Field(..., description="Icon for the bullet point")


class icon_text(BaseModel):
    "The icon text for a given input"
    content: list[icon_text_data] = Field(
        ...,
        description="List of icon text data which should be more than 4 and less than 10",
    )


class icon_circle(BaseModel):
    "The icon circle for a given input"
    content: str = Field(..., description="20 token description")
    icons: list[icon] = Field(..., description="List of icons with a minimum of 5")


class graph(BaseModel):
    "The graph for a given input"
    title: str = Field(..., description="Title of the graph")
    graph_type: Literal["line", "bar", "pie", "scatter"] = Field(
        ..., description="Type of graph"
    )
    data: list[dict[str, float]] = Field(
        ...,
        description="Data for the graph as a list of Key-Value pairs where the key is a string and the value is a float.",
    )


class graph_with_text(graph):
    "The graph with text for a given input"
    title: str = Field(..., description="Title of the graph")
    graph_type: Literal["line", "bar", "pie", "scatter"] = Field(
        ..., description="Type of graph"
    )
    data: list[dict[str, float | int | str]] = Field(
        ..., description="Data for the graph"
    )
    takeaway_text: str = Field(..., description="Takeaway text for the graph")


class token20_text(BaseModel):
    "The 20 token text for a given input"
    content: str = Field(..., description="20 token text")


class iconography(BaseModel):
    "The iconography for a given input"
    title: str = Field(..., description="Title of the iconography")
    search_query: str = Field(
        ..., description="Google search string for the iconography"
    )
    design_instructions: str = Field(
        ..., description="LLM design instructions for the iconography"
    )


class full_page_iconography(iconography):
    "The full page iconography for a given input"
    title: str = Field(..., description="Title of the iconography")
    search_query: str = Field(
        ..., description="Google search string for the iconography"
    )
    design_instructions: str = Field(
        ..., description="LLM design instructions for the iconography"
    )


class solution_diagram(iconography):
    "The solution diagram for a given input"
    title: str = Field(..., description="Title of the solution diagram")
    search_query: str = Field(
        ..., description="Google search string for the solution diagram"
    )
    design_instructions: list[str] = Field(
        ..., description="LLM design instructions for the solution diagram"
    )


class flowchart_data(BaseModel):
    "The flowchart data for a given input"
    title: str = Field(
        ..., description="Header for this flowchart data limited to 5 tokens"
    )
    text: str = Field(..., description="Description text for the related title")
    icon_content: icon = Field(..., description="Icon for the related title")


class flowchart(BaseModel):
    "The flowchart for a given input"
    title: str = Field(..., description="Title of the flowchart")
    data: list[flowchart_data] = Field(
        ..., description="Data for the flowchart include 4 - 8"
    )


class timeline_data(BaseModel):
    "The timeline data for a given input"
    title: str = Field(..., description="Title or date for the timeline")
    text: str = Field(..., description="Description text for the related title")
    icon_content: icon = Field(..., description="Icon for the related title")


class timeline(BaseModel):
    "The timeline for a given input"
    title: str = Field(..., description="Title of the timeline")
    data: list[timeline_data] = Field(
        ..., description="Data for the timeline include 4 - 8"
    )


class landscape_data(BaseModel):
    "The landscape data for a given input"
    title: str = Field(..., description="Title of the landscape")
    text: str = Field(..., description="Description text for the landscape")
    icon_content: icon = Field(..., description="Icon for the landscape")


class thirds_matrix(BaseModel):
    "The thirds matrix for a given input"
    content: list[landscape_data] = Field(..., description="List of landscape data")


class landscape(BaseModel):
    "The landscape for a given input"
    content: list[landscape_data] = Field(
        ..., description="List of landscape data below 12 entries"
    )


class grid_data(BaseModel):
    "The landscape data for a given input"
    title: str = Field(..., description="Title of the landscape")
    text: str = Field(..., description="Description text for the landscape")
    images: list[str] = Field(
        ..., description="List of strings for image search for this cell of the grid"
    )


class grid(BaseModel):
    "The grid for a given input"
    content: list[grid_data] = Field(..., description="List of grid data with 4-12")
