/*
* 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.610.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 LaunchCampaignAds200ResponseResultsInner {
#[serde(rename = "submissionId")]
pub submission_id: String,
/// `in_progress`: another launch of this post into the same placement is still running.
#[serde(rename = "outcome")]
pub outcome: Outcome,
#[serde(rename = "identity")]
pub identity: Identity,
/// Zernio ad id, as in /v1/ads.
#[serde(rename = "adId", deserialize_with = "Option::deserialize")]
pub ad_id: Option<String>,
/// Why the post did not launch.
#[serde(rename = "error", deserialize_with = "Option::deserialize")]
pub error: Option<String>,
}
impl LaunchCampaignAds200ResponseResultsInner {
pub fn new(
submission_id: String,
outcome: Outcome,
identity: Identity,
ad_id: Option<String>,
error: Option<String>,
) -> LaunchCampaignAds200ResponseResultsInner {
LaunchCampaignAds200ResponseResultsInner {
submission_id,
outcome,
identity,
ad_id,
error,
}
}
}
/// `in_progress`: another launch of this post into the same placement is still running.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Outcome {
#[serde(rename = "launched")]
Launched,
#[serde(rename = "already_launched")]
AlreadyLaunched,
#[serde(rename = "in_progress")]
InProgress,
#[serde(rename = "failed")]
Failed,
}
impl Default for Outcome {
fn default() -> Outcome {
Self::Launched
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Identity {
#[serde(rename = "brand")]
Brand,
#[serde(rename = "creator")]
Creator,
}
impl Default for Identity {
fn default() -> Identity {
Self::Brand
}
}