/*
 * 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};

/// DiscordPlatformDataThreadFromMessage : Create a follow-up thread under the published message.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DiscordPlatformDataThreadFromMessage {
    /// Thread name (1-100 chars)
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Auto-archive after inactivity (minutes)
    #[serde(
        rename = "autoArchiveDuration",
        skip_serializing_if = "Option::is_none"
    )]
    pub auto_archive_duration: Option<AutoArchiveDuration>,
    /// Slow-mode duration in seconds (0-21600)
    #[serde(rename = "rateLimitPerUser", skip_serializing_if = "Option::is_none")]
    pub rate_limit_per_user: Option<i32>,
}

impl DiscordPlatformDataThreadFromMessage {
    /// Create a follow-up thread under the published message.
    pub fn new() -> DiscordPlatformDataThreadFromMessage {
        DiscordPlatformDataThreadFromMessage {
            name: None,
            auto_archive_duration: None,
            rate_limit_per_user: None,
        }
    }
}
/// Auto-archive after inactivity (minutes)
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AutoArchiveDuration {
    #[serde(rename = "60")]
    Variant60,
    #[serde(rename = "1440")]
    Variant1440,
    #[serde(rename = "4320")]
    Variant4320,
    #[serde(rename = "10080")]
    Variant10080,
}

impl Default for AutoArchiveDuration {
    fn default() -> AutoArchiveDuration {
        Self::Variant60
    }
}
