xmtp_proto/gen/
xmtp.device_sync.message_backup.rs

1// This file is @generated by prost-build.
2/// Proto representation of a stored group message
3#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct GroupMessageSave {
5    #[prost(bytes = "vec", tag = "1")]
6    pub id: ::prost::alloc::vec::Vec<u8>,
7    #[prost(bytes = "vec", tag = "2")]
8    pub group_id: ::prost::alloc::vec::Vec<u8>,
9    #[prost(bytes = "vec", tag = "3")]
10    pub decrypted_message_bytes: ::prost::alloc::vec::Vec<u8>,
11    #[prost(int64, tag = "4")]
12    pub sent_at_ns: i64,
13    #[prost(enumeration = "GroupMessageKindSave", tag = "5")]
14    pub kind: i32,
15    #[prost(bytes = "vec", tag = "6")]
16    pub sender_installation_id: ::prost::alloc::vec::Vec<u8>,
17    #[prost(string, tag = "7")]
18    pub sender_inbox_id: ::prost::alloc::string::String,
19    #[prost(enumeration = "DeliveryStatusSave", tag = "8")]
20    pub delivery_status: i32,
21    #[deprecated]
22    #[prost(enumeration = "ContentTypeSave", tag = "9")]
23    pub content_type_save: i32,
24    #[prost(int32, tag = "10")]
25    pub version_major: i32,
26    #[prost(int32, tag = "11")]
27    pub version_minor: i32,
28    #[prost(string, tag = "12")]
29    pub authority_id: ::prost::alloc::string::String,
30    #[prost(bytes = "vec", optional, tag = "13")]
31    pub reference_id: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
32    #[prost(int64, optional, tag = "14")]
33    pub sequence_id: ::core::option::Option<i64>,
34    #[prost(int64, optional, tag = "15")]
35    pub originator_id: ::core::option::Option<i64>,
36    #[prost(string, tag = "16")]
37    pub content_type: ::prost::alloc::string::String,
38}
39impl ::prost::Name for GroupMessageSave {
40    const NAME: &'static str = "GroupMessageSave";
41    const PACKAGE: &'static str = "xmtp.device_sync.message_backup";
42    fn full_name() -> ::prost::alloc::string::String {
43        "xmtp.device_sync.message_backup.GroupMessageSave".into()
44    }
45    fn type_url() -> ::prost::alloc::string::String {
46        "/xmtp.device_sync.message_backup.GroupMessageSave".into()
47    }
48}
49/// Group message kind
50#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
51#[repr(i32)]
52pub enum GroupMessageKindSave {
53    Unspecified = 0,
54    Application = 1,
55    MembershipChange = 2,
56}
57impl GroupMessageKindSave {
58    /// String value of the enum field names used in the ProtoBuf definition.
59    ///
60    /// The values are not transformed in any way and thus are considered stable
61    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
62    pub fn as_str_name(&self) -> &'static str {
63        match self {
64            Self::Unspecified => "GROUP_MESSAGE_KIND_SAVE_UNSPECIFIED",
65            Self::Application => "GROUP_MESSAGE_KIND_SAVE_APPLICATION",
66            Self::MembershipChange => "GROUP_MESSAGE_KIND_SAVE_MEMBERSHIP_CHANGE",
67        }
68    }
69    /// Creates an enum from field names used in the ProtoBuf definition.
70    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
71        match value {
72            "GROUP_MESSAGE_KIND_SAVE_UNSPECIFIED" => Some(Self::Unspecified),
73            "GROUP_MESSAGE_KIND_SAVE_APPLICATION" => Some(Self::Application),
74            "GROUP_MESSAGE_KIND_SAVE_MEMBERSHIP_CHANGE" => Some(Self::MembershipChange),
75            _ => None,
76        }
77    }
78}
79/// Group message delivery status
80#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
81#[repr(i32)]
82pub enum DeliveryStatusSave {
83    Unspecified = 0,
84    Unpublished = 1,
85    Published = 2,
86    Failed = 3,
87}
88impl DeliveryStatusSave {
89    /// String value of the enum field names used in the ProtoBuf definition.
90    ///
91    /// The values are not transformed in any way and thus are considered stable
92    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
93    pub fn as_str_name(&self) -> &'static str {
94        match self {
95            Self::Unspecified => "DELIVERY_STATUS_SAVE_UNSPECIFIED",
96            Self::Unpublished => "DELIVERY_STATUS_SAVE_UNPUBLISHED",
97            Self::Published => "DELIVERY_STATUS_SAVE_PUBLISHED",
98            Self::Failed => "DELIVERY_STATUS_SAVE_FAILED",
99        }
100    }
101    /// Creates an enum from field names used in the ProtoBuf definition.
102    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
103        match value {
104            "DELIVERY_STATUS_SAVE_UNSPECIFIED" => Some(Self::Unspecified),
105            "DELIVERY_STATUS_SAVE_UNPUBLISHED" => Some(Self::Unpublished),
106            "DELIVERY_STATUS_SAVE_PUBLISHED" => Some(Self::Published),
107            "DELIVERY_STATUS_SAVE_FAILED" => Some(Self::Failed),
108            _ => None,
109        }
110    }
111}
112/// Group message content type
113#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
114#[repr(i32)]
115pub enum ContentTypeSave {
116    Unspecified = 0,
117    Unknown = 1,
118    Text = 2,
119    GroupMembershipChange = 3,
120    GroupUpdated = 4,
121    Reaction = 5,
122    ReadReceipt = 6,
123    Reply = 7,
124    Attachment = 8,
125    RemoteAttachment = 9,
126    TransactionReference = 10,
127}
128impl ContentTypeSave {
129    /// String value of the enum field names used in the ProtoBuf definition.
130    ///
131    /// The values are not transformed in any way and thus are considered stable
132    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
133    pub fn as_str_name(&self) -> &'static str {
134        match self {
135            Self::Unspecified => "CONTENT_TYPE_SAVE_UNSPECIFIED",
136            Self::Unknown => "CONTENT_TYPE_SAVE_UNKNOWN",
137            Self::Text => "CONTENT_TYPE_SAVE_TEXT",
138            Self::GroupMembershipChange => "CONTENT_TYPE_SAVE_GROUP_MEMBERSHIP_CHANGE",
139            Self::GroupUpdated => "CONTENT_TYPE_SAVE_GROUP_UPDATED",
140            Self::Reaction => "CONTENT_TYPE_SAVE_REACTION",
141            Self::ReadReceipt => "CONTENT_TYPE_SAVE_READ_RECEIPT",
142            Self::Reply => "CONTENT_TYPE_SAVE_REPLY",
143            Self::Attachment => "CONTENT_TYPE_SAVE_ATTACHMENT",
144            Self::RemoteAttachment => "CONTENT_TYPE_SAVE_REMOTE_ATTACHMENT",
145            Self::TransactionReference => "CONTENT_TYPE_SAVE_TRANSACTION_REFERENCE",
146        }
147    }
148    /// Creates an enum from field names used in the ProtoBuf definition.
149    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
150        match value {
151            "CONTENT_TYPE_SAVE_UNSPECIFIED" => Some(Self::Unspecified),
152            "CONTENT_TYPE_SAVE_UNKNOWN" => Some(Self::Unknown),
153            "CONTENT_TYPE_SAVE_TEXT" => Some(Self::Text),
154            "CONTENT_TYPE_SAVE_GROUP_MEMBERSHIP_CHANGE" => {
155                Some(Self::GroupMembershipChange)
156            }
157            "CONTENT_TYPE_SAVE_GROUP_UPDATED" => Some(Self::GroupUpdated),
158            "CONTENT_TYPE_SAVE_REACTION" => Some(Self::Reaction),
159            "CONTENT_TYPE_SAVE_READ_RECEIPT" => Some(Self::ReadReceipt),
160            "CONTENT_TYPE_SAVE_REPLY" => Some(Self::Reply),
161            "CONTENT_TYPE_SAVE_ATTACHMENT" => Some(Self::Attachment),
162            "CONTENT_TYPE_SAVE_REMOTE_ATTACHMENT" => Some(Self::RemoteAttachment),
163            "CONTENT_TYPE_SAVE_TRANSACTION_REFERENCE" => Some(Self::TransactionReference),
164            _ => None,
165        }
166    }
167}