late 0.0.1387

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
Documentation
/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api  Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal.  Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).  Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
 *
 * The version of the OpenAPI document: 1.608.0
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ImapDiscovery {
    #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    #[serde(rename = "route", skip_serializing_if = "Option::is_none")]
    pub route: Option<Route>,
    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
    pub provider: Option<Box<models::ImapDiscoveryProvider>>,
    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
    pub source: Option<Source>,
    /// low when only a probe answered: show the settings for the user to check.
    #[serde(rename = "confidence", skip_serializing_if = "Option::is_none")]
    pub confidence: Option<Confidence>,
    #[serde(rename = "imap", skip_serializing_if = "Option::is_none")]
    pub imap: Option<Box<models::ImapDiscoveryImap>>,
    #[serde(rename = "smtp", skip_serializing_if = "Option::is_none")]
    pub smtp: Option<Box<models::ImapDiscoverySmtp>>,
    #[serde(rename = "auth", skip_serializing_if = "Option::is_none")]
    pub auth: Option<Box<models::ImapDiscoveryAuth>>,
    /// What to switch on at the provider first, such as IMAP access on GMX or Yandex.
    #[serde(rename = "preflight", skip_serializing_if = "Option::is_none")]
    pub preflight: Option<Vec<models::ImapDiscoveryPreflightInner>>,
    #[serde(
        rename = "reconnectCause",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub reconnect_cause: Option<Option<String>>,
    #[serde(
        rename = "reason",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub reason: Option<Option<String>>,
    #[serde(
        rename = "unsupportedReason",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub unsupported_reason: Option<Option<UnsupportedReason>>,
    /// Google only: Gmail over IMAP with an app password, for accounts whose admin blocks Google sign-in for other apps.
    #[serde(
        rename = "appPasswordFallback",
        skip_serializing_if = "Option::is_none"
    )]
    pub app_password_fallback: Option<serde_json::Value>,
}

impl ImapDiscovery {
    pub fn new() -> ImapDiscovery {
        ImapDiscovery {
            email: None,
            route: None,
            provider: None,
            source: None,
            confidence: None,
            imap: None,
            smtp: None,
            auth: None,
            preflight: None,
            reconnect_cause: None,
            reason: None,
            unsupported_reason: None,
            app_password_fallback: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Route {
    #[serde(rename = "imap")]
    Imap,
    #[serde(rename = "google_oauth")]
    GoogleOauth,
    #[serde(rename = "microsoft_oauth")]
    MicrosoftOauth,
    #[serde(rename = "unsupported")]
    Unsupported,
}

impl Default for Route {
    fn default() -> Route {
        Self::Imap
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Source {
    #[serde(rename = "preset")]
    Preset,
    #[serde(rename = "mx")]
    Mx,
    #[serde(rename = "autoconfig")]
    Autoconfig,
    #[serde(rename = "ispdb")]
    Ispdb,
    #[serde(rename = "srv")]
    Srv,
    #[serde(rename = "probe")]
    Probe,
    #[serde(rename = "none")]
    None,
}

impl Default for Source {
    fn default() -> Source {
        Self::Preset
    }
}
/// low when only a probe answered: show the settings for the user to check.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Confidence {
    #[serde(rename = "high")]
    High,
    #[serde(rename = "medium")]
    Medium,
    #[serde(rename = "low")]
    Low,
}

impl Default for Confidence {
    fn default() -> Confidence {
        Self::High
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum UnsupportedReason {
    #[serde(rename = "proton_requires_bridge")]
    ProtonRequiresBridge,
}

impl Default for UnsupportedReason {
    fn default() -> UnsupportedReason {
        Self::ProtonRequiresBridge
    }
}