#![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::*;
use crate::protocol::gregor1;
use crate::protocol::keybase1;
pub type ThreadID = String;
pub type MessageID = u32;
pub type TLFConvOrdinal = u32;
pub type TopicID = String;
pub type ConversationID = String;
pub type TLFID = String;
pub type Hash = String;
pub type InboxVers = u64;
pub type LocalConversationVers = u64;
pub type ConversationVers = u64;
pub type OutboxID = String;
pub type TopicNameState = String;
pub type FlipGameID = String;
#[derive(Serialize, Deserialize, Debug)]
pub struct InboxVersInfo {
pub uid: Option<gregor1::UID>,
pub vers: Option<InboxVers>,
}
#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum ConversationExistence {
Active_0,
Archived_1,
Deleted_2,
Abandoned_3,
}
#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum ConversationMembersType {
Kbfs_0,
Team_1,
Impteamnative_2,
Impteamupgrade_3,
}
#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum SyncInboxResType {
Current_0,
Incremental_1,
Clear_2,
}
#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum MessageType {
None_0,
Text_1,
Attachment_2,
Edit_3,
Delete_4,
Metadata_5,
Tlfname_6,
Headline_7,
Attachmentuploaded_8,
Join_9,
Leave_10,
System_11,
Deletehistory_12,
Reaction_13,
Sendpayment_14,
Requestpayment_15,
Unfurl_16,
Flip_17,
}
#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum TopicType {
None_0,
Chat_1,
Dev_2,
Kbfsfileedit_3,
}
#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum TeamType {
None_0,
Simple_1,
Complex_2,
}
#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum NotificationKind {
Generic_0,
Atmention_1,
}
#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum GlobalAppNotificationSetting {
Newmessages_0,
Plaintextmobile_1,
Plaintextdesktop_2,
Defaultsoundmobile_3,
Disabletyping_4,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct GlobalAppNotificationSettings {
pub settings: Option<std::collections::HashMap<GlobalAppNotificationSetting, bool>>,
}
#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum ConversationStatus {
Unfiled_0,
Favorite_1,
Ignored_2,
Blocked_3,
Muted_4,
Reported_5,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ConversationMember {
pub uid: Option<gregor1::UID>,
pub convID: Option<ConversationID>,
pub topicType: Option<TopicType>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ConversationIDMessageIDPair {
pub convID: Option<ConversationID>,
pub msgID: Option<MessageID>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ConversationIDMessageIDPairs {
#[serde(default)]
pub pairs: Option<Vec<ConversationIDMessageIDPair>>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ChannelNameMention {
pub convID: Option<ConversationID>,
#[serde(default)]
pub topicName: Option<String>,
}
#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum ConversationMemberStatus {
Active_0,
Removed_1,
Left_2,
Preview_3,
Reset_4,
Never_joined_5,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct Pagination {
#[serde(default)]
pub next: Option<String>,
#[serde(default)]
pub previous: Option<String>,
pub num: Option<i32>,
#[serde(default)]
pub last: Option<bool>,
#[serde(default)]
pub forceFirstPage: Option<bool>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct RateLimit {
#[serde(default)]
pub name: Option<String>,
pub callsRemaining: Option<i32>,
pub windowReset: Option<i32>,
pub maxCalls: Option<i32>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct GetInboxQuery {
pub convID: Option<ConversationID>,
pub topicType: Option<TopicType>,
pub tlfID: Option<TLFID>,
pub tlfVisibility: Option<keybase1::TLFVisibility>,
pub before: Option<gregor1::Time>,
pub after: Option<gregor1::Time>,
pub oneChatTypePerTLF: Option<bool>,
pub topicName: Option<String>,
#[serde(default)]
pub status: Option<Vec<ConversationStatus>>,
#[serde(default)]
pub memberStatus: Option<Vec<ConversationMemberStatus>>,
#[serde(default)]
pub existences: Option<Vec<ConversationExistence>>,
#[serde(default)]
pub membersTypes: Option<Vec<ConversationMembersType>>,
#[serde(default)]
pub convIDs: Option<Vec<ConversationID>>,
#[serde(default)]
pub unreadOnly: Option<bool>,
#[serde(default)]
pub readOnly: Option<bool>,
#[serde(default)]
pub computeActiveList: Option<bool>,
#[serde(default)]
pub summarizeMaxMsgs: Option<bool>,
#[serde(default)]
pub skipBgLoads: Option<bool>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ConversationIDTriple {
pub tlfid: Option<TLFID>,
pub topicType: Option<TopicType>,
pub topicID: Option<TopicID>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ConversationFinalizeInfo {
#[serde(default)]
pub resetUser: Option<String>,
#[serde(default)]
pub resetDate: Option<String>,
#[serde(default)]
pub resetFull: Option<String>,
pub resetTimestamp: Option<gregor1::Time>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ConversationResolveInfo {
#[serde(default)]
pub newTLFName: Option<String>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct Expunge {
pub upto: Option<MessageID>,
pub basis: Option<MessageID>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ConversationMetadata {
pub idTriple: Option<ConversationIDTriple>,
pub conversationID: Option<ConversationID>,
pub visibility: Option<keybase1::TLFVisibility>,
pub status: Option<ConversationStatus>,
pub membersType: Option<ConversationMembersType>,
pub teamType: Option<TeamType>,
pub existence: Option<ConversationExistence>,
pub version: Option<ConversationVers>,
pub localVersion: Option<LocalConversationVers>,
pub finalizeInfo: Option<ConversationFinalizeInfo>,
#[serde(default)]
pub supersedes: Option<Vec<ConversationMetadata>>,
#[serde(default)]
pub supersededBy: Option<Vec<ConversationMetadata>>,
#[serde(default)]
pub activeList: Option<Vec<gregor1::UID>>,
#[serde(default)]
pub allList: Option<Vec<gregor1::UID>>,
#[serde(default)]
pub resetList: Option<Vec<gregor1::UID>>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ConversationNotificationInfo {
#[serde(default)]
pub channelWide: Option<bool>,
pub settings: Option<std::collections::HashMap<keybase1::DeviceType, std::collections::HashMap<NotificationKind, bool>>>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ConversationReaderInfo {
pub mtime: Option<gregor1::Time>,
pub readMsgid: Option<MessageID>,
pub maxMsgid: Option<MessageID>,
pub status: Option<ConversationMemberStatus>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ConversationCreatorInfo {
pub ctime: Option<gregor1::Time>,
pub uid: Option<gregor1::UID>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ConversationCreatorInfoLocal {
pub ctime: Option<gregor1::Time>,
#[serde(default)]
pub username: Option<String>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ConversationMinWriterRoleInfo {
pub uid: Option<gregor1::UID>,
pub role: Option<keybase1::TeamRole>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ConversationSettings {
#[serde(rename = "mwr")]
pub minWriterRoleInfo: Option<ConversationMinWriterRoleInfo>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct Conversation {
pub metadata: Option<ConversationMetadata>,
pub readerInfo: Option<ConversationReaderInfo>,
pub notifications: Option<ConversationNotificationInfo>,
#[serde(default)]
pub maxMsgs: Option<Vec<MessageBoxed>>,
#[serde(default)]
pub maxMsgSummaries: Option<Vec<MessageSummary>>,
pub creatorInfo: Option<ConversationCreatorInfo>,
pub expunge: Option<Expunge>,
pub convRetention: Option<RetentionPolicy>,
pub teamRetention: Option<RetentionPolicy>,
#[serde(rename = "cs")]
pub convSettings: Option<ConversationSettings>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct MessageSummary {
pub msgID: Option<MessageID>,
pub messageType: Option<MessageType>,
#[serde(default)]
pub tlfName: Option<String>,
#[serde(default)]
pub tlfPublic: Option<bool>,
pub ctime: Option<gregor1::Time>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct Reaction {
pub ctime: Option<gregor1::Time>,
pub reactionMsgID: Option<MessageID>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ReactionMap {
pub reactions: Option<std::collections::HashMap<String, std::collections::HashMap<String, Reaction>>>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct MessageServerHeader {
pub messageID: Option<MessageID>,
pub supersededBy: Option<MessageID>,
#[serde(rename = "r")]
#[serde(default)]
pub reactionIDs: Option<Vec<MessageID>>,
#[serde(rename = "u")]
#[serde(default)]
pub unfurlIDs: Option<Vec<MessageID>>,
#[serde(default)]
pub replies: Option<Vec<MessageID>>,
pub ctime: Option<gregor1::Time>,
#[serde(rename = "n")]
pub now: Option<gregor1::Time>,
#[serde(rename = "rt")]
pub rtime: Option<gregor1::Time>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct MessagePreviousPointer {
pub id: Option<MessageID>,
#[serde(default)]
pub hash: Option<String>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct OutboxInfo {
pub prev: Option<MessageID>,
pub composeTime: Option<gregor1::Time>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct MsgEphemeralMetadata {
#[serde(rename = "l")]
pub lifetime: Option<gregor1::DurationSec>,
#[serde(rename = "g")]
pub generation: Option<keybase1::EkGeneration>,
#[serde(rename = "u")]
pub explodedBy: Option<String>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct EphemeralPurgeInfo {
#[serde(rename = "c")]
pub convID: Option<ConversationID>,
#[serde(rename = "a")]
#[serde(default)]
pub isActive: Option<bool>,
#[serde(rename = "n")]
pub nextPurgeTime: Option<gregor1::Time>,
#[serde(rename = "e")]
pub minUnexplodedID: Option<MessageID>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct MessageClientHeader {
pub conv: Option<ConversationIDTriple>,
#[serde(default)]
pub tlfName: Option<String>,
#[serde(default)]
pub tlfPublic: Option<bool>,
pub messageType: Option<MessageType>,
pub supersedes: Option<MessageID>,
pub kbfsCryptKeysUsed: Option<bool>,
#[serde(default)]
pub deletes: Option<Vec<MessageID>>,
#[serde(default)]
pub prev: Option<Vec<MessagePreviousPointer>>,
pub deleteHistory: Option<MessageDeleteHistory>,
pub sender: Option<gregor1::UID>,
pub senderDevice: Option<gregor1::DeviceID>,
pub merkleRoot: Option<MerkleRoot>,
pub outboxID: Option<OutboxID>,
pub outboxInfo: Option<OutboxInfo>,
#[serde(rename = "em")]
pub ephemeralMetadata: Option<MsgEphemeralMetadata>,
#[serde(rename = "pm")]
pub pairwiseMacs: Option<std::collections::HashMap<keybase1::KID, String>>,
#[serde(rename = "b")]
pub botUID: Option<gregor1::UID>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct MessageClientHeaderVerified {
pub conv: Option<ConversationIDTriple>,
#[serde(default)]
pub tlfName: Option<String>,
#[serde(default)]
pub tlfPublic: Option<bool>,
pub messageType: Option<MessageType>,
#[serde(default)]
pub prev: Option<Vec<MessagePreviousPointer>>,
pub sender: Option<gregor1::UID>,
pub senderDevice: Option<gregor1::DeviceID>,
pub kbfsCryptKeysUsed: Option<bool>,
pub merkleRoot: Option<MerkleRoot>,
pub outboxID: Option<OutboxID>,
pub outboxInfo: Option<OutboxInfo>,
#[serde(rename = "em")]
pub ephemeralMetadata: Option<MsgEphemeralMetadata>,
#[serde(rename = "rt")]
pub rtime: Option<gregor1::Time>,
#[serde(rename = "pm")]
#[serde(default)]
pub hasPairwiseMacs: Option<bool>,
#[serde(rename = "b")]
pub botUID: Option<gregor1::UID>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct EncryptedData {
pub v: Option<i32>,
#[serde(default)]
pub e: Option<String>,
#[serde(default)]
pub n: Option<String>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct SignEncryptedData {
pub v: Option<i32>,
#[serde(default)]
pub e: Option<String>,
#[serde(default)]
pub n: Option<String>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct SealedData {
pub v: Option<i32>,
#[serde(default)]
pub e: Option<String>,
#[serde(default)]
pub n: Option<String>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct SignatureInfo {
pub v: Option<i32>,
#[serde(default)]
pub s: Option<String>,
#[serde(default)]
pub k: Option<String>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct MerkleRoot {
pub seqno: Option<i64>,
#[serde(default)]
pub hash: Option<String>,
}
#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum InboxResType {
Versionhit_0,
Full_1,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct InboxViewFull {
pub vers: Option<InboxVers>,
#[serde(default)]
pub conversations: Option<Vec<Conversation>>,
pub pagination: Option<Pagination>,
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
pub enum InboxView {
Versionhit {versionhit: ()},
Full {full: InboxViewFull},
}
#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum RetentionPolicyType {
None_0,
Retain_1,
Expire_2,
Inherit_3,
Ephemeral_4,
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
pub enum RetentionPolicy {
Retain {retain: RpRetain},
Expire {expire: RpExpire},
Inherit {inherit: RpInherit},
Ephemeral {ephemeral: RpEphemeral},
}
#[derive(Serialize, Deserialize, Debug)]
pub struct RpRetain {
}
#[derive(Serialize, Deserialize, Debug)]
pub struct RpExpire {
pub age: Option<gregor1::DurationSec>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct RpInherit {
}
#[derive(Serialize, Deserialize, Debug)]
pub struct RpEphemeral {
pub age: Option<gregor1::DurationSec>,
}
#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum GetThreadReason {
General_0,
Push_1,
Foreground_2,
Backgroundconvload_3,
Fixretry_4,
Prepare_5,
Searcher_6,
Indexed_search_7,
Kbfsfileactivity_8,
Coinflip_9,
Botcommands_10,
}
#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum ReIndexingMode {
None_0,
Presearch_sync_1,
Postsearch_sync_2,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct SearchOpts {
#[serde(default)]
pub isRegex: Option<bool>,
#[serde(default)]
pub sentBy: Option<String>,
#[serde(default)]
pub sentTo: Option<String>,
#[serde(default)]
pub matchMentions: Option<bool>,
pub sentBefore: Option<gregor1::Time>,
pub sentAfter: Option<gregor1::Time>,
pub maxHits: Option<i32>,
pub maxMessages: Option<i32>,
pub beforeContext: Option<i32>,
pub afterContext: Option<i32>,
pub initialPagination: Option<Pagination>,
pub reindexMode: Option<ReIndexingMode>,
pub maxConvsSearched: Option<i32>,
pub maxConvsHit: Option<i32>,
pub convID: Option<ConversationID>,
pub maxNameConvs: Option<i32>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct EmptyStruct {
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ChatSearchMatch {
pub startIndex: Option<i32>,
pub endIndex: Option<i32>,
#[serde(rename = "match")]
#[serde(default)]
pub match_: Option<String>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ChatSearchHit {
#[serde(default)]
pub beforeMessages: Option<Vec<Box<UIMessage>>>,
pub hitMessage: Option<Box<UIMessage>>,
#[serde(default)]
pub afterMessages: Option<Vec<Box<UIMessage>>>,
#[serde(default)]
pub matches: Option<Vec<ChatSearchMatch>>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ChatSearchInboxHit {
pub convID: Option<ConversationID>,
pub teamType: Option<TeamType>,
#[serde(default)]
pub convName: Option<String>,
#[serde(default)]
pub query: Option<String>,
pub time: Option<gregor1::Time>,
#[serde(default)]
pub hits: Option<Vec<ChatSearchHit>>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ChatSearchInboxResults {
#[serde(default)]
pub hits: Option<Vec<ChatSearchInboxHit>>,
pub percentIndexed: Option<i32>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ChatSearchInboxDone {
pub numHits: Option<i32>,
pub numConvs: Option<i32>,
pub percentIndexed: Option<i32>,
#[serde(default)]
pub delegated: Option<bool>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct ChatSearchIndexStatus {
pub percentIndexed: Option<i32>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct AssetMetadataImage {
pub width: Option<i32>,
pub height: Option<i32>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct AssetMetadataVideo {
pub width: Option<i32>,
pub height: Option<i32>,
pub durationMs: Option<i32>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct AssetMetadataAudio {
pub durationMs: Option<i32>,
}
#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum AssetMetadataType {
None_0,
Image_1,
Video_2,
Audio_3,
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
pub enum AssetMetadata {
Image {image: AssetMetadataImage},
Video {video: AssetMetadataVideo},
Audio {audio: AssetMetadataAudio},
}
#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum AssetTag {
Primary_0,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct Asset {
#[serde(default)]
pub filename: Option<String>,
#[serde(default)]
pub region: Option<String>,
#[serde(default)]
pub endpoint: Option<String>,
#[serde(default)]
pub bucket: Option<String>,
#[serde(default)]
pub path: Option<String>,
pub size: Option<i64>,
#[serde(default)]
pub mimeType: Option<String>,
#[serde(default)]
pub encHash: Option<String>,
#[serde(default)]
pub key: Option<String>,
#[serde(default)]
pub verifyKey: Option<String>,
#[serde(default)]
pub title: Option<String>,
#[serde(default)]
pub nonce: Option<String>,
pub metadata: Option<AssetMetadata>,
pub tag: Option<AssetTag>,
}
#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum BotCommandsAdvertisementTyp {
Public_0,
Tlfid_members_1,
Tlfid_convs_2,
}