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 EstimateAdReachRequest {
    /// Zernio 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", deserialize_with = "Option::deserialize")]
    pub spec: Option<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: Option<models::TargetingSpec>,
    ) -> EstimateAdReachRequest {
        EstimateAdReachRequest {
            account_id,
            ad_account_id,
            spec: if let Some(x) = spec {
                Some(Box::new(x))
            } else {
                None
            },
            optimization_goal: None,
        }
    }
}