/*
* 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.104.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 AnalyticsSinglePostResponseMediaItemsInner {
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub r#type: Option<Type>,
/// 'Direct URL to the media file. Null when the platform withholds it: check mediaStatus before downloading. Instagram omits the video file for Reels it flags as containing copyrighted material (its docs name audio as the usual cause), so type stays \"video\" while the file is permanently unreachable.'
#[serde(
rename = "url",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub url: Option<Option<String>>,
/// Thumbnail URL (same as url for images). Still present when url is null.
#[serde(
rename = "thumbnail",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub thumbnail: Option<Option<String>>,
/// Accessibility alt text set on the media, when present.
#[serde(rename = "altText", skip_serializing_if = "Option::is_none")]
pub alt_text: Option<String>,
/// unavailable means the media file could not be retrieved (url is null or, for LinkedIn videos, a cover image standing in for the file). available or absent means the file is available at url (older synced items omit the field).
#[serde(rename = "mediaStatus", skip_serializing_if = "Option::is_none")]
pub media_status: Option<MediaStatus>,
/// Why the file is missing. platform_withheld means the platform declined to return it and retrying will not help.
#[serde(rename = "unavailableReason", skip_serializing_if = "Option::is_none")]
pub unavailable_reason: Option<UnavailableReason>,
}
impl AnalyticsSinglePostResponseMediaItemsInner {
pub fn new() -> AnalyticsSinglePostResponseMediaItemsInner {
AnalyticsSinglePostResponseMediaItemsInner {
r#type: None,
url: None,
thumbnail: None,
alt_text: None,
media_status: None,
unavailable_reason: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "image")]
Image,
#[serde(rename = "video")]
Video,
}
impl Default for Type {
fn default() -> Type {
Self::Image
}
}
/// unavailable means the media file could not be retrieved (url is null or, for LinkedIn videos, a cover image standing in for the file). available or absent means the file is available at url (older synced items omit the field).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MediaStatus {
#[serde(rename = "available")]
Available,
#[serde(rename = "unavailable")]
Unavailable,
}
impl Default for MediaStatus {
fn default() -> MediaStatus {
Self::Available
}
}
/// Why the file is missing. platform_withheld means the platform declined to return it and retrying will not help.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum UnavailableReason {
#[serde(rename = "platform_withheld")]
PlatformWithheld,
}
impl Default for UnavailableReason {
fn default() -> UnavailableReason {
Self::PlatformWithheld
}
}