use yaserde::MaybeString;
use yaserde_derive::{YaDeserialize, YaSerialize};

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
pub struct Pischem {
    pub caddy: Caddy,
}

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
pub struct Caddy {
    pub general: CaddyGeneral,
    pub reverseproxy: MaybeString,
}

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
pub struct CaddyGeneral {
    pub enabled: u8,
    #[yaserde(rename = "EnableLayer4")]
    pub enable_layer4: Option<u8>,
    #[yaserde(rename = "HttpPort")]
    pub http_port: Option<u16>,
    #[yaserde(rename = "HttpsPort")]
    pub https_port: Option<u16>,
    #[yaserde(rename = "TlsEmail")]
    pub tls_email: MaybeString,
    #[yaserde(rename = "TlsAutoHttps")]
    pub tls_auto_https: MaybeString,
    #[yaserde(rename = "TlsDnsProvider")]
    pub tls_dns_provider: MaybeString,
    #[yaserde(rename = "TlsDnsApiKey")]
    pub tls_dns_api_key: MaybeString,
    #[yaserde(rename = "TlsDnsSecretApiKey")]
    pub tls_dns_secret_api_key: MaybeString,
    #[yaserde(rename = "TlsDnsOptionalField1")]
    pub tls_dns_optional_field1: MaybeString,
    #[yaserde(rename = "TlsDnsOptionalField2")]
    pub tls_dns_optional_field2: MaybeString,
    #[yaserde(rename = "TlsDnsOptionalField3")]
    pub tls_dns_optional_field3: MaybeString,
    #[yaserde(rename = "TlsDnsOptionalField4")]
    pub tls_dns_optional_field4: MaybeString,
    #[yaserde(rename = "TlsDnsPropagationTimeout")]
    pub tls_dns_propagation_timeout: Option<MaybeString>,
    #[yaserde(rename = "TlsDnsPropagationTimeoutPeriod")]
    pub tls_dns_propagation_timeout_period: Option<MaybeString>,
    #[yaserde(rename = "TlsDnsPropagationDelay")]
    pub tls_dns_propagation_delay: Option<MaybeString>,
    #[yaserde(rename = "TlsDnsPropagationResolvers")]
    pub tls_dns_propagation_resolvers: MaybeString,
    pub accesslist: MaybeString,
    #[yaserde(rename = "DisableSuperuser")]
    pub disable_superuser: Option<i32>,
    #[yaserde(rename = "GracePeriod")]
    pub grace_period: Option<u16>,
    #[yaserde(rename = "HttpVersion")]
    pub http_version: Option<MaybeString>,
    #[yaserde(rename = "HttpVersions")]
    pub http_versions: Option<MaybeString>,
    #[yaserde(rename = "LogCredentials")]
    pub log_credentials: MaybeString,
    #[yaserde(rename = "LogAccessPlain")]
    pub log_access_plain: MaybeString,
    #[yaserde(rename = "LogAccessPlainKeep")]
    pub log_access_plain_keep: Option<u16>,
    #[yaserde(rename = "LogLevel")]
    pub log_level: MaybeString,
    #[yaserde(rename = "DynDnsSimpleHttp")]
    pub dyn_dns_simple_http: MaybeString,
    #[yaserde(rename = "DynDnsInterface")]
    pub dyn_dns_interface: MaybeString,
    #[yaserde(rename = "DynDnsInterval")]
    pub dyn_dns_interval: MaybeString,
    #[yaserde(rename = "DynDnsIpVersions")]
    pub dyn_dns_ip_versions: MaybeString,
    #[yaserde(rename = "DynDnsTtl")]
    pub dyn_dns_ttl: MaybeString,
    #[yaserde(rename = "DynDnsUpdateOnly")]
    pub dyn_dns_update_only: MaybeString,
    #[yaserde(rename = "AuthProvider")]
    pub auth_provider: MaybeString,
    #[yaserde(rename = "AuthToDomain")]
    pub auth_to_domain: MaybeString,
    #[yaserde(rename = "AuthToPort")]
    pub auth_to_port: MaybeString,
    #[yaserde(rename = "AuthToTls")]
    pub auth_to_tls: Option<i32>,
    #[yaserde(rename = "AuthToUri")]
    pub auth_to_uri: MaybeString,
    #[yaserde(rename = "ClientIpHeaders")]
    pub client_ip_headers: MaybeString,
    #[yaserde(rename = "CopyHeaders")]
    pub copy_headers: MaybeString,
}
