late 0.0.385

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
Documentation
/*
 * 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.4
 * 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 CreateLeadFormRequest {
    #[serde(rename = "accountId")]
    pub account_id: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "questions")]
    pub questions: Vec<models::CreateLeadFormRequestQuestionsInner>,
    #[serde(rename = "privacyPolicyUrl")]
    pub privacy_policy_url: String,
    #[serde(
        rename = "privacyPolicyLinkText",
        skip_serializing_if = "Option::is_none"
    )]
    pub privacy_policy_link_text: Option<String>,
    #[serde(rename = "followUpActionUrl", skip_serializing_if = "Option::is_none")]
    pub follow_up_action_url: Option<String>,
    #[serde(rename = "locale", skip_serializing_if = "Option::is_none")]
    pub locale: Option<String>,
    #[serde(rename = "thankYouTitle", skip_serializing_if = "Option::is_none")]
    pub thank_you_title: Option<String>,
    #[serde(rename = "thankYouBody", skip_serializing_if = "Option::is_none")]
    pub thank_you_body: Option<String>,
    #[serde(rename = "thankYouButtonText", skip_serializing_if = "Option::is_none")]
    pub thank_you_button_text: Option<String>,
    #[serde(rename = "thankYouButtonType", skip_serializing_if = "Option::is_none")]
    pub thank_you_button_type: Option<String>,
    #[serde(rename = "thankYouWebsiteUrl", skip_serializing_if = "Option::is_none")]
    pub thank_you_website_url: Option<String>,
    /// Legacy form type toggle. Prefer formType instead. false = More Volume, true = Higher Intent.
    #[serde(
        rename = "isOptimizedForQuality",
        skip_serializing_if = "Option::is_none"
    )]
    pub is_optimized_for_quality: Option<bool>,
    /// Form type. MORE_VOLUME = optimized for lead quantity (default). HIGHER_INTENT = adds a review/confirmation step before submit. RICH_CREATIVE = includes context card and custom headline to educate users before they submit. Supersedes isOptimizedForQuality.
    #[serde(rename = "formType", skip_serializing_if = "Option::is_none")]
    pub form_type: Option<FormType>,
    /// Sharing setting. true = Restricted (only people targeted by the ad can open the form link). false = Open (shareable link, default).
    #[serde(
        rename = "blockDisplayForNonTargetedViewer",
        skip_serializing_if = "Option::is_none"
    )]
    pub block_display_for_non_targeted_viewer: Option<bool>,
    /// Flexible form delivery. true = the form can surface organically on the Page (not just as a paid ad). Defaults to false.
    #[serde(
        rename = "allowOrganicLeadGen",
        skip_serializing_if = "Option::is_none"
    )]
    pub allow_organic_lead_gen: Option<bool>,
    /// Custom subheadline shown above the form fields on the questions page (the contact-information section description). Defaults to Meta's generic copy when omitted.
    #[serde(
        rename = "questionPageCustomHeadline",
        skip_serializing_if = "Option::is_none"
    )]
    pub question_page_custom_headline: Option<String>,
    #[serde(rename = "contextCard", skip_serializing_if = "Option::is_none")]
    pub context_card: Option<Box<models::CreateLeadFormRequestContextCard>>,
}

impl CreateLeadFormRequest {
    pub fn new(
        account_id: String,
        name: String,
        questions: Vec<models::CreateLeadFormRequestQuestionsInner>,
        privacy_policy_url: String,
    ) -> CreateLeadFormRequest {
        CreateLeadFormRequest {
            account_id,
            name,
            questions,
            privacy_policy_url,
            privacy_policy_link_text: None,
            follow_up_action_url: None,
            locale: None,
            thank_you_title: None,
            thank_you_body: None,
            thank_you_button_text: None,
            thank_you_button_type: None,
            thank_you_website_url: None,
            is_optimized_for_quality: None,
            form_type: None,
            block_display_for_non_targeted_viewer: None,
            allow_organic_lead_gen: None,
            question_page_custom_headline: None,
            context_card: None,
        }
    }
}
/// Form type. MORE_VOLUME = optimized for lead quantity (default). HIGHER_INTENT = adds a review/confirmation step before submit. RICH_CREATIVE = includes context card and custom headline to educate users before they submit. Supersedes isOptimizedForQuality.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum FormType {
    #[serde(rename = "MORE_VOLUME")]
    MoreVolume,
    #[serde(rename = "HIGHER_INTENT")]
    HigherIntent,
    #[serde(rename = "RICH_CREATIVE")]
    RichCreative,
}

impl Default for FormType {
    fn default() -> FormType {
        Self::MoreVolume
    }
}