/*
* 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.565.5
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// CampaignDraft : One version of a creator's content, uploaded for review before it is published. A revision is a new version in the same `chainId` with `version` + 1 and `revisionOf` set to the version it answers.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CampaignDraft {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "campaignId")]
pub campaign_id: String,
#[serde(rename = "participantId")]
pub participant_id: String,
#[serde(rename = "creator")]
pub creator: Box<models::CreatorCampaignAdResultsSubmissionsInnerCreator>,
/// The id of the first version of the chain.
#[serde(rename = "chainId")]
pub chain_id: String,
#[serde(rename = "version")]
pub version: i32,
/// The version this one answers; null on version 1.
#[serde(rename = "revisionOf", deserialize_with = "Option::deserialize")]
pub revision_of: Option<String>,
#[serde(rename = "mediaUrl")]
pub media_url: String,
#[serde(rename = "mediaType")]
pub media_type: MediaType,
#[serde(rename = "caption")]
pub caption: String,
/// submitted: waits for review. approved: the creator may publish it. revision_requested: the creator should upload a new version. rejected: final.
#[serde(rename = "status")]
pub status: Status,
/// The note sent with a revision request, or the rejection reason.
#[serde(rename = "reviewNote", deserialize_with = "Option::deserialize")]
pub review_note: Option<String>,
#[serde(rename = "reviewedAt", deserialize_with = "Option::deserialize")]
pub reviewed_at: Option<String>,
#[serde(rename = "submittedAt")]
pub submitted_at: String,
/// Review comments on this version, in video order.
#[serde(rename = "comments")]
pub comments: Vec<models::CampaignDraftCommentsInner>,
/// The live post submitted for this draft, once the creator published it.
#[serde(rename = "submissionId", deserialize_with = "Option::deserialize")]
pub submission_id: Option<String>,
}
impl CampaignDraft {
/// One version of a creator's content, uploaded for review before it is published. A revision is a new version in the same `chainId` with `version` + 1 and `revisionOf` set to the version it answers.
pub fn new(
id: String,
campaign_id: String,
participant_id: String,
creator: models::CreatorCampaignAdResultsSubmissionsInnerCreator,
chain_id: String,
version: i32,
revision_of: Option<String>,
media_url: String,
media_type: MediaType,
caption: String,
status: Status,
review_note: Option<String>,
reviewed_at: Option<String>,
submitted_at: String,
comments: Vec<models::CampaignDraftCommentsInner>,
submission_id: Option<String>,
) -> CampaignDraft {
CampaignDraft {
id,
campaign_id,
participant_id,
creator: Box::new(creator),
chain_id,
version,
revision_of,
media_url,
media_type,
caption,
status,
review_note,
reviewed_at,
submitted_at,
comments,
submission_id,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MediaType {
#[serde(rename = "video")]
Video,
#[serde(rename = "image")]
Image,
}
impl Default for MediaType {
fn default() -> MediaType {
Self::Video
}
}
/// submitted: waits for review. approved: the creator may publish it. revision_requested: the creator should upload a new version. rejected: final.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "submitted")]
Submitted,
#[serde(rename = "approved")]
Approved,
#[serde(rename = "revision_requested")]
RevisionRequested,
#[serde(rename = "rejected")]
Rejected,
}
impl Default for Status {
fn default() -> Status {
Self::Submitted
}
}