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 GetLinkedInBidPricingRequest {
    /// Zernio account ID (LinkedIn).
    #[serde(rename = "accountId")]
    pub account_id: String,
    /// LinkedIn ad account ID (numeric).
    #[serde(rename = "adAccountId")]
    pub ad_account_id: String,
    /// Same targeting spec used by POST /v1/ads/create.
    #[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>,
    /// Defaults to CPM.
    #[serde(rename = "bidType", skip_serializing_if = "Option::is_none")]
    pub bid_type: Option<BidType>,
    /// Defaults to EXACT.
    #[serde(rename = "matchType", skip_serializing_if = "Option::is_none")]
    pub match_type: Option<MatchType>,
    /// ISO 4217, defaults to USD.
    #[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
    pub currency: Option<String>,
    /// LinkedIn objectiveType, e.g. WEBSITE_VISIT, LEAD_GENERATION, VIDEO_VIEW.
    #[serde(rename = "objectiveType", skip_serializing_if = "Option::is_none")]
    pub objective_type: Option<String>,
    /// LinkedIn optimizationTargetType, e.g. MAX_CLICK, MAX_IMPRESSION.
    #[serde(
        rename = "optimizationTargetType",
        skip_serializing_if = "Option::is_none"
    )]
    pub optimization_target_type: Option<String>,
    /// Optional daily budget in whole account-currency units. LinkedIn refines the suggested bid to this budget.
    #[serde(rename = "dailyBudget", skip_serializing_if = "Option::is_none")]
    pub daily_budget: Option<f64>,
}

impl GetLinkedInBidPricingRequest {
    pub fn new(
        account_id: String,
        ad_account_id: String,
        spec: Option<models::TargetingSpec>,
    ) -> GetLinkedInBidPricingRequest {
        GetLinkedInBidPricingRequest {
            account_id,
            ad_account_id,
            spec: if let Some(x) = spec {
                Some(Box::new(x))
            } else {
                None
            },
            campaign_type: None,
            bid_type: None,
            match_type: None,
            currency: None,
            objective_type: None,
            optimization_target_type: None,
            daily_budget: None,
        }
    }
}
/// Defaults to SPONSORED_UPDATES.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CampaignType {
    #[serde(rename = "TEXT_AD")]
    TextAd,
    #[serde(rename = "SPONSORED_UPDATES")]
    SponsoredUpdates,
    #[serde(rename = "SPONSORED_INMAILS")]
    SponsoredInmails,
}

impl Default for CampaignType {
    fn default() -> CampaignType {
        Self::TextAd
    }
}
/// Defaults to CPM.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum BidType {
    #[serde(rename = "CPM")]
    Cpm,
    #[serde(rename = "CPC")]
    Cpc,
    #[serde(rename = "CPV")]
    Cpv,
}

impl Default for BidType {
    fn default() -> BidType {
        Self::Cpm
    }
}
/// Defaults to EXACT.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MatchType {
    #[serde(rename = "EXACT")]
    Exact,
    #[serde(rename = "AUDIENCE_EXPANDED")]
    AudienceExpanded,
}

impl Default for MatchType {
    fn default() -> MatchType {
        Self::Exact
    }
}