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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// Namespace: "gregor.1"
// Protocol: "common"
#![allow(dead_code)]
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
#![allow(unused_imports)]
use serde::{Serialize, Deserialize};
use serde_repr::{Deserialize_repr, Serialize_repr};use super::*;

#[derive(Serialize, Deserialize, Debug)]
pub struct TimeOrOffset {
  pub time: Option<Time>,
  pub offset: Option<DurationMsec>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct Metadata {
  pub uid: Option<UID>,
  pub msgID: Option<MsgID>,
  pub ctime: Option<Time>,
  pub deviceID: Option<DeviceID>,
  pub inBandMsgType: Option<i32>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct InBandMessage {
  pub stateUpdate: Option<StateUpdateMessage>,
  pub stateSync: Option<StateSyncMessage>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct State {
  #[serde(default)]
  pub items: Option<Vec<ItemAndMetadata>>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct StateUpdateMessage {
  pub md: Option<Metadata>,
  pub creation: Option<Item>,
  pub dismissal: Option<Dismissal>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct StateSyncMessage {
  pub md: Option<Metadata>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct MsgRange {
  pub endTime: Option<TimeOrOffset>,
  pub category: Option<Category>,
  #[serde(default)]
  pub skipMsgIDs: Option<Vec<MsgID>>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct Dismissal {
  #[serde(default)]
  pub msgIDs: Option<Vec<MsgID>>,
  #[serde(default)]
  pub ranges: Option<Vec<MsgRange>>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct Item {
  pub category: Option<Category>,
  pub dtime: Option<TimeOrOffset>,
  #[serde(default)]
  pub remindTimes: Option<Vec<TimeOrOffset>>,
  pub body: Option<Body>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct ItemAndMetadata {
  pub md: Option<Metadata>,
  pub item: Option<Item>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct Reminder {
  pub item: Option<ItemAndMetadata>,
  pub seqno: Option<i32>,
  pub remindTime: Option<Time>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct ReminderID {
  pub uid: Option<UID>,
  pub msgID: Option<MsgID>,
  pub seqno: Option<i32>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct OutOfBandMessage {
  pub uid: Option<UID>,
  pub system: Option<System>,
  pub body: Option<Body>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct ReminderSet {
  #[serde(default)]
  pub reminders: Option<Vec<Reminder>>,
  #[serde(default)]
  pub moreRemindersReady: Option<bool>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct Message {
  pub oobm: Option<OutOfBandMessage>,
  pub ibm: Option<InBandMessage>,
}

// LINT: @lint("ignore")
pub type DurationMsec = i64;

// LINT: @lint("ignore")
pub type DurationSec = i64;

pub type Category = String;

pub type System = String;

pub type UID = String;

pub type MsgID = String;

pub type DeviceID = String;

pub type Body = String;

pub type Time = i64;

pub type SessionID = String;

pub type SessionToken = String;