Skip to main content

xmtp_proto/gen/
xmtp.device_sync.content.rs

1// This file is @generated by prost-build.
2/// All potential device sync group messages
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct DeviceSyncContent {
5    #[prost(oneof = "device_sync_content::Content", tags = "1, 2, 3, 4")]
6    pub content: ::core::option::Option<device_sync_content::Content>,
7}
8/// Nested message and enum types in `DeviceSyncContent`.
9pub mod device_sync_content {
10    #[derive(Clone, PartialEq, ::prost::Oneof)]
11    pub enum Content {
12        #[prost(message, tag = "1")]
13        Request(super::DeviceSyncRequest),
14        #[prost(message, tag = "2")]
15        Acknowledge(super::DeviceSyncAcknowledge),
16        #[prost(message, tag = "3")]
17        Reply(super::DeviceSyncReply),
18        #[prost(message, tag = "4")]
19        PreferenceUpdates(super::PreferenceUpdates),
20    }
21}
22impl ::prost::Name for DeviceSyncContent {
23    const NAME: &'static str = "DeviceSyncContent";
24    const PACKAGE: &'static str = "xmtp.device_sync.content";
25    fn full_name() -> ::prost::alloc::string::String {
26        "xmtp.device_sync.content.DeviceSyncContent".into()
27    }
28    fn type_url() -> ::prost::alloc::string::String {
29        "/xmtp.device_sync.content.DeviceSyncContent".into()
30    }
31}
32/// Acknowledges a request
33#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
34pub struct DeviceSyncAcknowledge {
35    #[prost(string, tag = "1")]
36    pub request_id: ::prost::alloc::string::String,
37}
38impl ::prost::Name for DeviceSyncAcknowledge {
39    const NAME: &'static str = "DeviceSyncAcknowledge";
40    const PACKAGE: &'static str = "xmtp.device_sync.content";
41    fn full_name() -> ::prost::alloc::string::String {
42        "xmtp.device_sync.content.DeviceSyncAcknowledge".into()
43    }
44    fn type_url() -> ::prost::alloc::string::String {
45        "/xmtp.device_sync.content.DeviceSyncAcknowledge".into()
46    }
47}
48/// Preference updates
49#[derive(Clone, PartialEq, ::prost::Message)]
50pub struct PreferenceUpdates {
51    #[prost(message, repeated, tag = "1")]
52    pub updates: ::prost::alloc::vec::Vec<PreferenceUpdate>,
53}
54impl ::prost::Name for PreferenceUpdates {
55    const NAME: &'static str = "PreferenceUpdates";
56    const PACKAGE: &'static str = "xmtp.device_sync.content";
57    fn full_name() -> ::prost::alloc::string::String {
58        "xmtp.device_sync.content.PreferenceUpdates".into()
59    }
60    fn type_url() -> ::prost::alloc::string::String {
61        "/xmtp.device_sync.content.PreferenceUpdates".into()
62    }
63}
64/// Preference update
65#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
66pub struct PreferenceUpdate {
67    #[prost(oneof = "preference_update::Update", tags = "1, 2")]
68    pub update: ::core::option::Option<preference_update::Update>,
69}
70/// Nested message and enum types in `PreferenceUpdate`.
71pub mod preference_update {
72    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
73    pub enum Update {
74        #[prost(message, tag = "1")]
75        Consent(super::super::consent_backup::ConsentSave),
76        #[prost(message, tag = "2")]
77        Hmac(super::HmacKeyUpdate),
78    }
79}
80impl ::prost::Name for PreferenceUpdate {
81    const NAME: &'static str = "PreferenceUpdate";
82    const PACKAGE: &'static str = "xmtp.device_sync.content";
83    fn full_name() -> ::prost::alloc::string::String {
84        "xmtp.device_sync.content.PreferenceUpdate".into()
85    }
86    fn type_url() -> ::prost::alloc::string::String {
87        "/xmtp.device_sync.content.PreferenceUpdate".into()
88    }
89}
90#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
91pub struct V1UserPreferenceUpdate {
92    #[prost(bytes = "vec", repeated, tag = "1")]
93    pub contents: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
94}
95impl ::prost::Name for V1UserPreferenceUpdate {
96    const NAME: &'static str = "V1UserPreferenceUpdate";
97    const PACKAGE: &'static str = "xmtp.device_sync.content";
98    fn full_name() -> ::prost::alloc::string::String {
99        "xmtp.device_sync.content.V1UserPreferenceUpdate".into()
100    }
101    fn type_url() -> ::prost::alloc::string::String {
102        "/xmtp.device_sync.content.V1UserPreferenceUpdate".into()
103    }
104}
105/// Hmac key update
106#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
107pub struct HmacKeyUpdate {
108    #[prost(bytes = "vec", tag = "1")]
109    pub key: ::prost::alloc::vec::Vec<u8>,
110    #[prost(int64, tag = "2")]
111    pub cycled_at_ns: i64,
112}
113impl ::prost::Name for HmacKeyUpdate {
114    const NAME: &'static str = "HmacKeyUpdate";
115    const PACKAGE: &'static str = "xmtp.device_sync.content";
116    fn full_name() -> ::prost::alloc::string::String {
117        "xmtp.device_sync.content.HmacKeyUpdate".into()
118    }
119    fn type_url() -> ::prost::alloc::string::String {
120        "/xmtp.device_sync.content.HmacKeyUpdate".into()
121    }
122}
123/// Initiator or new installation id requesting a sync payload send a request
124#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
125pub struct DeviceSyncRequest {
126    #[prost(string, tag = "1")]
127    pub pin: ::prost::alloc::string::String,
128    #[prost(string, tag = "2")]
129    pub server_url: ::prost::alloc::string::String,
130    #[deprecated]
131    #[prost(enumeration = "super::BackupElementSelection", tag = "3")]
132    pub deprecated_kind: i32,
133    #[prost(message, optional, tag = "4")]
134    pub options: ::core::option::Option<super::ArchiveOptions>,
135}
136impl ::prost::Name for DeviceSyncRequest {
137    const NAME: &'static str = "DeviceSyncRequest";
138    const PACKAGE: &'static str = "xmtp.device_sync.content";
139    fn full_name() -> ::prost::alloc::string::String {
140        "xmtp.device_sync.content.DeviceSyncRequest".into()
141    }
142    fn type_url() -> ::prost::alloc::string::String {
143        "/xmtp.device_sync.content.DeviceSyncRequest".into()
144    }
145}
146/// Pre-existing installation id capable of supplying a sync payload sends this reply
147#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
148pub struct DeviceSyncReply {
149    /// Must match an existing request_id from a message history request
150    #[prost(string, tag = "1")]
151    pub request_id: ::prost::alloc::string::String,
152    /// Where the messages can be retrieved from
153    #[prost(string, tag = "2")]
154    pub url: ::prost::alloc::string::String,
155    /// Encryption key
156    #[prost(message, optional, tag = "3")]
157    pub encryption_key: ::core::option::Option<DeviceSyncKeyType>,
158    /// ns unix timestamp of when the reply was sent
159    #[deprecated]
160    #[prost(uint64, tag = "4")]
161    pub timestamp_ns: u64,
162    /// request kind
163    #[deprecated]
164    #[prost(enumeration = "super::BackupElementSelection", tag = "5")]
165    pub kind: i32,
166    /// Metadata about the backup
167    #[prost(message, optional, tag = "6")]
168    pub metadata: ::core::option::Option<super::BackupMetadataSave>,
169}
170impl ::prost::Name for DeviceSyncReply {
171    const NAME: &'static str = "DeviceSyncReply";
172    const PACKAGE: &'static str = "xmtp.device_sync.content";
173    fn full_name() -> ::prost::alloc::string::String {
174        "xmtp.device_sync.content.DeviceSyncReply".into()
175    }
176    fn type_url() -> ::prost::alloc::string::String {
177        "/xmtp.device_sync.content.DeviceSyncReply".into()
178    }
179}
180/// Key used to encrypt the message-bundle
181#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
182pub struct DeviceSyncKeyType {
183    #[prost(oneof = "device_sync_key_type::Key", tags = "1")]
184    pub key: ::core::option::Option<device_sync_key_type::Key>,
185}
186/// Nested message and enum types in `DeviceSyncKeyType`.
187pub mod device_sync_key_type {
188    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
189    pub enum Key {
190        #[prost(bytes, tag = "1")]
191        Aes256Gcm(::prost::alloc::vec::Vec<u8>),
192    }
193}
194impl ::prost::Name for DeviceSyncKeyType {
195    const NAME: &'static str = "DeviceSyncKeyType";
196    const PACKAGE: &'static str = "xmtp.device_sync.content";
197    fn full_name() -> ::prost::alloc::string::String {
198        "xmtp.device_sync.content.DeviceSyncKeyType".into()
199    }
200    fn type_url() -> ::prost::alloc::string::String {
201        "/xmtp.device_sync.content.DeviceSyncKeyType".into()
202    }
203}