/*
* 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};
/// BoostPostRequestTargeting : Same geo/demographic fields as the `TargetingSpec` used by /v1/ads/create. Geo keys (`regions`/`cities`/`zips`/`metros`) resolve via GET /v1/ads/targeting/search?dimension=geo. City radius and lat/lng `customLocations` are Meta-only and preserve the boosted post's social proof (the ad references the existing post).
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BoostPostRequestTargeting {
#[serde(rename = "ageMin", skip_serializing_if = "Option::is_none")]
pub age_min: Option<i32>,
#[serde(rename = "ageMax", skip_serializing_if = "Option::is_none")]
pub age_max: Option<i32>,
/// Applied on Meta, TikTok and Pinterest. Ignored on Google, LinkedIn and X.
#[serde(rename = "gender", skip_serializing_if = "Option::is_none")]
pub gender: Option<Gender>,
/// Meta locale ids (numeric), passed through as given.
#[serde(rename = "languages", skip_serializing_if = "Option::is_none")]
pub languages: Option<Vec<String>>,
/// ISO country codes. Required for TikTok boosts (TikTok's ad group requires location_ids); optional on other platforms.
#[serde(rename = "countries", skip_serializing_if = "Option::is_none")]
pub countries: Option<Vec<String>>,
/// Region/state targeting. `key` from /v1/ads/targeting/search?dimension=geo&geoType=region.
#[serde(rename = "regions", skip_serializing_if = "Option::is_none")]
pub regions:
Option<Vec<models::UpdateCampaignTargetingRequestTargetingLocationsOneOfRegionsInnerOneOf>>,
/// City targeting. Optional `radius` + `distanceUnit` extend beyond the city limits (both set together, Meta only).
#[serde(rename = "cities", skip_serializing_if = "Option::is_none")]
pub cities: Option<Vec<models::BoostPostRequestTargetingCitiesInner>>,
/// Postal/ZIP targeting. `key` is the platform's postal location ID (e.g. Meta `US:94304`).
#[serde(rename = "zips", skip_serializing_if = "Option::is_none")]
pub zips:
Option<Vec<models::UpdateCampaignTargetingRequestTargetingLocationsOneOfRegionsInnerOneOf>>,
/// DMA / metro-area targeting. `key` is the platform's metro ID (e.g. Meta `DMA:807`).
#[serde(rename = "metros", skip_serializing_if = "Option::is_none")]
pub metros:
Option<Vec<models::UpdateCampaignTargetingRequestTargetingLocationsOneOfRegionsInnerOneOf>>,
/// Point-radius (lat/lng) targeting (Meta custom_locations). No geo `key` lookup needed.
#[serde(rename = "customLocations", skip_serializing_if = "Option::is_none")]
pub custom_locations: Option<Vec<models::BoostPostRequestTargetingCustomLocationsInner>>,
/// Interest objects from /v1/ads/interests. Each must include id and name.
#[serde(rename = "interests", skip_serializing_if = "Option::is_none")]
pub interests: Option<Vec<models::UpdateAdRequestTargetingInterestsInner>>,
/// Meta only. 0 = disabled (default), 1 = enabled.
#[serde(rename = "advantage_audience", skip_serializing_if = "Option::is_none")]
pub advantage_audience: Option<AdvantageAudience>,
}
impl BoostPostRequestTargeting {
/// Same geo/demographic fields as the `TargetingSpec` used by /v1/ads/create. Geo keys (`regions`/`cities`/`zips`/`metros`) resolve via GET /v1/ads/targeting/search?dimension=geo. City radius and lat/lng `customLocations` are Meta-only and preserve the boosted post's social proof (the ad references the existing post).
pub fn new() -> BoostPostRequestTargeting {
BoostPostRequestTargeting {
age_min: None,
age_max: None,
gender: None,
languages: None,
countries: None,
regions: None,
cities: None,
zips: None,
metros: None,
custom_locations: None,
interests: None,
advantage_audience: None,
}
}
}
/// Applied on Meta, TikTok and Pinterest. Ignored on Google, LinkedIn and X.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Gender {
#[serde(rename = "all")]
All,
#[serde(rename = "male")]
Male,
#[serde(rename = "female")]
Female,
}
impl Default for Gender {
fn default() -> Gender {
Self::All
}
}
/// Meta only. 0 = disabled (default), 1 = enabled.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AdvantageAudience {
#[serde(rename = "0")]
Variant0,
#[serde(rename = "1")]
Variant1,
}
impl Default for AdvantageAudience {
fn default() -> AdvantageAudience {
Self::Variant0
}
}