# 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: Optional[int]
    time_frame: Optional[int]
    time_frame_units: Optional[str]
    formatted: Optional[int]
    threaded: Optional[int]
    notifier_id: Optional[int]
    filename: Optional[str]
    save_only: Optional[int]
    incl_libraries: Optional[List[str]]


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


class MovieLibrary(BaseModel):
    value: Optional[int]
    text: Optional[str]


class TVShowLibrary(BaseModel):
    value: Optional[int]
    text: Optional[str]


class MusicLibrary(BaseModel):
    value: Optional[int]
    text: Optional[str]


class OtherVideoLibrary(BaseModel):
    value: Optional[int]
    text: Optional[str]


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


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


class SelectOption(BaseModel):
    value: Optional[str]
    text: Optional[str]


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


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


class Response(BaseModel):
    result: Optional[str]
    message: Optional[str]
    data: Data


class Model(BaseModel):
    response: Response
