late 0.0.1055

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
 *
 * 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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateLeadFormBody {
    /// Facebook social account ID (Late SocialAccount _id).
    #[serde(rename = "accountId")]
    pub account_id: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "questions")]
    pub questions: Vec<models::LeadGenFormQuestion>,
    /// Required by Meta. Must be reachable from Meta's crawler.
    #[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>,
    /// Meta enum (e.g. VIEW_WEBSITE, CALL_BUSINESS, DOWNLOAD)
    #[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>,
    #[serde(
        rename = "isOptimizedForQuality",
        skip_serializing_if = "Option::is_none"
    )]
    pub is_optimized_for_quality: Option<bool>,
    #[serde(rename = "contextCard", skip_serializing_if = "Option::is_none")]
    pub context_card: Option<Box<models::CreateLeadFormBodyContextCard>>,
    #[serde(rename = "legalContent", skip_serializing_if = "Option::is_none")]
    pub legal_content: Option<Box<models::CreateLeadFormBodyLegalContent>>,
    /// Up to 20 key/value pairs surfaced on every lead for attribution.
    #[serde(rename = "trackingParameters", skip_serializing_if = "Option::is_none")]
    pub tracking_parameters: Option<std::collections::HashMap<String, String>>,
    #[serde(
        rename = "questionPageCustomHeadline",
        skip_serializing_if = "Option::is_none"
    )]
    pub question_page_custom_headline: Option<String>,
    #[serde(rename = "allowOrganicLead", skip_serializing_if = "Option::is_none")]
    pub allow_organic_lead: Option<bool>,
    #[serde(
        rename = "blockDisplayForNonTargetedViewer",
        skip_serializing_if = "Option::is_none"
    )]
    pub block_display_for_non_targeted_viewer: Option<bool>,
}

impl CreateLeadFormBody {
    pub fn new(
        account_id: String,
        name: String,
        questions: Vec<models::LeadGenFormQuestion>,
        privacy_policy_url: String,
    ) -> CreateLeadFormBody {
        CreateLeadFormBody {
            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,
            context_card: None,
            legal_content: None,
            tracking_parameters: None,
            question_page_custom_headline: None,
            allow_organic_lead: None,
            block_display_for_non_targeted_viewer: None,
        }
    }
}