late 0.0.1340

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.522.1
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

/// AutomationBoostStep : Promotes each matched Facebook or Instagram post once, as a Meta ad with a lifetime budget. Posts on other platforms are not boosted. It needs the Ads add-on.  One boost step per automation, and `limits.maxChangesPerDay` (up to 20) is required: the most posts boosted in a day. At most 5 posts are boosted per check.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AutomationBoostStep {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "type")]
    pub r#type: Type,
    /// The Meta ad account that pays, from `GET /v1/ads/accounts`.
    #[serde(rename = "adAccountId")]
    pub ad_account_id: String,
    /// The whole spend of one boost, in the ad account currency.
    #[serde(rename = "budget")]
    pub budget: f64,
    /// How long each boost runs.
    #[serde(rename = "days")]
    pub days: i32,
    #[serde(rename = "goal", skip_serializing_if = "Option::is_none")]
    pub goal: Option<Goal>,
    /// ISO 3166 alpha-2 codes.
    #[serde(rename = "countries")]
    pub countries: Vec<String>,
}

impl AutomationBoostStep {
    /// Promotes each matched Facebook or Instagram post once, as a Meta ad with a lifetime budget. Posts on other platforms are not boosted. It needs the Ads add-on.  One boost step per automation, and `limits.maxChangesPerDay` (up to 20) is required: the most posts boosted in a day. At most 5 posts are boosted per check.
    pub fn new(
        r#type: Type,
        ad_account_id: String,
        budget: f64,
        days: i32,
        countries: Vec<String>,
    ) -> AutomationBoostStep {
        AutomationBoostStep {
            id: None,
            r#type,
            ad_account_id,
            budget,
            days,
            goal: None,
            countries,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "ads.boost_post")]
    AdsBoostPost,
}

impl Default for Type {
    fn default() -> Type {
        Self::AdsBoostPost
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Goal {
    #[serde(rename = "engagement")]
    Engagement,
    #[serde(rename = "awareness")]
    Awareness,
    #[serde(rename = "video_views")]
    VideoViews,
}

impl Default for Goal {
    fn default() -> Goal {
        Self::Engagement
    }
}