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

/// LinkedInAdsPlatformData : LinkedIn-specific options for POST /v1/ads/boost and POST /v1/ads/create: campaign bidding and delivery controls, plus the LinkedIn-only creative formats on /v1/ads/create. Unknown keys are rejected.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LinkedInAdsPlatformData {
    /// Campaign cost model (billing event). Defaults to `CPM`. Required when `unitCost` is set so the manual bid applies to an explicit cost model.
    #[serde(rename = "costType", skip_serializing_if = "Option::is_none")]
    pub cost_type: Option<CostType>,
    /// Manual bid in WHOLE account-currency units (e.g. 2.5 = $2.50). Requires `costType`. Omit for LinkedIn's automated (max delivery) bidding. LinkedIn enforces its own per-audience min/max bid bounds.
    #[serde(rename = "unitCost", skip_serializing_if = "Option::is_none")]
    pub unit_cost: Option<f64>,
    /// Campaign `optimizationTargetType` (e.g. `MAX_CLICK`, `TARGET_COST_PER_CLICK`, `MAX_IMPRESSION`). Forwarded verbatim, LinkedIn validates compatibility with the objective and `costType`. Omit for the objective-derived default: `awareness` gets `MAX_IMPRESSION`, `video_views` gets `MAX_VIDEO_VIEW`, and every other goal gets `MAX_CLICK`. `lead_generation` and `conversions` also get `MAX_CLICK`, because `MAX_LEAD` and `MAX_CONVERSION` need a lead gen form or a conversion rule that neither creation flow attaches. The default applies only to `SPONSORED_UPDATES` campaigns (every boost, and the image, video and carousel standalone ads), never to the `TEXT_AD`, `DYNAMIC` and `SPONSORED_INMAILS` campaigns the other creative formats produce. It is also skipped when `unitCost` or a non-`CPM` `costType` is set, since those select manual bidding and the bid is then yours to choose.
    #[serde(
        rename = "optimizationTargetType",
        skip_serializing_if = "Option::is_none"
    )]
    pub optimization_target_type: Option<String>,
    /// How LinkedIn rotates creatives within the campaign. Defaults to `OPTIMIZED`.
    #[serde(rename = "creativeSelection", skip_serializing_if = "Option::is_none")]
    pub creative_selection: Option<CreativeSelection>,
    /// Enable LinkedIn audience expansion. Defaults to false.
    #[serde(
        rename = "audienceExpansionEnabled",
        skip_serializing_if = "Option::is_none"
    )]
    pub audience_expansion_enabled: Option<bool>,
    /// Deliver on the LinkedIn Audience Network. Defaults to false.
    #[serde(
        rename = "offsiteDeliveryEnabled",
        skip_serializing_if = "Option::is_none"
    )]
    pub offsite_delivery_enabled: Option<bool>,
    /// Restrict delivery to Connected TV inventory.
    #[serde(
        rename = "connectedTelevisionOnly",
        skip_serializing_if = "Option::is_none"
    )]
    pub connected_television_only: Option<bool>,
    #[serde(rename = "carousel", skip_serializing_if = "Option::is_none")]
    pub carousel: Option<Box<models::LinkedInAdsPlatformDataCarousel>>,
    #[serde(rename = "document", skip_serializing_if = "Option::is_none")]
    pub document: Option<Box<models::LinkedInAdsPlatformDataDocument>>,
    #[serde(rename = "spotlight", skip_serializing_if = "Option::is_none")]
    pub spotlight: Option<Box<models::LinkedInAdsPlatformDataSpotlight>>,
    #[serde(rename = "follower", skip_serializing_if = "Option::is_none")]
    pub follower: Option<Box<models::LinkedInAdsPlatformDataFollower>>,
    #[serde(rename = "jobs", skip_serializing_if = "Option::is_none")]
    pub jobs: Option<Box<models::LinkedInAdsPlatformDataJobs>>,
    #[serde(rename = "textAd", skip_serializing_if = "Option::is_none")]
    pub text_ad: Option<Box<models::LinkedInAdsPlatformDataTextAd>>,
    #[serde(rename = "conversation", skip_serializing_if = "Option::is_none")]
    pub conversation: Option<Box<models::LinkedInAdsPlatformDataConversation>>,
    #[serde(rename = "event", skip_serializing_if = "Option::is_none")]
    pub event: Option<Box<models::LinkedInAdsPlatformDataEvent>>,
    #[serde(rename = "thoughtLeader", skip_serializing_if = "Option::is_none")]
    pub thought_leader: Option<Box<models::LinkedInAdsPlatformDataThoughtLeader>>,
}

impl LinkedInAdsPlatformData {
    /// LinkedIn-specific options for POST /v1/ads/boost and POST /v1/ads/create: campaign bidding and delivery controls, plus the LinkedIn-only creative formats on /v1/ads/create. Unknown keys are rejected.
    pub fn new() -> LinkedInAdsPlatformData {
        LinkedInAdsPlatformData {
            cost_type: None,
            unit_cost: None,
            optimization_target_type: None,
            creative_selection: None,
            audience_expansion_enabled: None,
            offsite_delivery_enabled: None,
            connected_television_only: None,
            carousel: None,
            document: None,
            spotlight: None,
            follower: None,
            jobs: None,
            text_ad: None,
            conversation: None,
            event: None,
            thought_leader: None,
        }
    }
}
/// Campaign cost model (billing event). Defaults to `CPM`. Required when `unitCost` is set so the manual bid applies to an explicit cost model.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CostType {
    #[serde(rename = "CPM")]
    Cpm,
    #[serde(rename = "CPC")]
    Cpc,
    #[serde(rename = "CPV")]
    Cpv,
}

impl Default for CostType {
    fn default() -> CostType {
        Self::Cpm
    }
}
/// How LinkedIn rotates creatives within the campaign. Defaults to `OPTIMIZED`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CreativeSelection {
    #[serde(rename = "OPTIMIZED")]
    Optimized,
    #[serde(rename = "ROUND_ROBIN")]
    RoundRobin,
}

impl Default for CreativeSelection {
    fn default() -> CreativeSelection {
        Self::Optimized
    }
}