# generated by datamodel-codegen:
#   filename:  data.json
#   timestamp: 2021-01-27T04:44:54+00:00

from __future__ import annotations

from typing import List, Optional, Union

from pydantic import BaseModel, Field


class Config(BaseModel):
    custom_cron: int
    time_frame: int
    time_frame_units: str
    formatted: int
    threaded: int
    notifier_id: int
    filename: str
    save_only: int
    incl_libraries: List[str]


class EmailConfig(BaseModel):
    from_name: str
    from_: str = Field(..., alias='from')
    to: List[str]
    cc: List
    bcc: List
    smtp_server: str
    smtp_port: int
    smtp_user: str
    smtp_password: str
    tls: int
    html_support: int
    notifier_id: int


class MovieLibrary(BaseModel):
    value: int
    text: str


class TVShowLibrary(BaseModel):
    value: int
    text: str


class MusicLibrary(BaseModel):
    value: int
    text: str


class OtherVideoLibrary(BaseModel):
    value: int
    text: str


class SelectOptions(BaseModel):
    Movie_Libraries: List[MovieLibrary] = Field(..., alias='Movie Libraries')
    TV_Show_Libraries: List[TVShowLibrary] = Field(..., alias='TV Show Libraries')
    Music_Libraries: List[MusicLibrary] = Field(..., alias='Music Libraries')
    Other_Video_Libraries: List[OtherVideoLibrary] = Field(
        ..., alias='Other Video Libraries'
    )


class ConfigOption(BaseModel):
    label: str
    value: List[str]
    description: str
    name: str
    input_type: str
    select_options: SelectOptions


class SelectOption(BaseModel):
    value: str
    text: str


class EmailConfigOption(BaseModel):
    label: str
    value: Union[Union[int, str], List[str]]
    name: str
    description: str
    input_type: str
    select_options: Optional[List[SelectOption]] = None


class Data(BaseModel):
    id: int
    agent_id: int
    agent_name: str
    agent_label: str
    friendly_name: str
    cron: str
    active: int
    id_name: str
    subject: str
    body: str
    config: Config
    email_config: EmailConfig
    config_options: List[ConfigOption]
    email_config_options: List[EmailConfigOption]


class Response(BaseModel):
    result: str
    message: str
    data: Data


class Model(BaseModel):
    response: Response
