/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
 *
 * 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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EstimateAdReachRequest {
    /// Zernio social account ID on the target ad platform (the estimate runs against its platform).
    #[serde(rename = "accountId")]
    pub account_id: String,
    /// Required. The platform ad-account ID the reach call runs against (Meta act_..., LinkedIn numeric sponsoredAccount ID, Pinterest ad-account ID, X account ID) - every backing reach API is scoped to one ad account. Get it from GET /v1/ads/accounts.
    #[serde(rename = "adAccountId")]
    pub ad_account_id: String,
    /// The targeting spec to estimate. Same shape used by POST /v1/ads/create.
    #[serde(rename = "spec")]
    pub spec: Box<models::TargetingSpec>,
    /// Optional. The optimization goal the estimate should assume (platform's own vocabulary, e.g. Meta `REACH`, `LINK_CLICKS`, `OFFSITE_CONVERSIONS`). Some platforms vary the estimate by goal; omit to use the platform default.
    #[serde(rename = "optimizationGoal", skip_serializing_if = "Option::is_none")]
    pub optimization_goal: Option<String>,
}

impl EstimateAdReachRequest {
    pub fn new(
        account_id: String,
        ad_account_id: String,
        spec: models::TargetingSpec,
    ) -> EstimateAdReachRequest {
        EstimateAdReachRequest {
            account_id,
            ad_account_id,
            spec: Box::new(spec),
            optimization_goal: None,
        }
    }
}
