/*
 * 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 CreateDiscordThreadRequest {
    /// Thread name
    #[serde(rename = "name")]
    pub name: String,
    /// Optional message snowflake to start the thread from. Omit for a standalone thread.
    #[serde(rename = "messageId", skip_serializing_if = "Option::is_none")]
    pub message_id: Option<String>,
    /// Minutes of inactivity before the thread auto-archives. Discord accepts only these four values.
    #[serde(
        rename = "autoArchiveDuration",
        skip_serializing_if = "Option::is_none"
    )]
    pub auto_archive_duration: Option<AutoArchiveDuration>,
}

impl CreateDiscordThreadRequest {
    pub fn new(name: String) -> CreateDiscordThreadRequest {
        CreateDiscordThreadRequest {
            name,
            message_id: None,
            auto_archive_duration: None,
        }
    }
}
/// Minutes of inactivity before the thread auto-archives. Discord accepts only these four values.
#[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
    }
}
