Skip to main content

zulip_api/message/
bot_type.rs

1use serde_repr::{Deserialize_repr, Serialize_repr};
2
3/// Represents a bot type.
4///
5/// Modified from `openapi-generator-cli` output:
6///
7/// ```shell,no_build,no_run
8/// $ openapi-generator-cli generate -g rust -i ./zerver/openapi/zulip.yaml -o zulip-openapi --skip-validate-spec
9/// ```
10///
11/// ```text
12/// /*
13/// * Zulip REST API
14/// *
15/// * Powerful open source group chat
16/// *
17/// * The version of the OpenAPI document: 1.0.0
18/// *
19/// * Generated by: https://openapi-generator.tech
20/// */
21/// ```
22///
23/// See [zerver/openapi/zulip.yaml](https://github.com/zulip/zulip/blob/main/zerver/openapi/zulip.yaml) for the original OpenAPI configuration.
24///
25/// Configuration slightly modified to work with the Rust generator of [`openapi-generator-cli`](https://openapi-generator.tech).
26#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize_repr, Serialize_repr)]
27#[repr(u64)]
28pub enum BotType {
29    /// Represents a `Generic` bot.
30    Generic = 1,
31    /// Represents a `Incoming webhook` bot.
32    IncomingWebhook = 2,
33    /// Represents a `Outgoing webhook` bot.
34    OutgoingWebhook = 3,
35    /// Represents a `Embedded` bot.
36    Embedded = 4,
37}
38
39impl BotType {
40    /// Creates a new [BotType].
41    pub const fn new() -> Self {
42        Self::Generic
43    }
44}
45
46impl Default for BotType {
47    fn default() -> Self {
48        Self::new()
49    }
50}