xmtp_proto/gen/
xmtp.device_sync.consent_backup.rs

1// This file is @generated by prost-build.
2/// Proto representation of a consent record save
3#[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/// Consent record type
25#[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    /// String value of the enum field names used in the ProtoBuf definition.
35    ///
36    /// The values are not transformed in any way and thus are considered stable
37    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
38    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    /// Creates an enum from field names used in the ProtoBuf definition.
47    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/// Consent record state
58#[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    /// String value of the enum field names used in the ProtoBuf definition.
68    ///
69    /// The values are not transformed in any way and thus are considered stable
70    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
71    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    /// Creates an enum from field names used in the ProtoBuf definition.
80    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}