make87_ntfy 0.4.1

Message Types for Rust SDK for make87 platform.
Documentation
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessagePayload {
    #[prost(message, optional, tag = "1")]
    pub header: ::core::option::Option<super::super::make87_messages::core::Header>,
    /// Required: Target topic name
    #[prost(string, tag = "2")]
    pub topic: ::prost::alloc::string::String,
    /// Message body; set to triggered if empty or not passed
    #[prost(string, optional, tag = "3")]
    pub message: ::core::option::Option<::prost::alloc::string::String>,
    /// Message title
    #[prost(string, optional, tag = "4")]
    pub title: ::core::option::Option<::prost::alloc::string::String>,
    /// List of tags that may or may not map to emojis
    #[prost(string, repeated, tag = "5")]
    pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Message priority
    #[prost(enumeration = "message_payload::Priority", optional, tag = "6")]
    pub priority: ::core::option::Option<i32>,
    /// Custom user action buttons for notifications
    #[prost(message, repeated, tag = "7")]
    pub actions: ::prost::alloc::vec::Vec<message_payload::Action>,
    /// Website opened when notification is clicked
    #[prost(string, optional, tag = "8")]
    pub click: ::core::option::Option<::prost::alloc::string::String>,
    /// URL of an attachment
    #[prost(string, optional, tag = "9")]
    pub attach: ::core::option::Option<::prost::alloc::string::String>,
    /// Set to true if the message is Markdown-formatted
    #[prost(bool, optional, tag = "10")]
    pub markdown: ::core::option::Option<bool>,
    /// URL to use as notification icon
    #[prost(string, optional, tag = "11")]
    pub icon: ::core::option::Option<::prost::alloc::string::String>,
    /// File name of the attachment
    #[prost(string, optional, tag = "12")]
    pub filename: ::core::option::Option<::prost::alloc::string::String>,
    /// Timestamp or duration for delayed delivery
    #[prost(string, optional, tag = "13")]
    pub delay: ::core::option::Option<::prost::alloc::string::String>,
    /// E-mail address for e-mail notifications
    #[prost(string, optional, tag = "14")]
    pub email: ::core::option::Option<::prost::alloc::string::String>,
    /// Phone number to use for voice call (or "yes")
    #[prost(string, optional, tag = "15")]
    pub call: ::core::option::Option<::prost::alloc::string::String>,
}
/// Nested message and enum types in `MessagePayload`.
pub mod message_payload {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Action {
        /// Label for the action button
        #[prost(string, tag = "1")]
        pub label: ::prost::alloc::string::String,
        /// Clear notification after HTTP request succeeds. If the request fails, the notification is not cleared.
        #[prost(bool, tag = "2")]
        pub clear: bool,
        #[prost(oneof = "action::ActionType", tags = "3, 4, 5")]
        pub action_type: ::core::option::Option<action::ActionType>,
    }
    /// Nested message and enum types in `Action`.
    pub mod action {
        #[derive(Clone, PartialEq, ::prost::Oneof)]
        pub enum ActionType {
            #[prost(message, tag = "3")]
            View(super::ViewAction),
            #[prost(message, tag = "4")]
            Broadcast(super::BroadcastAction),
            #[prost(message, tag = "5")]
            Http(super::HttpAction),
        }
    }
    impl ::prost::Name for Action {
        const NAME: &'static str = "Action";
        const PACKAGE: &'static str = "make87_ntfy.publish";
        fn full_name() -> ::prost::alloc::string::String {
            "make87_ntfy.publish.MessagePayload.Action".into()
        }
        fn type_url() -> ::prost::alloc::string::String {
            "/make87_ntfy.publish.MessagePayload.Action".into()
        }
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ViewAction {
        /// URL to open
        #[prost(string, tag = "1")]
        pub url: ::prost::alloc::string::String,
    }
    impl ::prost::Name for ViewAction {
        const NAME: &'static str = "ViewAction";
        const PACKAGE: &'static str = "make87_ntfy.publish";
        fn full_name() -> ::prost::alloc::string::String {
            "make87_ntfy.publish.MessagePayload.ViewAction".into()
        }
        fn type_url() -> ::prost::alloc::string::String {
            "/make87_ntfy.publish.MessagePayload.ViewAction".into()
        }
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct BroadcastAction {
        /// Key-value pairs for broadcast extras
        #[prost(map = "string, string", tag = "1")]
        pub extras: ::std::collections::HashMap<
            ::prost::alloc::string::String,
            ::prost::alloc::string::String,
        >,
    }
    impl ::prost::Name for BroadcastAction {
        const NAME: &'static str = "BroadcastAction";
        const PACKAGE: &'static str = "make87_ntfy.publish";
        fn full_name() -> ::prost::alloc::string::String {
            "make87_ntfy.publish.MessagePayload.BroadcastAction".into()
        }
        fn type_url() -> ::prost::alloc::string::String {
            "/make87_ntfy.publish.MessagePayload.BroadcastAction".into()
        }
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct HttpAction {
        /// URL to send request to
        #[prost(string, tag = "1")]
        pub url: ::prost::alloc::string::String,
        /// HTTP method (e.g., GET, POST, PUT, DELETE)
        #[prost(string, tag = "2")]
        pub method: ::prost::alloc::string::String,
        /// HTTP headers
        #[prost(map = "string, string", tag = "3")]
        pub headers: ::std::collections::HashMap<
            ::prost::alloc::string::String,
            ::prost::alloc::string::String,
        >,
        /// HTTP body
        #[prost(string, tag = "4")]
        pub body: ::prost::alloc::string::String,
    }
    impl ::prost::Name for HttpAction {
        const NAME: &'static str = "HttpAction";
        const PACKAGE: &'static str = "make87_ntfy.publish";
        fn full_name() -> ::prost::alloc::string::String {
            "make87_ntfy.publish.MessagePayload.HttpAction".into()
        }
        fn type_url() -> ::prost::alloc::string::String {
            "/make87_ntfy.publish.MessagePayload.HttpAction".into()
        }
    }
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Priority {
        /// Unknown priority
        Unknown = 0,
        /// No vibration or sound, notification under the fold
        Min = 1,
        /// No vibration or sound, visible only in the drawer
        Low = 2,
        /// Short default vibration and sound
        Default = 3,
        /// Long vibration burst, default sound, pop-over
        High = 4,
        /// Really long vibration bursts, default sound, pop-over
        Max = 5,
    }
    impl Priority {
        /// 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 {
                Self::Unknown => "UNKNOWN",
                Self::Min => "PRIORITY_MIN",
                Self::Low => "PRIORITY_LOW",
                Self::Default => "PRIORITY_DEFAULT",
                Self::High => "PRIORITY_HIGH",
                Self::Max => "PRIORITY_MAX",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "UNKNOWN" => Some(Self::Unknown),
                "PRIORITY_MIN" => Some(Self::Min),
                "PRIORITY_LOW" => Some(Self::Low),
                "PRIORITY_DEFAULT" => Some(Self::Default),
                "PRIORITY_HIGH" => Some(Self::High),
                "PRIORITY_MAX" => Some(Self::Max),
                _ => None,
            }
        }
    }
}
impl ::prost::Name for MessagePayload {
    const NAME: &'static str = "MessagePayload";
    const PACKAGE: &'static str = "make87_ntfy.publish";
    fn full_name() -> ::prost::alloc::string::String {
        "make87_ntfy.publish.MessagePayload".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "/make87_ntfy.publish.MessagePayload".into()
    }
}