/*
* 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.608.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// CreatorPortalDraft : One version of a draft the creator uploaded for review.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreatorPortalDraft {
/// Pass as `draftId` when submitting the live post of an approved draft, or as `revisionOf` to answer a revision request.
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "chainId")]
pub chain_id: String,
#[serde(rename = "version")]
pub version: i32,
#[serde(rename = "revisionOf", deserialize_with = "Option::deserialize")]
pub revision_of: Option<String>,
#[serde(rename = "status")]
pub status: Status,
#[serde(rename = "mediaUrl")]
pub media_url: String,
#[serde(rename = "mediaType")]
pub media_type: MediaType,
#[serde(rename = "caption")]
pub caption: String,
#[serde(rename = "reviewNote", deserialize_with = "Option::deserialize")]
pub review_note: Option<String>,
#[serde(rename = "comments")]
pub comments: Vec<models::CreatorPortalDraftCommentsInner>,
#[serde(rename = "submittedAt")]
pub submitted_at: String,
#[serde(rename = "reviewedAt", deserialize_with = "Option::deserialize")]
pub reviewed_at: Option<String>,
/// The live post submitted for this draft.
#[serde(rename = "submissionId", deserialize_with = "Option::deserialize")]
pub submission_id: Option<String>,
}
impl CreatorPortalDraft {
/// One version of a draft the creator uploaded for review.
pub fn new(
id: String,
chain_id: String,
version: i32,
revision_of: Option<String>,
status: Status,
media_url: String,
media_type: MediaType,
caption: String,
review_note: Option<String>,
comments: Vec<models::CreatorPortalDraftCommentsInner>,
submitted_at: String,
reviewed_at: Option<String>,
submission_id: Option<String>,
) -> CreatorPortalDraft {
CreatorPortalDraft {
id,
chain_id,
version,
revision_of,
status,
media_url,
media_type,
caption,
review_note,
comments,
submitted_at,
reviewed_at,
submission_id,
}
}
}
///
#[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
}
}
///
#[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
}
}