late 0.0.992

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).
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).
 *
 * The version of the OpenAPI document: 1.34.0
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

/// CampaignBidding : A Google campaign's current bidding, mapped onto the same triplet PUT /v1/ads/campaigns/{campaignId} accepts.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CampaignBidding {
    /// campaign.advertising_channel_type. COST_CAP's underlying Google field differs by channel; see bidStrategy on PUT.
    #[serde(rename = "channel", skip_serializing_if = "Option::is_none")]
    pub channel: Option<Channel>,
    /// Google's raw enum: MAXIMIZE_CONVERSIONS, TARGET_CPA, MAXIMIZE_CONVERSION_VALUE, TARGET_ROAS, TARGET_SPEND, MANUAL_CPC, TARGET_IMPRESSION_SHARE, or another Google adds later.
    #[serde(
        rename = "biddingStrategyType",
        skip_serializing_if = "Option::is_none"
    )]
    pub bidding_strategy_type: Option<String>,
    #[serde(rename = "bidSpec", skip_serializing_if = "Option::is_none")]
    pub bid_spec: Option<Box<models::CampaignBiddingBidSpec>>,
    #[serde(rename = "portfolio", skip_serializing_if = "Option::is_none")]
    pub portfolio: Option<Box<models::CampaignBiddingPortfolio>>,
    /// When this data was fetched from Google. Null when it was never served from cache.
    #[serde(
        rename = "cachedAt",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub cached_at: Option<Option<String>>,
    /// True when Google's daily API quota was exhausted and this is the last successful fetch, not a live read.
    #[serde(rename = "stale", skip_serializing_if = "Option::is_none")]
    pub stale: Option<bool>,
}

impl CampaignBidding {
    /// A Google campaign's current bidding, mapped onto the same triplet PUT /v1/ads/campaigns/{campaignId} accepts.
    pub fn new() -> CampaignBidding {
        CampaignBidding {
            channel: None,
            bidding_strategy_type: None,
            bid_spec: None,
            portfolio: None,
            cached_at: None,
            stale: None,
        }
    }
}
/// campaign.advertising_channel_type. COST_CAP's underlying Google field differs by channel; see bidStrategy on PUT.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Channel {
    #[serde(rename = "SEARCH")]
    Search,
    #[serde(rename = "DISPLAY")]
    Display,
}

impl Default for Channel {
    fn default() -> Channel {
        Self::Search
    }
}