/*
* 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.456.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 WebhookPayloadCampaignSubmissionSubmission {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "platform")]
pub platform: String,
#[serde(rename = "platformPostId")]
pub platform_post_id: String,
#[serde(rename = "platformPostUrl", deserialize_with = "Option::deserialize")]
pub platform_post_url: Option<String>,
#[serde(rename = "status")]
pub status: String,
#[serde(rename = "viewsAtSubmission", deserialize_with = "Option::deserialize")]
pub views_at_submission: Option<i32>,
/// Views that count toward earnings at the latest read.
#[serde(rename = "viewsEligible", deserialize_with = "Option::deserialize")]
pub views_eligible: Option<i32>,
/// The campaign engagement types summed at the latest read. An engagements campaign earns on this count.
#[serde(rename = "engagementsLatest", deserialize_with = "Option::deserialize")]
pub engagements_latest: Option<i32>,
/// Views from ads, on YouTube and X. Null elsewhere or before the first read.
#[serde(rename = "viewsPaid", deserialize_with = "Option::deserialize")]
pub views_paid: Option<i32>,
#[serde(rename = "flags")]
pub flags: Vec<models::WebhookPayloadCampaignSubmissionSubmissionFlagsInner>,
}
impl WebhookPayloadCampaignSubmissionSubmission {
pub fn new(
id: String,
platform: String,
platform_post_id: String,
platform_post_url: Option<String>,
status: String,
views_at_submission: Option<i32>,
views_eligible: Option<i32>,
engagements_latest: Option<i32>,
views_paid: Option<i32>,
flags: Vec<models::WebhookPayloadCampaignSubmissionSubmissionFlagsInner>,
) -> WebhookPayloadCampaignSubmissionSubmission {
WebhookPayloadCampaignSubmissionSubmission {
id,
platform,
platform_post_id,
platform_post_url,
status,
views_at_submission,
views_eligible,
engagements_latest,
views_paid,
flags,
}
}
}