zulip-api 0.0.8

Client library for interacting with the Zulip API
Documentation
use serde::{Deserialize, Serialize};

use crate::{field_access, impl_default, impl_display};

/// Represents details of unread group direct messages with a specific group of users.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct UnreadMsgsHuddle {
    #[serde(skip_serializing_if = "Option::is_none")]
    user_ids_string: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    unread_message_ids: Option<Vec<u64>>,
}

impl UnreadMsgsHuddle {
    /// Creates a new [Self].
    pub const fn new() -> Self {
        Self {
            user_ids_string: None,
            unread_message_ids: None,
        }
    }
}

field_access! {
    UnreadMsgsHuddle {
        /// A string containing the IDs of all users in the group direct message conversation, including the current user, separated by commas and sorted numerically; for example: `\"1,2,3\"`.
        user_ids_string: option_cow_deref { str, String },
        /// The message IDs of the recent unread messages which have been sent in this group direct message conversation, sorted in ascending order.
        unread_message_ids: option_cow_deref { [u64], Vec<u64> },
    }
}

impl_default!(UnreadMsgsHuddle);
impl_display!(UnreadMsgsHuddle);