keybase-protocol 0.1.1

Provides the Keybase types defined in the Keybase AVDL Protocol files for Rust.
Documentation
// 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;