/*
 * 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 SearchInboxConversations200ResponseDataInnerConversation {
    /// Conversation ID, usable with the conversation messages endpoints
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
    pub platform: Option<String>,
    #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
    pub account_id: Option<String>,
    #[serde(
        rename = "participantName",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub participant_name: Option<Option<String>>,
    #[serde(
        rename = "participantUsername",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub participant_username: Option<Option<String>>,
    #[serde(
        rename = "participantPicture",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub participant_picture: Option<Option<String>>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    #[serde(
        rename = "lastMessageAt",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub last_message_at: Option<Option<String>>,
}

impl SearchInboxConversations200ResponseDataInnerConversation {
    pub fn new() -> SearchInboxConversations200ResponseDataInnerConversation {
        SearchInboxConversations200ResponseDataInnerConversation {
            id: None,
            platform: None,
            account_id: None,
            participant_name: None,
            participant_username: None,
            participant_picture: None,
            status: None,
            last_message_at: None,
        }
    }
}
///
#[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
    }
}
