hank-types 0.1.47

Generated type definitions for Hank
Documentation
// @generated
// This file is @generated by prost-build.
/// Each kind of chat channel
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ChannelKind {
    /// A chat root, i.e. a regular public channel
    ChatRoom = 0,
    /// A direct message
    DirectMessage = 1,
}
impl ChannelKind {
    /// 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 {
            ChannelKind::ChatRoom => "CHAT_ROOM",
            ChannelKind::DirectMessage => "DIRECT_MESSAGE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "CHAT_ROOM" => Some(Self::ChatRoom),
            "DIRECT_MESSAGE" => Some(Self::DirectMessage),
            _ => None,
        }
    }
}
/// A channel where chats happen
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Channel {
    /// The kind of channel
    #[prost(enumeration="ChannelKind", tag="1")]
    pub kind: i32,
    /// The channels id
    #[prost(string, tag="2")]
    pub id: ::prost::alloc::string::String,
    /// The channels name
    #[prost(string, tag="3")]
    pub name: ::prost::alloc::string::String,
}
// @@protoc_insertion_point(module)