messaging_api_line/models/
bot_info_response.rs

1/*
2 * LINE Messaging API
3 *
4 * This document describes LINE Messaging API.
5 *
6 * The version of the OpenAPI document: 0.0.1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct BotInfoResponse {
16    /// Bot's user ID
17    #[serde(rename = "userId")]
18    pub user_id: String,
19    /// Bot's basic ID
20    #[serde(rename = "basicId")]
21    pub basic_id: String,
22    /// Bot's premium ID. Not included in the response if the premium ID isn't set.
23    #[serde(rename = "premiumId", skip_serializing_if = "Option::is_none")]
24    pub premium_id: Option<String>,
25    /// Bot's display name
26    #[serde(rename = "displayName")]
27    pub display_name: String,
28    /// Profile image URL. `https` image URL. Not included in the response if the bot doesn't have a profile image.
29    #[serde(rename = "pictureUrl", skip_serializing_if = "Option::is_none")]
30    pub picture_url: Option<String>,
31    /// Chat settings set in the LINE Official Account Manager. One of:  `chat`: Chat is set to \"On\". `bot`: Chat is set to \"Off\". 
32    #[serde(rename = "chatMode")]
33    pub chat_mode: ChatMode,
34    /// Automatic read setting for messages. If the chat is set to \"Off\", auto is returned. If the chat is set to \"On\", manual is returned.  `auto`: Auto read setting is enabled. `manual`: Auto read setting is disabled.  
35    #[serde(rename = "markAsReadMode")]
36    pub mark_as_read_mode: MarkAsReadMode,
37}
38
39impl BotInfoResponse {
40    pub fn new(user_id: String, basic_id: String, display_name: String, chat_mode: ChatMode, mark_as_read_mode: MarkAsReadMode) -> BotInfoResponse {
41        BotInfoResponse {
42            user_id,
43            basic_id,
44            premium_id: None,
45            display_name,
46            picture_url: None,
47            chat_mode,
48            mark_as_read_mode,
49        }
50    }
51}
52/// Chat settings set in the LINE Official Account Manager. One of:  `chat`: Chat is set to \"On\". `bot`: Chat is set to \"Off\". 
53#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
54pub enum ChatMode {
55    #[serde(rename = "chat")]
56    Chat,
57    #[serde(rename = "bot")]
58    Bot,
59}
60
61impl Default for ChatMode {
62    fn default() -> ChatMode {
63        Self::Chat
64    }
65}
66/// Automatic read setting for messages. If the chat is set to \"Off\", auto is returned. If the chat is set to \"On\", manual is returned.  `auto`: Auto read setting is enabled. `manual`: Auto read setting is disabled.  
67#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
68pub enum MarkAsReadMode {
69    #[serde(rename = "auto")]
70    Auto,
71    #[serde(rename = "manual")]
72    Manual,
73}
74
75impl Default for MarkAsReadMode {
76    fn default() -> MarkAsReadMode {
77        Self::Auto
78    }
79}
80