xmtp_proto/gen/
xmtp.device_sync.consent_backup.rs1#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct ConsentSave {
5 #[prost(enumeration = "ConsentTypeSave", tag = "1")]
6 pub entity_type: i32,
7 #[prost(enumeration = "ConsentStateSave", tag = "2")]
8 pub state: i32,
9 #[prost(string, tag = "3")]
10 pub entity: ::prost::alloc::string::String,
11 #[prost(int64, tag = "4")]
12 pub consented_at_ns: i64,
13}
14impl ::prost::Name for ConsentSave {
15 const NAME: &'static str = "ConsentSave";
16 const PACKAGE: &'static str = "xmtp.device_sync.consent_backup";
17 fn full_name() -> ::prost::alloc::string::String {
18 "xmtp.device_sync.consent_backup.ConsentSave".into()
19 }
20 fn type_url() -> ::prost::alloc::string::String {
21 "/xmtp.device_sync.consent_backup.ConsentSave".into()
22 }
23}
24#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
26#[repr(i32)]
27pub enum ConsentTypeSave {
28 Unspecified = 0,
29 ConversationId = 1,
30 InboxId = 2,
31 Address = 3,
32}
33impl ConsentTypeSave {
34 pub fn as_str_name(&self) -> &'static str {
39 match self {
40 Self::Unspecified => "CONSENT_TYPE_SAVE_UNSPECIFIED",
41 Self::ConversationId => "CONSENT_TYPE_SAVE_CONVERSATION_ID",
42 Self::InboxId => "CONSENT_TYPE_SAVE_INBOX_ID",
43 Self::Address => "CONSENT_TYPE_SAVE_ADDRESS",
44 }
45 }
46 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
48 match value {
49 "CONSENT_TYPE_SAVE_UNSPECIFIED" => Some(Self::Unspecified),
50 "CONSENT_TYPE_SAVE_CONVERSATION_ID" => Some(Self::ConversationId),
51 "CONSENT_TYPE_SAVE_INBOX_ID" => Some(Self::InboxId),
52 "CONSENT_TYPE_SAVE_ADDRESS" => Some(Self::Address),
53 _ => None,
54 }
55 }
56}
57#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
59#[repr(i32)]
60pub enum ConsentStateSave {
61 Unspecified = 0,
62 Unknown = 1,
63 Allowed = 2,
64 Denied = 3,
65}
66impl ConsentStateSave {
67 pub fn as_str_name(&self) -> &'static str {
72 match self {
73 Self::Unspecified => "CONSENT_STATE_SAVE_UNSPECIFIED",
74 Self::Unknown => "CONSENT_STATE_SAVE_UNKNOWN",
75 Self::Allowed => "CONSENT_STATE_SAVE_ALLOWED",
76 Self::Denied => "CONSENT_STATE_SAVE_DENIED",
77 }
78 }
79 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
81 match value {
82 "CONSENT_STATE_SAVE_UNSPECIFIED" => Some(Self::Unspecified),
83 "CONSENT_STATE_SAVE_UNKNOWN" => Some(Self::Unknown),
84 "CONSENT_STATE_SAVE_ALLOWED" => Some(Self::Allowed),
85 "CONSENT_STATE_SAVE_DENIED" => Some(Self::Denied),
86 _ => None,
87 }
88 }
89}