/*
* 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.597.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AdRuleConditionItem {
AdRuleCondition(Box<models::AdRuleCondition>),
AdRuleConditions(Box<models::AdRuleConditions>),
}
impl Default for AdRuleConditionItem {
fn default() -> Self {
Self::AdRuleCondition(Default::default())
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Metric {
#[serde(rename = "spend")]
Spend,
#[serde(rename = "impressions")]
Impressions,
#[serde(rename = "clicks")]
Clicks,
#[serde(rename = "conversions")]
Conversions,
#[serde(rename = "ctr")]
Ctr,
#[serde(rename = "cpc")]
Cpc,
#[serde(rename = "cpm")]
Cpm,
#[serde(rename = "cpa")]
Cpa,
#[serde(rename = "roas")]
Roas,
#[serde(rename = "reach")]
Reach,
#[serde(rename = "frequency")]
Frequency,
#[serde(rename = "daily_budget")]
DailyBudget,
#[serde(rename = "budget_used")]
BudgetUsed,
#[serde(rename = "day_of_month")]
DayOfMonth,
#[serde(rename = "working_day_of_month")]
WorkingDayOfMonth,
#[serde(rename = "search_impression_share")]
SearchImpressionShare,
#[serde(rename = "search_budget_lost_impression_share")]
SearchBudgetLostImpressionShare,
#[serde(rename = "search_rank_lost_impression_share")]
SearchRankLostImpressionShare,
}
impl Default for Metric {
fn default() -> Metric {
Self::Spend
}
}
/// Days in the ad account's own timezone. `last_7d` is the 7 full days before today; only `today` and `this_month` read the day in progress. `this_month` runs from the 1st through today; `last_month` is the whole previous calendar month. `<from>_to_<to>_days_ago` is any range of full days, both ends included, such as `8_to_2_days_ago` to skip the 2 most recent days while their conversions still arrive. `from` is at least `to` and at most 90. `last_complete_hour`, `last_3h` and `today_so_far` read campaign totals hour by hour, on campaign rules for Meta and Google, and end at the latest hour whose numbers have settled, not at now. They take `spend`, `impressions`, `clicks`, `ctr`, `cpc`, `cpm` and `budget_used` (against today's daily budget), and no `top` or `bottom`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Window {
#[serde(rename = "today")]
Today,
#[serde(rename = "yesterday")]
Yesterday,
#[serde(rename = "last_3d")]
Last3d,
#[serde(rename = "last_7d")]
Last7d,
#[serde(rename = "last_14d")]
Last14d,
#[serde(rename = "last_30d")]
Last30d,
#[serde(rename = "this_month")]
ThisMonth,
#[serde(rename = "last_month")]
LastMonth,
#[serde(rename = "last_complete_hour")]
LastCompleteHour,
#[serde(rename = "last_3h")]
Last3h,
#[serde(rename = "today_so_far")]
TodaySoFar,
}
impl Default for Window {
fn default() -> Window {
Self::Today
}
}
/// `top` and `bottom` rank the rule's objects by the metric over the window, highest first for `top`, and match the first `value` (a whole number from 1 to 100). Objects with no value are not ranked; the run history shows each one's position.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Op {
#[serde(rename = ">")]
GreaterThan,
#[serde(rename = ">=")]
GreaterThanEqual,
#[serde(rename = "<")]
LessThan,
#[serde(rename = "<=")]
LessThanEqual,
#[serde(rename = "top")]
Top,
#[serde(rename = "bottom")]
Bottom,
}
impl Default for Op {
fn default() -> Op {
Self::GreaterThan
}
}
/// Reads the usual value of the metric over `window` (as `compareTo: usual` defines it) instead of its current value, such as campaigns that usually get at least 50 impressions in the last 3 hours. Not combined with `compareTo`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Of {
#[serde(rename = "usual")]
Usual,
}
impl Default for Of {
fn default() -> Of {
Self::Usual
}
}