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
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
use types::*;
use super::NotificationService;

#[derive(Serialize, Deserialize, Default, Debug)]
#[serde(default)]

/// A Todoist Collaborator
pub struct Collaborator {
    /// the user ID of the collaborator
    pub id: ID,

    /// the collaborator's email
    pub email : String,

    /// the collaborator's timezone,
    pub timezone : String,

    /// the collaborator's avatar
    pub image_id : String,
}

#[derive(Serialize, Deserialize, Default, Debug)]
#[serde(default)]

/// A Todoist user
pub struct User {

    /// The user's ID
    pub id : ID,

    /// The user's API token
    pub token : String,

    /// The user's email
    pub email : String,

    /// the user's full name, formatted as "Firstname Lastname"
    pub full_name : String,

    /// the ID of the user's inbox project
    pub inbox_project : ID,

    /// the user's timezone info
    pub tz_info : TimeZoneInfo,

    /// the user's default view on todoist
    pub start_page : String,

    /// the first day of the week, between 1 and 7
    pub start_day : isize,

    /// the day of next week that tasks will be postponed to 
    pub next_week : isize,

    /// the format for time, 24h or 12h
    pub time_format : isize,

    /// the date format, DD-MM-YY or MM-DD-YY
    pub date_format : isize,

    /// the order to sort items, newest first (1), or oldest first (0)
    pub sort_order : isize,

    /// the default reminder method
    pub default_reminder : NotificationService,

    /// the default time in minutes for automatic reminders set
    pub auto_reminder : isize,

    /// the user's phone number
    pub mobile_number : Option<String>,

    /// the user's mobile host
    pub mobile_host : Option<String>,

    /// the total number of completed tasks
    pub completed_count : isize,

    /// tasks completed today
    pub completed_today : isize,

    /// the user's karma score
    pub karma : f64,

    /// the user's karma trend, e.g. up
    pub karma_trend : String,

    /// false if this user is a peasant
    pub is_premium : bool,

    /// when this user's premium ends
    pub premium_until : Option<String>,

    /// if this user is a business account admin
    pub is_biz_admin : bool,

    /// the ID of the user's business account
    pub business_account_id : Option<ID>,

    /// the ID of this user's avatar
    pub image_id : Option<String>,

    /// the user's small avatar
    pub avatar_small : Option<String>,

    /// the user's medium avatar
    pub avatar_medium : Option<String>,

    /// the user's big avatar
    pub avatar_big : Option<String>,

    /// the user's UI theme (a number between 0 and 10)
    pub theme : isize,

    #[serde(skip)]
    /// used internally by todoist
    pub features : Option<()>,

    /// When the user joined
    pub join_date : Date,
}