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

/// DiscordScheduledEvent : Discord guild scheduled event. Returned by /v1/discord/guilds/{guildId}/events endpoints. Fields below are the subset Zernio consumes — Discord may return more (e.g. creator, image hash) which we pass through verbatim.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DiscordScheduledEvent {
    /// Event snowflake ID
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "guild_id", skip_serializing_if = "Option::is_none")]
    pub guild_id: Option<String>,
    /// Voice/stage channel ID; null for external events.
    #[serde(
        rename = "channel_id",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub channel_id: Option<Option<String>>,
    #[serde(
        rename = "creator_id",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub creator_id: Option<Option<String>>,
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(
        rename = "description",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub description: Option<Option<String>>,
    #[serde(
        rename = "scheduled_start_time",
        skip_serializing_if = "Option::is_none"
    )]
    pub scheduled_start_time: Option<String>,
    /// Required for external events; optional for voice/stage.
    #[serde(
        rename = "scheduled_end_time",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub scheduled_end_time: Option<Option<String>>,
    /// Always 2 (GUILD_ONLY) — Discord deprecated PUBLIC events.
    #[serde(rename = "privacy_level", skip_serializing_if = "Option::is_none")]
    pub privacy_level: Option<PrivacyLevel>,
    /// 1=SCHEDULED, 2=ACTIVE, 3=COMPLETED, 4=CANCELED
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    /// 1=STAGE_INSTANCE, 2=VOICE, 3=EXTERNAL
    #[serde(rename = "entity_type", skip_serializing_if = "Option::is_none")]
    pub entity_type: Option<EntityType>,
    #[serde(
        rename = "entity_id",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub entity_id: Option<Option<String>>,
    #[serde(rename = "entity_metadata", skip_serializing_if = "Option::is_none")]
    pub entity_metadata: Option<Box<models::DiscordScheduledEventEntityMetadata>>,
    /// Number of members who RSVP'd. Only present when withUserCount=true on list.
    #[serde(rename = "user_count", skip_serializing_if = "Option::is_none")]
    pub user_count: Option<i32>,
    /// Cover image hash; build URL via cdn.discordapp.com.
    #[serde(
        rename = "image",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub image: Option<Option<String>>,
}

impl DiscordScheduledEvent {
    /// Discord guild scheduled event. Returned by /v1/discord/guilds/{guildId}/events endpoints. Fields below are the subset Zernio consumes — Discord may return more (e.g. creator, image hash) which we pass through verbatim.
    pub fn new() -> DiscordScheduledEvent {
        DiscordScheduledEvent {
            id: None,
            guild_id: None,
            channel_id: None,
            creator_id: None,
            name: None,
            description: None,
            scheduled_start_time: None,
            scheduled_end_time: None,
            privacy_level: None,
            status: None,
            entity_type: None,
            entity_id: None,
            entity_metadata: None,
            user_count: None,
            image: None,
        }
    }
}
/// Always 2 (GUILD_ONLY) — Discord deprecated PUBLIC events.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PrivacyLevel {
    #[serde(rename = "2")]
    Variant2,
}

impl Default for PrivacyLevel {
    fn default() -> PrivacyLevel {
        Self::Variant2
    }
}
/// 1=SCHEDULED, 2=ACTIVE, 3=COMPLETED, 4=CANCELED
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "1")]
    Variant1,
    #[serde(rename = "2")]
    Variant2,
    #[serde(rename = "3")]
    Variant3,
    #[serde(rename = "4")]
    Variant4,
}

impl Default for Status {
    fn default() -> Status {
        Self::Variant1
    }
}
/// 1=STAGE_INSTANCE, 2=VOICE, 3=EXTERNAL
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum EntityType {
    #[serde(rename = "1")]
    Variant1,
    #[serde(rename = "2")]
    Variant2,
    #[serde(rename = "3")]
    Variant3,
}

impl Default for EntityType {
    fn default() -> EntityType {
        Self::Variant1
    }
}
