diff --git a/xmtp_proto/Cargo.toml b/xmtp_proto/Cargo.toml index 9e5ddf30f..d9e651125 100644 --- a/xmtp_proto/Cargo.toml +++ b/xmtp_proto/Cargo.toml @@ -34,7 +34,7 @@ test-utils = ["xmtp_common/test-utils"] # @@protoc_deletion_point(features) # This section is automatically generated by protoc-gen-prost-crate. # Changes in this area may be lost on regeneration. -proto_full = ["xmtp-identity","xmtp-identity-api-v1","xmtp-identity-associations","xmtp-keystore_api-v1","xmtp-message_api-v1","xmtp-message_contents","xmtp-mls-api-v1","xmtp-mls-database","xmtp-mls-message_contents","xmtp-mls_validation-v1","xmtp-xmtpv4-envelopes","xmtp-xmtpv4-message_api","xmtp-xmtpv4-payer_api"] +proto_full = ["xmtp-identity","xmtp-identity-api-v1","xmtp-identity-associations","xmtp-keystore_api-v1","xmtp-message_api-v1","xmtp-message_contents","xmtp-mls-api-v1","xmtp-mls-database","xmtp-mls-message_contents","xmtp-mls-message_contents-content_types","xmtp-mls_validation-v1","xmtp-xmtpv4-envelopes","xmtp-xmtpv4-message_api","xmtp-xmtpv4-payer_api"] "xmtp-identity" = [] "xmtp-identity-api-v1" = ["xmtp-identity","xmtp-identity-associations"] "xmtp-identity-associations" = ["xmtp-identity","xmtp-message_contents"] @@ -44,6 +44,7 @@ proto_full = ["xmtp-identity","xmtp-identity-api-v1","xmtp-identity-associations "xmtp-mls-api-v1" = ["xmtp-message_contents"] "xmtp-mls-database" = [] "xmtp-mls-message_contents" = [] +"xmtp-mls-message_contents-content_types" = ["xmtp-mls-message_contents"] "xmtp-mls_validation-v1" = ["xmtp-identity-api-v1","xmtp-identity-associations"] "xmtp-xmtpv4-envelopes" = ["xmtp-identity-associations","xmtp-mls-api-v1"] "xmtp-xmtpv4-message_api" = ["xmtp-xmtpv4-envelopes"] diff --git a/xmtp_proto/src/gen/mod.rs b/xmtp_proto/src/gen/mod.rs index a85c48491..75e14ca71 100644 --- a/xmtp_proto/src/gen/mod.rs +++ b/xmtp_proto/src/gen/mod.rs @@ -62,6 +62,12 @@ pub mod xmtp { pub mod message_contents { include!("xmtp.mls.message_contents.rs"); // @@protoc_insertion_point(xmtp.mls.message_contents) + #[cfg(feature = "xmtp-mls-message_contents-content_types")] + // @@protoc_insertion_point(attribute:xmtp.mls.message_contents.content_types) + pub mod content_types { + include!("xmtp.mls.message_contents.content_types.rs"); + // @@protoc_insertion_point(xmtp.mls.message_contents.content_types) + } } } pub mod mls_validation { diff --git a/xmtp_proto/src/gen/xmtp.mls.message_contents.content_types.rs b/xmtp_proto/src/gen/xmtp.mls.message_contents.content_types.rs new file mode 100644 index 000000000..0d53a7deb --- /dev/null +++ b/xmtp_proto/src/gen/xmtp.mls.message_contents.content_types.rs @@ -0,0 +1,232 @@ +// @generated +// This file is @generated by prost-build. +/// Reaction message type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ReactionV2 { + /// The message ID being reacted to + #[prost(string, tag="1")] + pub reference: ::prost::alloc::string::String, + /// The inbox ID of the user who sent the message being reacted to + /// Optional for group messages + #[prost(string, tag="2")] + pub reference_inbox_id: ::prost::alloc::string::String, + /// The action of the reaction (added or removed) + #[prost(enumeration="ReactionAction", tag="3")] + pub action: i32, + /// The content of the reaction + #[prost(string, tag="4")] + pub content: ::prost::alloc::string::String, + /// The schema of the reaction content + #[prost(enumeration="ReactionSchema", tag="5")] + pub schema: i32, +} +/// Action enum to represent reaction states +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ReactionAction { + Unspecified = 0, + Added = 1, + Removed = 2, +} +impl ReactionAction { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ReactionAction::Unspecified => "REACTION_ACTION_UNSPECIFIED", + ReactionAction::Added => "REACTION_ACTION_ADDED", + ReactionAction::Removed => "REACTION_ACTION_REMOVED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "REACTION_ACTION_UNSPECIFIED" => Some(Self::Unspecified), + "REACTION_ACTION_ADDED" => Some(Self::Added), + "REACTION_ACTION_REMOVED" => Some(Self::Removed), + _ => None, + } + } +} +/// Schema enum to represent reaction content types +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ReactionSchema { + Unspecified = 0, + Unicode = 1, + Shortcode = 2, + Custom = 3, +} +impl ReactionSchema { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ReactionSchema::Unspecified => "REACTION_SCHEMA_UNSPECIFIED", + ReactionSchema::Unicode => "REACTION_SCHEMA_UNICODE", + ReactionSchema::Shortcode => "REACTION_SCHEMA_SHORTCODE", + ReactionSchema::Custom => "REACTION_SCHEMA_CUSTOM", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "REACTION_SCHEMA_UNSPECIFIED" => Some(Self::Unspecified), + "REACTION_SCHEMA_UNICODE" => Some(Self::Unicode), + "REACTION_SCHEMA_SHORTCODE" => Some(Self::Shortcode), + "REACTION_SCHEMA_CUSTOM" => Some(Self::Custom), + _ => None, + } + } +} +/// Encoded file descriptor set for the `xmtp.mls.message_contents.content_types` package +pub const FILE_DESCRIPTOR_SET: &[u8] = &[ + 0x0a, 0xc2, 0x11, 0x0a, 0x31, 0x6d, 0x6c, 0x73, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x27, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, + 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, + 0x94, 0x02, 0x0a, 0x0a, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x32, 0x12, 0x1c, + 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2c, 0x0a, 0x12, + 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x12, 0x4f, 0x0a, 0x06, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x37, 0x2e, 0x78, 0x6d, 0x74, + 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x4f, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x37, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, + 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x06, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2a, 0x69, 0x0a, 0x0e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x1b, 0x52, 0x45, 0x41, 0x43, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x45, 0x41, + 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x44, 0x44, + 0x45, 0x44, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x52, 0x45, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x44, 0x10, + 0x02, 0x2a, 0x89, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1f, 0x0a, 0x1b, 0x52, 0x45, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x53, 0x43, 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x52, 0x45, 0x41, 0x43, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x53, 0x43, 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x55, 0x4e, 0x49, 0x43, 0x4f, 0x44, 0x45, + 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x52, 0x45, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, + 0x43, 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x53, 0x48, 0x4f, 0x52, 0x54, 0x43, 0x4f, 0x44, 0x45, 0x10, + 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x52, 0x45, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, + 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x10, 0x03, 0x42, 0xb4, 0x02, + 0x0a, 0x2b, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x42, 0x0d, 0x52, + 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x33, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0xa2, 0x02, + 0x04, 0x58, 0x4d, 0x4d, 0x43, 0xaa, 0x02, 0x25, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x6c, 0x73, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0xca, 0x02, 0x25, + 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x6c, 0x73, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x73, 0xe2, 0x02, 0x31, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x6c, 0x73, + 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x5c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x28, 0x58, 0x6d, 0x74, 0x70, + 0x3a, 0x3a, 0x4d, 0x6c, 0x73, 0x3a, 0x3a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x73, 0x4a, 0x96, 0x0a, 0x0a, 0x06, 0x12, 0x04, 0x0a, 0x00, 0x31, 0x01, 0x0a, + 0x81, 0x02, 0x0a, 0x01, 0x0c, 0x12, 0x03, 0x0a, 0x00, 0x12, 0x1a, 0xf6, 0x01, 0x20, 0x72, 0x65, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x0a, 0x20, 0x54, 0x68, + 0x69, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x73, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x32, 0x20, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, + 0x69, 0x73, 0x20, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, + 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, + 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x3a, 0x0a, + 0x20, 0x0a, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x5f, 0x69, 0x64, 0x3a, 0x20, 0x22, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x22, + 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x3a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2c, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, + 0x6a, 0x6f, 0x72, 0x3a, 0x20, 0x32, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x3a, 0x20, 0x30, 0x2c, 0x0a, 0x20, + 0x7d, 0x0a, 0x0a, 0x0a, 0x08, 0x0a, 0x01, 0x02, 0x12, 0x03, 0x0c, 0x00, 0x30, 0x0a, 0x08, 0x0a, + 0x01, 0x08, 0x12, 0x03, 0x0e, 0x00, 0x55, 0x0a, 0x09, 0x0a, 0x02, 0x08, 0x0b, 0x12, 0x03, 0x0e, + 0x00, 0x55, 0x0a, 0x36, 0x0a, 0x02, 0x05, 0x00, 0x12, 0x04, 0x12, 0x00, 0x16, 0x01, 0x1a, 0x2a, + 0x20, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x74, 0x6f, 0x20, + 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x73, 0x0a, 0x0a, 0x0a, 0x0a, 0x03, 0x05, 0x00, + 0x01, 0x12, 0x03, 0x12, 0x05, 0x13, 0x0a, 0x0b, 0x0a, 0x04, 0x05, 0x00, 0x02, 0x00, 0x12, 0x03, + 0x13, 0x02, 0x22, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x00, 0x02, 0x00, 0x01, 0x12, 0x03, 0x13, 0x02, + 0x1d, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x00, 0x02, 0x00, 0x02, 0x12, 0x03, 0x13, 0x20, 0x21, 0x0a, + 0x0b, 0x0a, 0x04, 0x05, 0x00, 0x02, 0x01, 0x12, 0x03, 0x14, 0x02, 0x1c, 0x0a, 0x0c, 0x0a, 0x05, + 0x05, 0x00, 0x02, 0x01, 0x01, 0x12, 0x03, 0x14, 0x02, 0x17, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x00, + 0x02, 0x01, 0x02, 0x12, 0x03, 0x14, 0x1a, 0x1b, 0x0a, 0x0b, 0x0a, 0x04, 0x05, 0x00, 0x02, 0x02, + 0x12, 0x03, 0x15, 0x02, 0x1e, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x00, 0x02, 0x02, 0x01, 0x12, 0x03, + 0x15, 0x02, 0x19, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x00, 0x02, 0x02, 0x02, 0x12, 0x03, 0x15, 0x1c, + 0x1d, 0x0a, 0x3d, 0x0a, 0x02, 0x05, 0x01, 0x12, 0x04, 0x19, 0x00, 0x1e, 0x01, 0x1a, 0x31, 0x20, + 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x74, 0x6f, 0x20, 0x72, + 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x0a, + 0x0a, 0x0a, 0x0a, 0x03, 0x05, 0x01, 0x01, 0x12, 0x03, 0x19, 0x05, 0x13, 0x0a, 0x0b, 0x0a, 0x04, + 0x05, 0x01, 0x02, 0x00, 0x12, 0x03, 0x1a, 0x02, 0x22, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x01, 0x02, + 0x00, 0x01, 0x12, 0x03, 0x1a, 0x02, 0x1d, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x01, 0x02, 0x00, 0x02, + 0x12, 0x03, 0x1a, 0x20, 0x21, 0x0a, 0x0b, 0x0a, 0x04, 0x05, 0x01, 0x02, 0x01, 0x12, 0x03, 0x1b, + 0x02, 0x1e, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x01, 0x02, 0x01, 0x01, 0x12, 0x03, 0x1b, 0x02, 0x19, + 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x01, 0x02, 0x01, 0x02, 0x12, 0x03, 0x1b, 0x1c, 0x1d, 0x0a, 0x0b, + 0x0a, 0x04, 0x05, 0x01, 0x02, 0x02, 0x12, 0x03, 0x1c, 0x02, 0x20, 0x0a, 0x0c, 0x0a, 0x05, 0x05, + 0x01, 0x02, 0x02, 0x01, 0x12, 0x03, 0x1c, 0x02, 0x1b, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x01, 0x02, + 0x02, 0x02, 0x12, 0x03, 0x1c, 0x1e, 0x1f, 0x0a, 0x0b, 0x0a, 0x04, 0x05, 0x01, 0x02, 0x03, 0x12, + 0x03, 0x1d, 0x02, 0x1d, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x01, 0x02, 0x03, 0x01, 0x12, 0x03, 0x1d, + 0x02, 0x18, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x01, 0x02, 0x03, 0x02, 0x12, 0x03, 0x1d, 0x1b, 0x1c, + 0x0a, 0x23, 0x0a, 0x02, 0x04, 0x00, 0x12, 0x04, 0x21, 0x00, 0x31, 0x01, 0x1a, 0x17, 0x20, 0x52, + 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, + 0x74, 0x79, 0x70, 0x65, 0x0a, 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x00, 0x01, 0x12, 0x03, 0x21, 0x08, + 0x12, 0x0a, 0x2e, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x00, 0x12, 0x03, 0x23, 0x02, 0x17, 0x1a, 0x21, + 0x20, 0x54, 0x68, 0x65, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x49, 0x44, 0x20, + 0x62, 0x65, 0x69, 0x6e, 0x67, 0x20, 0x72, 0x65, 0x61, 0x63, 0x74, 0x65, 0x64, 0x20, 0x74, 0x6f, + 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x00, 0x05, 0x12, 0x03, 0x23, 0x02, 0x08, 0x0a, + 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x00, 0x01, 0x12, 0x03, 0x23, 0x09, 0x12, 0x0a, 0x0c, 0x0a, + 0x05, 0x04, 0x00, 0x02, 0x00, 0x03, 0x12, 0x03, 0x23, 0x15, 0x16, 0x0a, 0x6a, 0x0a, 0x04, 0x04, + 0x00, 0x02, 0x01, 0x12, 0x03, 0x27, 0x02, 0x20, 0x1a, 0x5d, 0x20, 0x54, 0x68, 0x65, 0x20, 0x69, + 0x6e, 0x62, 0x6f, 0x78, 0x20, 0x49, 0x44, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, + 0x73, 0x65, 0x72, 0x20, 0x77, 0x68, 0x6f, 0x20, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x62, 0x65, 0x69, 0x6e, 0x67, 0x20, 0x72, + 0x65, 0x61, 0x63, 0x74, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x0a, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x20, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x01, 0x05, + 0x12, 0x03, 0x27, 0x02, 0x08, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x01, 0x01, 0x12, 0x03, + 0x27, 0x09, 0x1b, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x01, 0x03, 0x12, 0x03, 0x27, 0x1e, + 0x1f, 0x0a, 0x3c, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x02, 0x12, 0x03, 0x2a, 0x02, 0x1c, 0x1a, 0x2f, + 0x20, 0x54, 0x68, 0x65, 0x20, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x61, 0x64, 0x64, + 0x65, 0x64, 0x20, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x29, 0x0a, 0x0a, + 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x02, 0x06, 0x12, 0x03, 0x2a, 0x02, 0x10, 0x0a, 0x0c, 0x0a, + 0x05, 0x04, 0x00, 0x02, 0x02, 0x01, 0x12, 0x03, 0x2a, 0x11, 0x17, 0x0a, 0x0c, 0x0a, 0x05, 0x04, + 0x00, 0x02, 0x02, 0x03, 0x12, 0x03, 0x2a, 0x1a, 0x1b, 0x0a, 0x2b, 0x0a, 0x04, 0x04, 0x00, 0x02, + 0x03, 0x12, 0x03, 0x2d, 0x02, 0x15, 0x1a, 0x1e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x03, 0x05, 0x12, + 0x03, 0x2d, 0x02, 0x08, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x03, 0x01, 0x12, 0x03, 0x2d, + 0x09, 0x10, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x03, 0x03, 0x12, 0x03, 0x2d, 0x13, 0x14, + 0x0a, 0x31, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x04, 0x12, 0x03, 0x30, 0x02, 0x1c, 0x1a, 0x24, 0x20, + 0x54, 0x68, 0x65, 0x20, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x04, 0x06, 0x12, 0x03, 0x30, 0x02, + 0x10, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x04, 0x01, 0x12, 0x03, 0x30, 0x11, 0x17, 0x0a, + 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x04, 0x03, 0x12, 0x03, 0x30, 0x1a, 0x1b, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +]; +include!("xmtp.mls.message_contents.content_types.serde.rs"); +// @@protoc_insertion_point(module) \ No newline at end of file diff --git a/xmtp_proto/src/gen/xmtp.mls.message_contents.content_types.serde.rs b/xmtp_proto/src/gen/xmtp.mls.message_contents.content_types.serde.rs new file mode 100644 index 000000000..2d90d1ae3 --- /dev/null +++ b/xmtp_proto/src/gen/xmtp.mls.message_contents.content_types.serde.rs @@ -0,0 +1,316 @@ +// @generated +impl serde::Serialize for ReactionAction { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "REACTION_ACTION_UNSPECIFIED", + Self::Added => "REACTION_ACTION_ADDED", + Self::Removed => "REACTION_ACTION_REMOVED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for ReactionAction { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "REACTION_ACTION_UNSPECIFIED", + "REACTION_ACTION_ADDED", + "REACTION_ACTION_REMOVED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ReactionAction; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "REACTION_ACTION_UNSPECIFIED" => Ok(ReactionAction::Unspecified), + "REACTION_ACTION_ADDED" => Ok(ReactionAction::Added), + "REACTION_ACTION_REMOVED" => Ok(ReactionAction::Removed), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for ReactionSchema { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "REACTION_SCHEMA_UNSPECIFIED", + Self::Unicode => "REACTION_SCHEMA_UNICODE", + Self::Shortcode => "REACTION_SCHEMA_SHORTCODE", + Self::Custom => "REACTION_SCHEMA_CUSTOM", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for ReactionSchema { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "REACTION_SCHEMA_UNSPECIFIED", + "REACTION_SCHEMA_UNICODE", + "REACTION_SCHEMA_SHORTCODE", + "REACTION_SCHEMA_CUSTOM", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ReactionSchema; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "REACTION_SCHEMA_UNSPECIFIED" => Ok(ReactionSchema::Unspecified), + "REACTION_SCHEMA_UNICODE" => Ok(ReactionSchema::Unicode), + "REACTION_SCHEMA_SHORTCODE" => Ok(ReactionSchema::Shortcode), + "REACTION_SCHEMA_CUSTOM" => Ok(ReactionSchema::Custom), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for ReactionV2 { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.reference.is_empty() { + len += 1; + } + if !self.reference_inbox_id.is_empty() { + len += 1; + } + if self.action != 0 { + len += 1; + } + if !self.content.is_empty() { + len += 1; + } + if self.schema != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xmtp.mls.message_contents.content_types.ReactionV2", len)?; + if !self.reference.is_empty() { + struct_ser.serialize_field("reference", &self.reference)?; + } + if !self.reference_inbox_id.is_empty() { + struct_ser.serialize_field("referenceInboxId", &self.reference_inbox_id)?; + } + if self.action != 0 { + let v = ReactionAction::try_from(self.action) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.action)))?; + struct_ser.serialize_field("action", &v)?; + } + if !self.content.is_empty() { + struct_ser.serialize_field("content", &self.content)?; + } + if self.schema != 0 { + let v = ReactionSchema::try_from(self.schema) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.schema)))?; + struct_ser.serialize_field("schema", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ReactionV2 { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "reference", + "reference_inbox_id", + "referenceInboxId", + "action", + "content", + "schema", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Reference, + ReferenceInboxId, + Action, + Content, + Schema, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "reference" => Ok(GeneratedField::Reference), + "referenceInboxId" | "reference_inbox_id" => Ok(GeneratedField::ReferenceInboxId), + "action" => Ok(GeneratedField::Action), + "content" => Ok(GeneratedField::Content), + "schema" => Ok(GeneratedField::Schema), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ReactionV2; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xmtp.mls.message_contents.content_types.ReactionV2") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut reference__ = None; + let mut reference_inbox_id__ = None; + let mut action__ = None; + let mut content__ = None; + let mut schema__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Reference => { + if reference__.is_some() { + return Err(serde::de::Error::duplicate_field("reference")); + } + reference__ = Some(map_.next_value()?); + } + GeneratedField::ReferenceInboxId => { + if reference_inbox_id__.is_some() { + return Err(serde::de::Error::duplicate_field("referenceInboxId")); + } + reference_inbox_id__ = Some(map_.next_value()?); + } + GeneratedField::Action => { + if action__.is_some() { + return Err(serde::de::Error::duplicate_field("action")); + } + action__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Content => { + if content__.is_some() { + return Err(serde::de::Error::duplicate_field("content")); + } + content__ = Some(map_.next_value()?); + } + GeneratedField::Schema => { + if schema__.is_some() { + return Err(serde::de::Error::duplicate_field("schema")); + } + schema__ = Some(map_.next_value::()? as i32); + } + } + } + Ok(ReactionV2 { + reference: reference__.unwrap_or_default(), + reference_inbox_id: reference_inbox_id__.unwrap_or_default(), + action: action__.unwrap_or_default(), + content: content__.unwrap_or_default(), + schema: schema__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("xmtp.mls.message_contents.content_types.ReactionV2", FIELDS, GeneratedVisitor) + } +}