/*
* 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.163.1
* 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 UpdateAdCampaignStatus200Response {
/// The campaign's delivery status derived from its switch as read back (`paused` when the 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 campaign's own switch as read back from the platform, in the raw platform vocabulary (Meta effective_status, TikTok ENABLE / DISABLE, Google ENABLED / PAUSED, ChatGPT (OpenAI) status). Null when the platform could not be read, which is always the case on Pinterest, LinkedIn and X (no single-campaign read).
#[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 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 campaign's switch was written.
#[serde(rename = "updated", skip_serializing_if = "Option::is_none")]
pub updated: Option<Updated>,
/// 1 when a live read showed the campaign 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 \"Campaign already switched off\".
#[serde(rename = "skippedReasons", skip_serializing_if = "Option::is_none")]
pub skipped_reasons: Option<Vec<String>>,
}
impl UpdateAdCampaignStatus200Response {
pub fn new() -> UpdateAdCampaignStatus200Response {
UpdateAdCampaignStatus200Response {
status: None,
platform_campaign_status: None,
status_read_at: None,
updated: None,
skipped: None,
skipped_reasons: None,
}
}
}
/// The campaign's delivery status derived from its switch as read back (`paused` when the 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 campaign'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 campaign 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
}
}