# 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 ConfigModel(BaseModel):
    custom_cron: Optional[int] = None
    time_frame: Optional[int] = None
    time_frame_units: Optional[str] = None
    formatted: Optional[int] = None
    threaded: Optional[int] = None
    notifier_id: Optional[int] = None
    filename: Optional[str] = None
    save_only: Optional[int] = None
    incl_libraries: Optional[List[str]] = None


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


class MovieLibraryModel(BaseModel):
    value: Optional[int] = None
    text: Optional[str] = None


class TVShowLibraryModel(BaseModel):
    value: Optional[int] = None
    text: Optional[str] = None


class MusicLibraryModel(BaseModel):
    value: Optional[int] = None
    text: Optional[str] = None


class OtherVideoLibraryModel(BaseModel):
    value: Optional[int] = None
    text: Optional[str] = None


class SelectOptionsModel(BaseModel):
    Movie_Libraries: Optional[List[MovieLibraryModel]] = Field(..., alias='Movie Libraries')
    TV_Show_Libraries: Optional[List[TVShowLibraryModel]] = Field(..., alias='TV Show Libraries')
    Music_Libraries: Optional[List[MusicLibraryModel]] = Field(..., alias='Music Libraries')
    Other_Video_Libraries: Optional[List[OtherVideoLibraryModel]] = Field(
        ..., alias='Other Video Libraries'
    )


class ConfigOptionModel(BaseModel):
    label: Optional[str] = None
    value: Optional[List[str]] = None
    description: Optional[str] = None
    name: Optional[str] = None
    input_type: Optional[str] = None
    select_options: Optional[SelectOptionsModel] = None


class SelectOptionModel(BaseModel):
    value: Optional[str] = None
    text: Optional[str] = None


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


class NewsletterConfigModel(BaseModel):
    id: Optional[int] = None
    agent_id: Optional[int] = None
    agent_name: Optional[str] = None
    agent_label: Optional[str] = None
    friendly_name: Optional[str] = None
    cron: Optional[str] = None
    active: Optional[int] = None
    id_name: Optional[str] = None
    subject: Optional[str] = None
    body: Optional[str] = None
    config: Optional[ConfigModel] = None
    email_config: Optional[EmailConfigModel] = None
    config_options: Optional[List[ConfigOptionModel]] = None
    email_config_options: Optional[List[EmailConfigOptionModel]] = None



