Skip to main content

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    #[deprecated]
32    Address = 3,
33}
34impl ConsentTypeSave {
35    /// String value of the enum field names used in the ProtoBuf definition.
36    ///
37    /// The values are not transformed in any way and thus are considered stable
38    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
39    pub fn as_str_name(&self) -> &'static str {
40        match self {
41            Self::Unspecified => "CONSENT_TYPE_SAVE_UNSPECIFIED",
42            Self::ConversationId => "CONSENT_TYPE_SAVE_CONVERSATION_ID",
43            Self::InboxId => "CONSENT_TYPE_SAVE_INBOX_ID",
44            #[allow(deprecated)]
45            Self::Address => "CONSENT_TYPE_SAVE_ADDRESS",
46        }
47    }
48    /// Creates an enum from field names used in the ProtoBuf definition.
49    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
50        match value {
51            "CONSENT_TYPE_SAVE_UNSPECIFIED" => Some(Self::Unspecified),
52            "CONSENT_TYPE_SAVE_CONVERSATION_ID" => Some(Self::ConversationId),
53            "CONSENT_TYPE_SAVE_INBOX_ID" => Some(Self::InboxId),
54            "CONSENT_TYPE_SAVE_ADDRESS" => Some(#[allow(deprecated)] Self::Address),
55            _ => None,
56        }
57    }
58}
59/// Consent record state
60#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
61#[repr(i32)]
62pub enum ConsentStateSave {
63    Unspecified = 0,
64    Unknown = 1,
65    Allowed = 2,
66    Denied = 3,
67}
68impl ConsentStateSave {
69    /// String value of the enum field names used in the ProtoBuf definition.
70    ///
71    /// The values are not transformed in any way and thus are considered stable
72    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
73    pub fn as_str_name(&self) -> &'static str {
74        match self {
75            Self::Unspecified => "CONSENT_STATE_SAVE_UNSPECIFIED",
76            Self::Unknown => "CONSENT_STATE_SAVE_UNKNOWN",
77            Self::Allowed => "CONSENT_STATE_SAVE_ALLOWED",
78            Self::Denied => "CONSENT_STATE_SAVE_DENIED",
79        }
80    }
81    /// Creates an enum from field names used in the ProtoBuf definition.
82    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
83        match value {
84            "CONSENT_STATE_SAVE_UNSPECIFIED" => Some(Self::Unspecified),
85            "CONSENT_STATE_SAVE_UNKNOWN" => Some(Self::Unknown),
86            "CONSENT_STATE_SAVE_ALLOWED" => Some(Self::Allowed),
87            "CONSENT_STATE_SAVE_DENIED" => Some(Self::Denied),
88            _ => None,
89        }
90    }
91}