/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
 *
 * The version of the OpenAPI document: 1.0.4
 * 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")]
    pub post_id: 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")]
    pub parent_comment_id: String,
    #[serde(rename = "ad", skip_serializing_if = "Option::is_none")]
    pub ad: Option<Box<models::WebhookPayloadCommentCommentAd>>,
}

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,
            ad: 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 = "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
    }
}
