/*
 * 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.1
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

/// InboxWebhookConversation : The conversation context included in inbox webhook payloads.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct InboxWebhookConversation {
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "platformConversationId")]
    pub platform_conversation_id: String,
    #[serde(rename = "participantId", skip_serializing_if = "Option::is_none")]
    pub participant_id: Option<String>,
    #[serde(rename = "participantName", skip_serializing_if = "Option::is_none")]
    pub participant_name: Option<String>,
    #[serde(
        rename = "participantUsername",
        skip_serializing_if = "Option::is_none"
    )]
    pub participant_username: Option<String>,
    #[serde(rename = "participantPicture", skip_serializing_if = "Option::is_none")]
    pub participant_picture: Option<String>,
    #[serde(rename = "status")]
    pub status: Status,
}

impl InboxWebhookConversation {
    /// The conversation context included in inbox webhook payloads.
    pub fn new(
        id: String,
        platform_conversation_id: String,
        status: Status,
    ) -> InboxWebhookConversation {
        InboxWebhookConversation {
            id,
            platform_conversation_id,
            participant_id: None,
            participant_name: None,
            participant_username: None,
            participant_picture: None,
            status,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "active")]
    Active,
    #[serde(rename = "archived")]
    Archived,
}

impl Default for Status {
    fn default() -> Status {
        Self::Active
    }
}
