/*
* 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).
*
* The version of the OpenAPI document: 1.43.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 WebhookPayloadCommentComment {
/// Platform comment ID
#[serde(rename = "id")]
pub id: String,
/// Internal post ID (null for posts not published through Zernio)
#[serde(rename = "postId", deserialize_with = "Option::deserialize")]
pub post_id: Option<String>,
/// Platform's post ID
#[serde(rename = "platformPostId")]
pub platform_post_id: String,
#[serde(rename = "platform")]
pub platform: Platform,
/// Comment text content
#[serde(rename = "text")]
pub text: String,
#[serde(rename = "author")]
pub author: Box<models::WebhookPayloadCommentCommentAuthor>,
#[serde(rename = "createdAt")]
pub created_at: String,
/// Whether this is a reply to another comment
#[serde(rename = "isReply")]
pub is_reply: bool,
/// Parent comment ID if this is a reply
#[serde(rename = "parentCommentId", deserialize_with = "Option::deserialize")]
pub parent_comment_id: Option<String>,
#[serde(rename = "ad", skip_serializing_if = "Option::is_none")]
pub ad: Option<Box<models::WebhookPayloadCommentCommentAd>>,
#[serde(rename = "attachment", skip_serializing_if = "Option::is_none")]
pub attachment: Option<Box<models::WebhookPayloadCommentCommentAttachment>>,
}
impl WebhookPayloadCommentComment {
pub fn new(
id: String,
post_id: Option<String>,
platform_post_id: String,
platform: Platform,
text: String,
author: models::WebhookPayloadCommentCommentAuthor,
created_at: String,
is_reply: bool,
parent_comment_id: Option<String>,
) -> WebhookPayloadCommentComment {
WebhookPayloadCommentComment {
id,
post_id,
platform_post_id,
platform,
text,
author: Box::new(author),
created_at,
is_reply,
parent_comment_id,
ad: None,
attachment: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Platform {
#[serde(rename = "instagram")]
Instagram,
#[serde(rename = "facebook")]
Facebook,
#[serde(rename = "threads")]
Threads,
#[serde(rename = "youtube")]
Youtube,
#[serde(rename = "linkedin")]
Linkedin,
#[serde(rename = "bluesky")]
Bluesky,
#[serde(rename = "reddit")]
Reddit,
#[serde(rename = "tiktok")]
Tiktok,
}
impl Default for Platform {
fn default() -> Platform {
Self::Instagram
}
}