zernio 0.0.132

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.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 BoostPostRequest {
    /// Zernio post ID (provide this or platformPostId)
    #[serde(rename = "postId", skip_serializing_if = "Option::is_none")]
    pub post_id: Option<String>,
    /// Platform post ID (alternative to postId)
    #[serde(rename = "platformPostId", skip_serializing_if = "Option::is_none")]
    pub platform_post_id: Option<String>,
    /// Social account ID
    #[serde(rename = "accountId")]
    pub account_id: String,
    /// Platform ad account ID
    #[serde(rename = "adAccountId")]
    pub ad_account_id: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "goal")]
    pub goal: Goal,
    #[serde(rename = "budget")]
    pub budget: Box<models::BoostPostRequestBudget>,
    #[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
    pub currency: Option<String>,
    #[serde(rename = "schedule", skip_serializing_if = "Option::is_none")]
    pub schedule: Option<Box<models::BoostPostRequestSchedule>>,
    #[serde(rename = "targeting", skip_serializing_if = "Option::is_none")]
    pub targeting: Option<Box<models::BoostPostRequestTargeting>>,
    /// Max bid cap (Meta only)
    #[serde(rename = "bidAmount", skip_serializing_if = "Option::is_none")]
    pub bid_amount: Option<f64>,
    #[serde(rename = "tracking", skip_serializing_if = "Option::is_none")]
    pub tracking: Option<Box<models::BoostPostRequestTracking>>,
    /// Meta only. Required for housing, employment, credit, or political ads.
    #[serde(
        rename = "specialAdCategories",
        skip_serializing_if = "Option::is_none"
    )]
    pub special_ad_categories: Option<Vec<SpecialAdCategories>>,
}

impl BoostPostRequest {
    pub fn new(
        account_id: String,
        ad_account_id: String,
        name: String,
        goal: Goal,
        budget: models::BoostPostRequestBudget,
    ) -> BoostPostRequest {
        BoostPostRequest {
            post_id: None,
            platform_post_id: None,
            account_id,
            ad_account_id,
            name,
            goal,
            budget: Box::new(budget),
            currency: None,
            schedule: None,
            targeting: None,
            bid_amount: None,
            tracking: None,
            special_ad_categories: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Goal {
    #[serde(rename = "engagement")]
    Engagement,
    #[serde(rename = "traffic")]
    Traffic,
    #[serde(rename = "awareness")]
    Awareness,
    #[serde(rename = "video_views")]
    VideoViews,
}

impl Default for Goal {
    fn default() -> Goal {
        Self::Engagement
    }
}
/// Meta only. Required for housing, employment, credit, or political ads.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SpecialAdCategories {
    #[serde(rename = "HOUSING")]
    Housing,
    #[serde(rename = "EMPLOYMENT")]
    Employment,
    #[serde(rename = "CREDIT")]
    Credit,
    #[serde(rename = "ISSUES_ELECTIONS_POLITICS")]
    IssuesElectionsPolitics,
}

impl Default for SpecialAdCategories {
    fn default() -> SpecialAdCategories {
        Self::Housing
    }
}