/*
* 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.570.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// AdAppliedDefaults : What the create filled in for fields the request left out. Empty when every field was sent. A passing validateOnly returns it too, so a dry run previews these values before anything is created.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AdAppliedDefaults {
/// Sent when `name` was omitted: `Ad <YYYY-MM-DD HH:MM:SS>` in UTC.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// Sent when `goal` was omitted: the goal Zernio inferred. - `lead_generation`: with a `leadGenFormId`. - `app_promotion`: when `promotedObject` names an app. - `conversions`: with `promotedObject.pixelId` and `customEventType`. - `traffic`: when the ad has a link (`linkUrl`, a carousel card, `creatives[].linkUrl`, `dynamicCreative.linkUrls` or a LinkedIn carousel card). - `engagement`: otherwise. Each applies only when the platform offers it, falling back to `engagement`, then `awareness`, then the platform's first goal. Never inferred with `existingCampaignId`, `smartPlus` or the LinkedIn spotlight, follower and jobs formats: those still return 400 without `goal`.
#[serde(rename = "goal", skip_serializing_if = "Option::is_none")]
pub goal: Option<String>,
/// Sent when `budgetAmount` came without `budgetType`.
#[serde(rename = "budgetType", skip_serializing_if = "Option::is_none")]
pub budget_type: Option<BudgetType>,
/// Sent when a lifetime budget had no `endDate`: 7 days after the start. A daily budget never gets one and runs until paused. - A start with an offset (or no start) gets a UTC instant. - An offset-less start gets an offset-less end, read in the ad account timezone like the start. - A date-only start gets the date 6 days later, which runs to 23:59:59.
#[serde(rename = "endDate", skip_serializing_if = "Option::is_none")]
pub end_date: Option<String>,
/// Sent when the request sent no countries and the ad gets the long-standing United States default. Not sent on attach, Google Performance Max or Demand Gen, or a Google ad group joining `existingCampaignId`, which keep their own geo.
#[serde(rename = "countries", skip_serializing_if = "Option::is_none")]
pub countries: Option<Vec<String>>,
}
impl AdAppliedDefaults {
/// What the create filled in for fields the request left out. Empty when every field was sent. A passing validateOnly returns it too, so a dry run previews these values before anything is created.
pub fn new() -> AdAppliedDefaults {
AdAppliedDefaults {
name: None,
goal: None,
budget_type: None,
end_date: None,
countries: None,
}
}
}
/// Sent when `budgetAmount` came without `budgetType`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum BudgetType {
#[serde(rename = "daily")]
Daily,
}
impl Default for BudgetType {
fn default() -> BudgetType {
Self::Daily
}
}