/*
* 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.523.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// CommentAttachment : The media on a comment or reply, one per comment (the first item when the platform returns several). `type` is the platform's own media kind: - Facebook: sticker, animated_image_share, photo, image_share, share or video_inline. - TikTok: image. - X: photo, video or animated_gif. A video `url` is an mp4 and `imageUrl` its preview. - Threads: IMAGE, VIDEO or GIF. Album replies carry no attachment. - Bluesky: image, video or external (link cards, GIFs arrive this way). A video `url` is an HLS playlist (.m3u8). Facebook and Threads URLs are expiring Meta CDN links, so fetch promptly. Instagram, YouTube, LinkedIn and Reddit comments carry no media.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CommentAttachment {
/// The platform's own media kind, see the schema description for each platform's values.
#[serde(rename = "type")]
pub r#type: String,
/// Rendered image or preview URL.
#[serde(rename = "imageUrl", skip_serializing_if = "Option::is_none")]
pub image_url: Option<String>,
/// Source or playable URL. Facebook GIFs carry an l.facebook.com redirect, X videos an mp4, Bluesky videos an HLS playlist.
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
}
impl CommentAttachment {
/// The media on a comment or reply, one per comment (the first item when the platform returns several). `type` is the platform's own media kind: - Facebook: sticker, animated_image_share, photo, image_share, share or video_inline. - TikTok: image. - X: photo, video or animated_gif. A video `url` is an mp4 and `imageUrl` its preview. - Threads: IMAGE, VIDEO or GIF. Album replies carry no attachment. - Bluesky: image, video or external (link cards, GIFs arrive this way). A video `url` is an HLS playlist (.m3u8). Facebook and Threads URLs are expiring Meta CDN links, so fetch promptly. Instagram, YouTube, LinkedIn and Reddit comments carry no media.
pub fn new(r#type: String) -> CommentAttachment {
CommentAttachment {
r#type,
image_url: None,
url: None,
}
}
}