/*
* 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.5.0
* 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, Threads, YouTube, LinkedIn, Bluesky, Reddit, TikTok). X/Twitter does NOT fire this event. TikTok events carry only the author id: the comment.update webhook has no username, picture or owner flag.
#[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>,
/// UTC time at which Zernio generated this event (set once when the event payload is built, before delivery is queued). Retries and redeliveries keep the original value, so it reflects the event, not the delivery attempt.
#[serde(rename = "timestamp")]
pub timestamp: String,
}
impl WebhookPayloadComment {
/// Webhook payload for comment received events (Instagram, Facebook, Threads, YouTube, LinkedIn, Bluesky, Reddit, TikTok). X/Twitter does NOT fire this event. TikTok events carry only the author id: the comment.update webhook has no username, picture or owner flag.
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
}
}