late 0.0.1389

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.610.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 MetaLeadFormPlatformData {
    #[serde(rename = "questions")]
    pub questions: Vec<models::CreateLeadFormRequestQuestionsInner>,
    #[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 thank_you_page.button_type. Defaults to VIEW_WEBSITE. Case-insensitive, sent to Meta in uppercase. CALL_BUSINESS requires businessPhoneNumber and countryCode (a 400 otherwise). Meta rejects MESSAGE_BUSINESS on thank-you pages with (#100) This button type is not yet supported for Thank You Page.
    #[serde(rename = "thankYouButtonType", skip_serializing_if = "Option::is_none")]
    pub thank_you_button_type: Option<String>,
    /// International E.164 number the CALL_BUSINESS thank-you button dials (Meta thank_you_page.business_phone_number).  - Must start with + and the country calling code matching countryCode. Spaces, dashes, dots and parentheses are stripped; a local number such as 2025550123 is a 400. - Required when thankYouButtonType is CALL_BUSINESS; a 400 with any other button type. - Accepted only inside platformSpecificData; a top-level businessPhoneNumber is a 400.
    #[serde(
        rename = "businessPhoneNumber",
        skip_serializing_if = "Option::is_none"
    )]
    pub business_phone_number: Option<String>,
    /// ISO 3166-1 alpha-2 country of businessPhoneNumber (Meta thank_you_page.country_code), sent in uppercase. Required when thankYouButtonType is CALL_BUSINESS and a 400 with any other button type. Accepted only inside platformSpecificData: a top-level countryCode is a 400.
    #[serde(rename = "countryCode", skip_serializing_if = "Option::is_none")]
    pub country_code: Option<String>,
    #[serde(rename = "thankYouWebsiteUrl", skip_serializing_if = "Option::is_none")]
    pub thank_you_website_url: Option<String>,
    /// Sent as Meta thank_you_page.enable_messenger (boolean). Accepted only inside platformSpecificData: a top-level thankYouEnableMessenger is a 400.
    #[serde(
        rename = "thankYouEnableMessenger",
        skip_serializing_if = "Option::is_none"
    )]
    pub thank_you_enable_messenger: Option<bool>,
    /// Set true for a higher-intent form (adds a review step before submit).
    #[serde(
        rename = "isOptimizedForQuality",
        skip_serializing_if = "Option::is_none"
    )]
    pub is_optimized_for_quality: Option<bool>,
    /// Requires the lead to verify their phone number over SMS before the form submits (Meta is_phone_sms_verify_enabled). Only meaningful on a form with a PHONE question.  Meta can restrict this parameter to apps holding a capability. When it does, the create fails with a 422 naming platformSpecificData.isPhoneSmsVerifyEnabled, and the toggle must then be set in Meta's form builder.
    #[serde(
        rename = "isPhoneSmsVerifyEnabled",
        skip_serializing_if = "Option::is_none"
    )]
    pub is_phone_sms_verify_enabled: Option<bool>,
    #[serde(
        rename = "blockDisplayForNonTargetedViewer",
        skip_serializing_if = "Option::is_none"
    )]
    pub block_display_for_non_targeted_viewer: Option<bool>,
    #[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::MetaLeadFormPlatformDataContextCard>>,
    #[serde(rename = "customDisclaimer", skip_serializing_if = "Option::is_none")]
    pub custom_disclaimer: Option<Box<models::MetaLeadFormPlatformDataCustomDisclaimer>>,
}

impl MetaLeadFormPlatformData {
    pub fn new(
        questions: Vec<models::CreateLeadFormRequestQuestionsInner>,
    ) -> MetaLeadFormPlatformData {
        MetaLeadFormPlatformData {
            questions,
            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,
            business_phone_number: None,
            country_code: None,
            thank_you_website_url: None,
            thank_you_enable_messenger: None,
            is_optimized_for_quality: None,
            is_phone_sms_verify_enabled: None,
            block_display_for_non_targeted_viewer: None,
            question_page_custom_headline: None,
            context_card: None,
            custom_disclaimer: None,
        }
    }
}