/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
 *
 * The version of the OpenAPI document: 1.0.1
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

/// LeadGenForm : A Meta Lead Gen (Instant) Form definition.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LeadGenForm {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    #[serde(rename = "locale", skip_serializing_if = "Option::is_none")]
    pub locale: Option<String>,
    #[serde(rename = "created_time", skip_serializing_if = "Option::is_none")]
    pub created_time: Option<String>,
    /// Total leads (real + organic).
    #[serde(rename = "leads_count", skip_serializing_if = "Option::is_none")]
    pub leads_count: Option<i32>,
    #[serde(
        rename = "organic_leads_count",
        skip_serializing_if = "Option::is_none"
    )]
    pub organic_leads_count: Option<i32>,
    #[serde(
        rename = "expired_leads_count",
        skip_serializing_if = "Option::is_none"
    )]
    pub expired_leads_count: Option<i32>,
    #[serde(rename = "questions", skip_serializing_if = "Option::is_none")]
    pub questions: Option<Vec<models::LeadGenFormQuestion>>,
    #[serde(rename = "privacy_policy_url", skip_serializing_if = "Option::is_none")]
    pub privacy_policy_url: Option<String>,
    #[serde(
        rename = "follow_up_action_url",
        skip_serializing_if = "Option::is_none"
    )]
    pub follow_up_action_url: Option<String>,
    #[serde(rename = "thank_you_page", skip_serializing_if = "Option::is_none")]
    pub thank_you_page: Option<serde_json::Value>,
    #[serde(rename = "context_card", skip_serializing_if = "Option::is_none")]
    pub context_card: Option<serde_json::Value>,
    #[serde(
        rename = "question_page_custom_headline",
        skip_serializing_if = "Option::is_none"
    )]
    pub question_page_custom_headline: Option<String>,
    #[serde(
        rename = "is_optimized_for_quality",
        skip_serializing_if = "Option::is_none"
    )]
    pub is_optimized_for_quality: Option<bool>,
    #[serde(rename = "page_id", skip_serializing_if = "Option::is_none")]
    pub page_id: Option<String>,
}

impl LeadGenForm {
    /// A Meta Lead Gen (Instant) Form definition.
    pub fn new() -> LeadGenForm {
        LeadGenForm {
            id: None,
            name: None,
            status: None,
            locale: None,
            created_time: None,
            leads_count: None,
            organic_leads_count: None,
            expired_leads_count: None,
            questions: None,
            privacy_policy_url: None,
            follow_up_action_url: None,
            thank_you_page: None,
            context_card: None,
            question_page_custom_headline: None,
            is_optimized_for_quality: None,
            page_id: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "ACTIVE")]
    Active,
    #[serde(rename = "ARCHIVED")]
    Archived,
    #[serde(rename = "DELETED")]
    Deleted,
    #[serde(rename = "DRAFT")]
    Draft,
}

impl Default for Status {
    fn default() -> Status {
        Self::Active
    }
}
