late 0.0.862

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

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

/// PortfolioBidStrategy : A Google Ads portfolio bid strategy: a named bidding strategy shared across campaigns, with its R.130 report metrics over the queried date range.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PortfolioBidStrategy {
    /// Numeric bid strategy id; pass as portfolioBidStrategyId or in the {strategyId} path.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<Type>,
    /// ENABLED or REMOVED.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// Number of campaigns currently attached.
    #[serde(rename = "campaignCount", skip_serializing_if = "Option::is_none")]
    pub campaign_count: Option<i32>,
    #[serde(rename = "clicks", skip_serializing_if = "Option::is_none")]
    pub clicks: Option<i32>,
    /// Cost in the account's currency units (converted from micros).
    #[serde(rename = "cost", skip_serializing_if = "Option::is_none")]
    pub cost: Option<f64>,
    /// Cost per conversion in the account's currency units.
    #[serde(rename = "costPerConversion", skip_serializing_if = "Option::is_none")]
    pub cost_per_conversion: Option<f64>,
    #[serde(rename = "impressions", skip_serializing_if = "Option::is_none")]
    pub impressions: Option<i32>,
    /// Average CPC in the account's currency units.
    #[serde(rename = "averageCpc", skip_serializing_if = "Option::is_none")]
    pub average_cpc: Option<f64>,
    #[serde(rename = "conversions", skip_serializing_if = "Option::is_none")]
    pub conversions: Option<f64>,
    /// Current target, in the account's currency units. Null for a ROAS-family type (TARGET_ROAS, MAXIMIZE_CONVERSION_VALUE), or a Maximize type with no target set. Pre-fills the edit form's target field.
    #[serde(
        rename = "targetCpa",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub target_cpa: Option<Option<f64>>,
    /// Current target as a decimal multiplier (2.0 = 2.0x). Null for a CPA-family type (TARGET_CPA, MAXIMIZE_CONVERSIONS), or a Maximize type with no target set.
    #[serde(
        rename = "targetRoas",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub target_roas: Option<Option<f64>>,
}

impl PortfolioBidStrategy {
    /// A Google Ads portfolio bid strategy: a named bidding strategy shared across campaigns, with its R.130 report metrics over the queried date range.
    pub fn new() -> PortfolioBidStrategy {
        PortfolioBidStrategy {
            id: None,
            name: None,
            r#type: None,
            status: None,
            campaign_count: None,
            clicks: None,
            cost: None,
            cost_per_conversion: None,
            impressions: None,
            average_cpc: None,
            conversions: None,
            target_cpa: None,
            target_roas: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "TARGET_CPA")]
    TargetCpa,
    #[serde(rename = "TARGET_ROAS")]
    TargetRoas,
    #[serde(rename = "MAXIMIZE_CONVERSIONS")]
    MaximizeConversions,
    #[serde(rename = "MAXIMIZE_CONVERSION_VALUE")]
    MaximizeConversionValue,
}

impl Default for Type {
    fn default() -> Type {
        Self::TargetCpa
    }
}