use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookPayloadCommentComment {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "postId")]
pub post_id: String,
#[serde(rename = "platformPostId")]
pub platform_post_id: String,
#[serde(rename = "platform")]
pub platform: Platform,
#[serde(rename = "text")]
pub text: String,
#[serde(rename = "author")]
pub author: Box<models::WebhookPayloadCommentCommentAuthor>,
#[serde(rename = "createdAt")]
pub created_at: String,
#[serde(rename = "isReply")]
pub is_reply: bool,
#[serde(rename = "parentCommentId")]
pub parent_comment_id: String,
}
impl WebhookPayloadCommentComment {
pub fn new(
id: String,
post_id: String,
platform_post_id: String,
platform: Platform,
text: String,
author: models::WebhookPayloadCommentCommentAuthor,
created_at: String,
is_reply: bool,
parent_comment_id: String,
) -> WebhookPayloadCommentComment {
WebhookPayloadCommentComment {
id,
post_id,
platform_post_id,
platform,
text,
author: Box::new(author),
created_at,
is_reply,
parent_comment_id,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Platform {
#[serde(rename = "instagram")]
Instagram,
#[serde(rename = "facebook")]
Facebook,
#[serde(rename = "twitter")]
Twitter,
#[serde(rename = "youtube")]
Youtube,
#[serde(rename = "linkedin")]
Linkedin,
#[serde(rename = "bluesky")]
Bluesky,
#[serde(rename = "reddit")]
Reddit,
}
impl Default for Platform {
fn default() -> Platform {
Self::Instagram
}
}