xmtp_proto/gen/
xmtp.device_sync.group_backup.rs

1// This file is @generated by prost-build.
2/// Proto representation of a stored group
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct GroupSave {
5    #[prost(bytes = "vec", tag = "1")]
6    pub id: ::prost::alloc::vec::Vec<u8>,
7    #[prost(int64, tag = "2")]
8    pub created_at_ns: i64,
9    #[prost(enumeration = "GroupMembershipStateSave", tag = "3")]
10    pub membership_state: i32,
11    #[prost(int64, tag = "4")]
12    pub installations_last_checked: i64,
13    #[prost(string, tag = "5")]
14    pub added_by_inbox_id: ::prost::alloc::string::String,
15    #[prost(int64, optional, tag = "6")]
16    pub welcome_id: ::core::option::Option<i64>,
17    #[prost(int64, tag = "7")]
18    pub rotated_at_ns: i64,
19    #[prost(enumeration = "ConversationTypeSave", tag = "8")]
20    pub conversation_type: i32,
21    #[prost(string, optional, tag = "9")]
22    pub dm_id: ::core::option::Option<::prost::alloc::string::String>,
23    #[prost(int64, optional, tag = "10")]
24    pub last_message_ns: ::core::option::Option<i64>,
25    #[prost(int64, optional, tag = "11")]
26    pub message_disappear_from_ns: ::core::option::Option<i64>,
27    #[prost(int64, optional, tag = "12")]
28    pub message_disappear_in_ns: ::core::option::Option<i64>,
29    /// metadata fields
30    #[prost(message, optional, tag = "13")]
31    pub metadata: ::core::option::Option<ImmutableMetadataSave>,
32    #[prost(message, optional, tag = "14")]
33    pub mutable_metadata: ::core::option::Option<MutableMetadataSave>,
34    #[prost(string, optional, tag = "15")]
35    pub paused_for_version: ::core::option::Option<::prost::alloc::string::String>,
36}
37impl ::prost::Name for GroupSave {
38    const NAME: &'static str = "GroupSave";
39    const PACKAGE: &'static str = "xmtp.device_sync.group_backup";
40    fn full_name() -> ::prost::alloc::string::String {
41        "xmtp.device_sync.group_backup.GroupSave".into()
42    }
43    fn type_url() -> ::prost::alloc::string::String {
44        "/xmtp.device_sync.group_backup.GroupSave".into()
45    }
46}
47/// A Groups's mutable metadata
48#[derive(Clone, PartialEq, ::prost::Message)]
49pub struct MutableMetadataSave {
50    #[prost(map = "string, string", tag = "1")]
51    pub attributes: ::std::collections::HashMap<
52        ::prost::alloc::string::String,
53        ::prost::alloc::string::String,
54    >,
55    #[prost(string, repeated, tag = "2")]
56    pub admin_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
57    #[prost(string, repeated, tag = "3")]
58    pub super_admin_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
59}
60impl ::prost::Name for MutableMetadataSave {
61    const NAME: &'static str = "MutableMetadataSave";
62    const PACKAGE: &'static str = "xmtp.device_sync.group_backup";
63    fn full_name() -> ::prost::alloc::string::String {
64        "xmtp.device_sync.group_backup.MutableMetadataSave".into()
65    }
66    fn type_url() -> ::prost::alloc::string::String {
67        "/xmtp.device_sync.group_backup.MutableMetadataSave".into()
68    }
69}
70/// A Group's immutable metadata
71#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
72pub struct ImmutableMetadataSave {
73    #[prost(string, tag = "1")]
74    pub creator_inbox_id: ::prost::alloc::string::String,
75}
76impl ::prost::Name for ImmutableMetadataSave {
77    const NAME: &'static str = "ImmutableMetadataSave";
78    const PACKAGE: &'static str = "xmtp.device_sync.group_backup";
79    fn full_name() -> ::prost::alloc::string::String {
80        "xmtp.device_sync.group_backup.ImmutableMetadataSave".into()
81    }
82    fn type_url() -> ::prost::alloc::string::String {
83        "/xmtp.device_sync.group_backup.ImmutableMetadataSave".into()
84    }
85}
86/// Group membership state
87#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
88#[repr(i32)]
89pub enum GroupMembershipStateSave {
90    Unspecified = 0,
91    Allowed = 1,
92    Rejected = 2,
93    Pending = 3,
94    /// A group is marked as this state when it is restored
95    /// from a backup. This is a non-functional archive state
96    /// that can be reactivated when the user is re-added to
97    /// the group.
98    Restored = 4,
99    PendingRemove = 5,
100}
101impl GroupMembershipStateSave {
102    /// String value of the enum field names used in the ProtoBuf definition.
103    ///
104    /// The values are not transformed in any way and thus are considered stable
105    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
106    pub fn as_str_name(&self) -> &'static str {
107        match self {
108            Self::Unspecified => "GROUP_MEMBERSHIP_STATE_SAVE_UNSPECIFIED",
109            Self::Allowed => "GROUP_MEMBERSHIP_STATE_SAVE_ALLOWED",
110            Self::Rejected => "GROUP_MEMBERSHIP_STATE_SAVE_REJECTED",
111            Self::Pending => "GROUP_MEMBERSHIP_STATE_SAVE_PENDING",
112            Self::Restored => "GROUP_MEMBERSHIP_STATE_SAVE_RESTORED",
113            Self::PendingRemove => "GROUP_MEMBERSHIP_STATE_SAVE_PENDING_REMOVE",
114        }
115    }
116    /// Creates an enum from field names used in the ProtoBuf definition.
117    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
118        match value {
119            "GROUP_MEMBERSHIP_STATE_SAVE_UNSPECIFIED" => Some(Self::Unspecified),
120            "GROUP_MEMBERSHIP_STATE_SAVE_ALLOWED" => Some(Self::Allowed),
121            "GROUP_MEMBERSHIP_STATE_SAVE_REJECTED" => Some(Self::Rejected),
122            "GROUP_MEMBERSHIP_STATE_SAVE_PENDING" => Some(Self::Pending),
123            "GROUP_MEMBERSHIP_STATE_SAVE_RESTORED" => Some(Self::Restored),
124            "GROUP_MEMBERSHIP_STATE_SAVE_PENDING_REMOVE" => Some(Self::PendingRemove),
125            _ => None,
126        }
127    }
128}
129/// Conversation type
130#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
131#[repr(i32)]
132pub enum ConversationTypeSave {
133    Unspecified = 0,
134    Group = 1,
135    Dm = 2,
136    Sync = 3,
137}
138impl ConversationTypeSave {
139    /// String value of the enum field names used in the ProtoBuf definition.
140    ///
141    /// The values are not transformed in any way and thus are considered stable
142    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
143    pub fn as_str_name(&self) -> &'static str {
144        match self {
145            Self::Unspecified => "CONVERSATION_TYPE_SAVE_UNSPECIFIED",
146            Self::Group => "CONVERSATION_TYPE_SAVE_GROUP",
147            Self::Dm => "CONVERSATION_TYPE_SAVE_DM",
148            Self::Sync => "CONVERSATION_TYPE_SAVE_SYNC",
149        }
150    }
151    /// Creates an enum from field names used in the ProtoBuf definition.
152    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
153        match value {
154            "CONVERSATION_TYPE_SAVE_UNSPECIFIED" => Some(Self::Unspecified),
155            "CONVERSATION_TYPE_SAVE_GROUP" => Some(Self::Group),
156            "CONVERSATION_TYPE_SAVE_DM" => Some(Self::Dm),
157            "CONVERSATION_TYPE_SAVE_SYNC" => Some(Self::Sync),
158            _ => None,
159        }
160    }
161}