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
//! Lists

use User;
use types::DateTime;
use util;

/// Represents a List.
///
/// # Reference
///
/// 1. [GET lists/show — Twitter Developers](https://dev.twitter.com/rest/reference/get/lists/show)
#[derive(Clone, Debug, Deserialize, PartialEq)]
pub struct List {
    pub slug: String,
    pub name: String,
    #[serde(deserialize_with = "util::deserialize_datetime")]
    pub created_at: DateTime,
    pub uri: String,
    pub subscriber_count: u64,
    pub member_count: u64,
    pub mode: Mode,
    pub id: ListId,
    pub full_name: String,
    pub description: String,
    pub user: User,
    pub following: bool,
}

string_enums! {
    /// Represents `mode` field of `List`.
    #[derive(Clone, Debug)]
    pub enum Mode {
        :Public("public"),
        :Private("private");
        :Custom(_),
    }
}

/// ID of a list.
pub type ListId = u64;