/*
 * 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.1
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// WebhookPayloadComment : Webhook payload for comment received events (Instagram, Facebook, Twitter/X, YouTube, LinkedIn, Bluesky, Reddit)
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookPayloadComment {
    /// Stable webhook event ID
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "event")]
    pub event: Event,
    #[serde(rename = "comment")]
    pub comment: Box<models::WebhookPayloadCommentComment>,
    #[serde(rename = "post")]
    pub post: Box<models::WebhookPayloadCommentPost>,
    #[serde(rename = "account")]
    pub account: Box<models::WebhookPayloadCommentAccount>,
    #[serde(rename = "timestamp")]
    pub timestamp: String,
}

impl WebhookPayloadComment {
    /// Webhook payload for comment received events (Instagram, Facebook, Twitter/X, YouTube, LinkedIn, Bluesky, Reddit)
    pub fn new(
        id: String,
        event: Event,
        comment: models::WebhookPayloadCommentComment,
        post: models::WebhookPayloadCommentPost,
        account: models::WebhookPayloadCommentAccount,
        timestamp: String,
    ) -> WebhookPayloadComment {
        WebhookPayloadComment {
            id,
            event,
            comment: Box::new(comment),
            post: Box::new(post),
            account: Box::new(account),
            timestamp,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Event {
    #[serde(rename = "comment.received")]
    CommentReceived,
}

impl Default for Event {
    fn default() -> Event {
        Self::CommentReceived
    }
}
