kitsune2_api/proto/gen/
kitsune2.publish.rs

1// This file is @generated by prost-build.
2/// A publish ops message.
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct PublishOps {
5    /// Op ids.
6    #[prost(bytes = "bytes", repeated, tag = "1")]
7    pub op_ids: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8}
9/// A publish agent message.
10#[derive(Clone, PartialEq, ::prost::Message)]
11pub struct PublishAgent {
12    /// Agent info.
13    #[prost(string, tag = "1")]
14    pub agent_info: ::prost::alloc::string::String,
15}
16/// Publish message.
17#[derive(Clone, PartialEq, ::prost::Message)]
18pub struct K2PublishMessage {
19    /// Message type.
20    #[prost(enumeration = "k2_publish_message::PublishMessageType", tag = "1")]
21    pub publish_message_type: i32,
22    /// Message.
23    #[prost(bytes = "bytes", tag = "2")]
24    pub data: ::prost::bytes::Bytes,
25}
26/// Nested message and enum types in `K2PublishMessage`.
27pub mod k2_publish_message {
28    /// Publish message type.
29    ///
30    /// This enum is used to indicate the content of `data`.
31    /// So, OPS -> PublishOps and AGENT -> PublishAgent.
32    #[derive(
33        Clone,
34        Copy,
35        Debug,
36        PartialEq,
37        Eq,
38        Hash,
39        PartialOrd,
40        Ord,
41        ::prost::Enumeration
42    )]
43    #[repr(i32)]
44    pub enum PublishMessageType {
45        /// Default value.
46        Unspecified = 0,
47        /// An Ops publish message.
48        Ops = 1,
49        /// An agent publish message.
50        Agent = 2,
51    }
52    impl PublishMessageType {
53        /// String value of the enum field names used in the ProtoBuf definition.
54        ///
55        /// The values are not transformed in any way and thus are considered stable
56        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
57        pub fn as_str_name(&self) -> &'static str {
58            match self {
59                Self::Unspecified => "UNSPECIFIED",
60                Self::Ops => "OPS",
61                Self::Agent => "AGENT",
62            }
63        }
64        /// Creates an enum from field names used in the ProtoBuf definition.
65        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
66            match value {
67                "UNSPECIFIED" => Some(Self::Unspecified),
68                "OPS" => Some(Self::Ops),
69                "AGENT" => Some(Self::Agent),
70                _ => None,
71            }
72        }
73    }
74}