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    /// Unique identifier for each request
127    #[prost(string, tag = "1")]
128    pub request_id: ::prost::alloc::string::String,
129    #[deprecated]
130    #[prost(string, tag = "2")]
131    pub pin_code: ::prost::alloc::string::String,
132    #[deprecated]
133    #[prost(enumeration = "super::BackupElementSelection", tag = "3")]
134    pub kind: i32,
135    #[prost(message, optional, tag = "4")]
136    pub options: ::core::option::Option<super::BackupOptions>,
137}
138impl ::prost::Name for DeviceSyncRequest {
139    const NAME: &'static str = "DeviceSyncRequest";
140    const PACKAGE: &'static str = "xmtp.device_sync.content";
141    fn full_name() -> ::prost::alloc::string::String {
142        "xmtp.device_sync.content.DeviceSyncRequest".into()
143    }
144    fn type_url() -> ::prost::alloc::string::String {
145        "/xmtp.device_sync.content.DeviceSyncRequest".into()
146    }
147}
148/// Pre-existing installation id capable of supplying a sync payload sends this reply
149#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
150pub struct DeviceSyncReply {
151    /// Must match an existing request_id from a message history request
152    #[prost(string, tag = "1")]
153    pub request_id: ::prost::alloc::string::String,
154    /// Where the messages can be retrieved from
155    #[prost(string, tag = "2")]
156    pub url: ::prost::alloc::string::String,
157    /// Encryption key
158    #[prost(message, optional, tag = "3")]
159    pub encryption_key: ::core::option::Option<DeviceSyncKeyType>,
160    /// ns unix timestamp of when the reply was sent
161    #[deprecated]
162    #[prost(uint64, tag = "4")]
163    pub timestamp_ns: u64,
164    /// request kind
165    #[deprecated]
166    #[prost(enumeration = "super::BackupElementSelection", tag = "5")]
167    pub kind: i32,
168    /// Metadata about the backup
169    #[prost(message, optional, tag = "6")]
170    pub metadata: ::core::option::Option<super::BackupMetadataSave>,
171}
172impl ::prost::Name for DeviceSyncReply {
173    const NAME: &'static str = "DeviceSyncReply";
174    const PACKAGE: &'static str = "xmtp.device_sync.content";
175    fn full_name() -> ::prost::alloc::string::String {
176        "xmtp.device_sync.content.DeviceSyncReply".into()
177    }
178    fn type_url() -> ::prost::alloc::string::String {
179        "/xmtp.device_sync.content.DeviceSyncReply".into()
180    }
181}
182/// Key used to encrypt the message-bundle
183#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
184pub struct DeviceSyncKeyType {
185    #[prost(oneof = "device_sync_key_type::Key", tags = "1")]
186    pub key: ::core::option::Option<device_sync_key_type::Key>,
187}
188/// Nested message and enum types in `DeviceSyncKeyType`.
189pub mod device_sync_key_type {
190    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
191    pub enum Key {
192        #[prost(bytes, tag = "1")]
193        Aes256Gcm(::prost::alloc::vec::Vec<u8>),
194    }
195}
196impl ::prost::Name for DeviceSyncKeyType {
197    const NAME: &'static str = "DeviceSyncKeyType";
198    const PACKAGE: &'static str = "xmtp.device_sync.content";
199    fn full_name() -> ::prost::alloc::string::String {
200        "xmtp.device_sync.content.DeviceSyncKeyType".into()
201    }
202    fn type_url() -> ::prost::alloc::string::String {
203        "/xmtp.device_sync.content.DeviceSyncKeyType".into()
204    }
205}