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  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.104.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 GetLinkedInSupplyForecastRequest {
    #[serde(rename = "accountId")]
    pub account_id: String,
    #[serde(rename = "adAccountId")]
    pub ad_account_id: String,
    #[serde(rename = "spec", deserialize_with = "Option::deserialize")]
    pub spec: Option<Box<models::TargetingSpec>>,
    /// Defaults to SPONSORED_UPDATES.
    #[serde(rename = "campaignType", skip_serializing_if = "Option::is_none")]
    pub campaign_type: Option<CampaignType>,
    /// Unix ms. Must be in the future.
    #[serde(rename = "timeRangeStart")]
    pub time_range_start: i32,
    /// Unix ms. Must be after start and within LinkedIn's max horizon.
    #[serde(rename = "timeRangeEnd")]
    pub time_range_end: i32,
    #[serde(rename = "objectiveType", skip_serializing_if = "Option::is_none")]
    pub objective_type: Option<String>,
    /// When set, the forecast assumes auto-bidding. When unset, competingBid is required.
    #[serde(rename = "optimizationTarget", skip_serializing_if = "Option::is_none")]
    pub optimization_target: Option<String>,
    /// Either dailyBudget or totalBudget is required.
    #[serde(rename = "dailyBudget", skip_serializing_if = "Option::is_none")]
    pub daily_budget: Option<f64>,
    #[serde(rename = "totalBudget", skip_serializing_if = "Option::is_none")]
    pub total_budget: Option<f64>,
    /// ISO 4217, defaults to USD.
    #[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
    pub currency: Option<String>,
    #[serde(rename = "competingBid", skip_serializing_if = "Option::is_none")]
    pub competing_bid: Option<Box<models::GetLinkedInSupplyForecastRequestCompetingBid>>,
    /// Defaults to false. Required true for connectedTelevisionOnly.
    #[serde(
        rename = "enableAudienceNetwork",
        skip_serializing_if = "Option::is_none"
    )]
    pub enable_audience_network: Option<bool>,
    /// Defaults to false.
    #[serde(
        rename = "enableAudienceExpansion",
        skip_serializing_if = "Option::is_none"
    )]
    pub enable_audience_expansion: Option<bool>,
    /// Defaults to false.
    #[serde(
        rename = "connectedTelevisionOnly",
        skip_serializing_if = "Option::is_none"
    )]
    pub connected_television_only: Option<bool>,
}

impl GetLinkedInSupplyForecastRequest {
    pub fn new(
        account_id: String,
        ad_account_id: String,
        spec: Option<models::TargetingSpec>,
        time_range_start: i32,
        time_range_end: i32,
    ) -> GetLinkedInSupplyForecastRequest {
        GetLinkedInSupplyForecastRequest {
            account_id,
            ad_account_id,
            spec: if let Some(x) = spec {
                Some(Box::new(x))
            } else {
                None
            },
            campaign_type: None,
            time_range_start,
            time_range_end,
            objective_type: None,
            optimization_target: None,
            daily_budget: None,
            total_budget: None,
            currency: None,
            competing_bid: None,
            enable_audience_network: None,
            enable_audience_expansion: None,
            connected_television_only: None,
        }
    }
}
/// Defaults to SPONSORED_UPDATES.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CampaignType {
    #[serde(rename = "SPONSORED_UPDATES")]
    SponsoredUpdates,
    #[serde(rename = "SPONSORED_INMAILS")]
    SponsoredInmails,
    #[serde(rename = "DYNAMIC")]
    Dynamic,
}

impl Default for CampaignType {
    fn default() -> CampaignType {
        Self::SponsoredUpdates
    }
}