/*
* 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.115.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 AnalyticsSinglePostResponse {
#[serde(rename = "postId", skip_serializing_if = "Option::is_none")]
pub post_id: Option<String>,
/// Original Zernio post ID if scheduled via Zernio
#[serde(
rename = "latePostId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub late_post_id: Option<Option<String>>,
/// Overall post status. \"partial\" when some platforms published and others failed. While any platform is still pending or processing, the post's own status is returned instead (usually scheduled or publishing), even if another platform already published.
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<Status>,
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
pub content: Option<String>,
#[serde(rename = "scheduledFor", skip_serializing_if = "Option::is_none")]
pub scheduled_for: Option<String>,
#[serde(
rename = "publishedAt",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub published_at: Option<Option<String>>,
#[serde(rename = "analytics", skip_serializing_if = "Option::is_none")]
pub analytics: Option<Box<models::PostAnalytics>>,
#[serde(rename = "platformAnalytics", skip_serializing_if = "Option::is_none")]
pub platform_analytics: Option<Vec<models::PlatformAnalytics>>,
#[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
pub platform: Option<String>,
#[serde(
rename = "platformPostUrl",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub platform_post_url: Option<Option<String>>,
#[serde(rename = "isExternal", skip_serializing_if = "Option::is_none")]
pub is_external: Option<bool>,
/// Overall sync state across all platforms
#[serde(rename = "syncStatus", skip_serializing_if = "Option::is_none")]
pub sync_status: Option<SyncStatus>,
/// Human-readable status message for pending, partial, or failed states
#[serde(
rename = "message",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub message: Option<Option<String>>,
/// Cover image URL. Facebook and Instagram covers whose Meta CDN link expired are re-read from Meta and served from Zernio storage, so that URL does not expire and can be cached.
#[serde(
rename = "thumbnailUrl",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub thumbnail_url: Option<Option<String>>,
#[serde(
rename = "mediaType",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub media_type: Option<Option<MediaType>>,
/// All media items for this post. Carousel posts contain one entry per slide. Facebook and Instagram images and video covers whose Meta CDN links expired are re-read and served from Zernio storage (non-expiring). Facebook and Instagram video file URLs, and LinkedIn media URLs, stay the platform's signed links and are refreshed on read once they lapse.
#[serde(rename = "mediaItems", skip_serializing_if = "Option::is_none")]
pub media_items: Option<Vec<models::AnalyticsSinglePostResponseMediaItemsInner>>,
/// Instagram only: the platform media product type (e.g. FEED, REELS, STORY, AD). Absent when the platform did not report it.
#[serde(rename = "mediaProductType", skip_serializing_if = "Option::is_none")]
pub media_product_type: Option<String>,
/// Instagram only: whether Instagram labeled the media as AI-generated. Absent when the platform did not report it.
#[serde(rename = "isAiGenerated", skip_serializing_if = "Option::is_none")]
pub is_ai_generated: Option<bool>,
/// Instagram reels only: whether the reel is also shared to the main feed. Absent when the platform did not report it.
#[serde(rename = "isSharedToFeed", skip_serializing_if = "Option::is_none")]
pub is_shared_to_feed: Option<bool>,
/// Instagram only: audio type of the media (MUSIC or ORIGINAL_SOUND). Absent when the platform did not report it.
#[serde(rename = "mediaAudioType", skip_serializing_if = "Option::is_none")]
pub media_audio_type: Option<String>,
}
impl AnalyticsSinglePostResponse {
pub fn new() -> AnalyticsSinglePostResponse {
AnalyticsSinglePostResponse {
post_id: None,
late_post_id: None,
status: None,
content: None,
scheduled_for: None,
published_at: None,
analytics: None,
platform_analytics: None,
platform: None,
platform_post_url: None,
is_external: None,
sync_status: None,
message: None,
thumbnail_url: None,
media_type: None,
media_items: None,
media_product_type: None,
is_ai_generated: None,
is_shared_to_feed: None,
media_audio_type: None,
}
}
}
/// Overall post status. \"partial\" when some platforms published and others failed. While any platform is still pending or processing, the post's own status is returned instead (usually scheduled or publishing), even if another platform already published.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "published")]
Published,
#[serde(rename = "failed")]
Failed,
#[serde(rename = "partial")]
Partial,
#[serde(rename = "scheduled")]
Scheduled,
#[serde(rename = "publishing")]
Publishing,
#[serde(rename = "draft")]
Draft,
#[serde(rename = "cancelled")]
Cancelled,
}
impl Default for Status {
fn default() -> Status {
Self::Published
}
}
/// Overall sync state across all platforms
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SyncStatus {
#[serde(rename = "synced")]
Synced,
#[serde(rename = "pending")]
Pending,
#[serde(rename = "partial")]
Partial,
#[serde(rename = "unavailable")]
Unavailable,
}
impl Default for SyncStatus {
fn default() -> SyncStatus {
Self::Synced
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MediaType {
#[serde(rename = "image")]
Image,
#[serde(rename = "video")]
Video,
#[serde(rename = "carousel")]
Carousel,
#[serde(rename = "text")]
Text,
}
impl Default for MediaType {
fn default() -> MediaType {
Self::Image
}
}