1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
use crate::responses::User;
use serde::Deserialize;
/// Contains counts, participants, chat restrictions, profiles, and groups data
#[derive(Debug, Deserialize)]
pub struct Members {
/// The total number of conversation members
pub count: u64,
/// A list of conversation members
pub items: Vec<Member>,
/// Restrictions applied to the conversation
pub chat_restrictions: Option<ChatRestrictions>,
/// List of users profiles
pub profiles: Vec<User>,
/// List of groups involved in the conversation
pub groups: Vec<Group>,
}
/// Represents an individual member within the conversation
#[derive(Debug, Deserialize)]
pub struct Member {
/// The member's identifier
pub member_id: i32,
/// Identifier of the user who invited the member
pub invited_by: i32,
/// The date and time the member was added to the conversation, in Unix Timestamp format
pub join_date: u64,
/// Indicates whether the member is an administrator.
#[serde(default)]
pub is_admin: bool,
/// Indicates whether the member has the ability to remove other members
/// This field may not be present if the member is a bot, a detail not explicitly mentioned in the VK API documentation
#[serde(default)]
pub can_kick: bool,
}
/// Information regarding the chat's administrative restrictions
#[derive(Debug, Deserialize)]
pub struct ChatRestrictions {
/// True if only administrators can promote users to admin status
pub admins_promote_users: bool,
/// True if only administrators can edit the chat info
pub only_admins_edit_info: bool,
/// True if only administrators can edit the pinned message
pub only_admins_edit_pin: bool,
/// True if only administrators can invite new users to the chat
pub only_admins_invite: bool,
/// True if only administrators can remove users from the chat
pub only_admins_kick: bool,
}
/// Represents a group within the conversation
#[derive(Debug, Deserialize)]
pub struct Group {
/// The group's identifier
pub id: i32,
/// The name of the group
pub name: String,
/// The group's screen name or alias
pub screen_name: String,
/// Indicates the group's closed status with an integer (likely 0 for open, 1 for closed)
pub is_closed: i32,
/// The type of the group (e.g., "group")
#[serde(rename = "type")]
pub group_type: String,
/// URL to the group's photo of size 50x50 pixels
pub photo_50: String,
/// URL to the group's photo of size 100x100 pixels
pub photo_100: String,
/// URL to the group's photo of size 200x200 pixels
pub photo_200: String,
}