/*
 * Late API
 *
 * API reference for Late. Authenticate with a Bearer API key. Base URL: https://getlate.dev/api
 *
 * The version of the OpenAPI document: 1.0.1
 * Contact: support@getlate.dev
 * Generated by: https://openapi-generator.tech
 */

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

/// WebhookPayloadPost : Webhook payload for post events
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookPayloadPost {
    #[serde(rename = "event", skip_serializing_if = "Option::is_none")]
    pub event: Option<Event>,
    #[serde(rename = "post", skip_serializing_if = "Option::is_none")]
    pub post: Option<Box<models::WebhookPayloadPostPost>>,
    #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")]
    pub timestamp: Option<String>,
}

impl WebhookPayloadPost {
    /// Webhook payload for post events
    pub fn new() -> WebhookPayloadPost {
        WebhookPayloadPost {
            event: None,
            post: None,
            timestamp: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Event {
    #[serde(rename = "post.scheduled")]
    PostScheduled,
    #[serde(rename = "post.published")]
    PostPublished,
    #[serde(rename = "post.failed")]
    PostFailed,
    #[serde(rename = "post.partial")]
    PostPartial,
    #[serde(rename = "post.recycled")]
    PostRecycled,
}

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