/*
* 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.168.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 UpdateAdSetStatus200Response {
/// The ad set's delivery status derived from the switches read back: `paused` when its own switch or its campaign's switch is off. Echoes the request when the platform could not be read.
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<Status>,
/// The ad set's own switch as read back from the platform, in the raw platform vocabulary (Meta effective_status, TikTok ENABLE / DISABLE, Google ENABLED / PAUSED, LinkedIn and Pinterest ACTIVE / PAUSED, ChatGPT (OpenAI) status). Null when the platform could not be read, which is always the case on X.
#[serde(
rename = "platformAdSetStatus",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub platform_ad_set_status: Option<Option<String>>,
/// The parent campaign's switch, read in the same call where the platform returns it, otherwise the stored value.
#[serde(
rename = "platformCampaignStatus",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub platform_campaign_status: Option<Option<String>>,
/// When the ad set switch was read back. Null when it could not be read.
#[serde(
rename = "statusReadAt",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub status_read_at: Option<Option<String>>,
/// 1 when the ad set's switch was written.
#[serde(rename = "updated", skip_serializing_if = "Option::is_none")]
pub updated: Option<Updated>,
/// 1 when a live read showed the ad set already in the requested state, so nothing was written.
#[serde(rename = "skipped", skip_serializing_if = "Option::is_none")]
pub skipped: Option<Skipped>,
/// Why the write was skipped, for example \"Ad set already switched off\".
#[serde(rename = "skippedReasons", skip_serializing_if = "Option::is_none")]
pub skipped_reasons: Option<Vec<String>>,
}
impl UpdateAdSetStatus200Response {
pub fn new() -> UpdateAdSetStatus200Response {
UpdateAdSetStatus200Response {
status: None,
platform_ad_set_status: None,
platform_campaign_status: None,
status_read_at: None,
updated: None,
skipped: None,
skipped_reasons: None,
}
}
}
/// The ad set's delivery status derived from the switches read back: `paused` when its own switch or its campaign's switch is off. Echoes the request when the platform could not be read.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "active")]
Active,
#[serde(rename = "paused")]
Paused,
}
impl Default for Status {
fn default() -> Status {
Self::Active
}
}
/// 1 when the ad set's switch was written.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Updated {
#[serde(rename = "0")]
Variant0,
#[serde(rename = "1")]
Variant1,
}
impl Default for Updated {
fn default() -> Updated {
Self::Variant0
}
}
/// 1 when a live read showed the ad set already in the requested state, so nothing was written.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Skipped {
#[serde(rename = "0")]
Variant0,
#[serde(rename = "1")]
Variant1,
}
impl Default for Skipped {
fn default() -> Skipped {
Self::Variant0
}
}