telers/methods/
edit_message_reply_markup.rs1use crate::client::Bot;
2use serde::Serialize;
3#[derive(Clone, Debug, Serialize)]
10pub struct EditMessageReplyMarkup {
11 #[serde(skip_serializing_if = "Option::is_none")]
13 pub business_connection_id: Option<Box<str>>,
14 #[serde(skip_serializing_if = "Option::is_none")]
16 pub chat_id: Option<crate::types::ChatIdKind>,
17 #[serde(skip_serializing_if = "Option::is_none")]
19 pub message_id: Option<i64>,
20 #[serde(skip_serializing_if = "Option::is_none")]
22 pub inline_message_id: Option<Box<str>>,
23 #[serde(skip_serializing_if = "Option::is_none")]
25 pub reply_markup: Option<crate::types::InlineKeyboardMarkup>,
26}
27impl EditMessageReplyMarkup {
28 #[must_use]
33 pub fn new() -> Self {
34 Self {
35 business_connection_id: None,
36 chat_id: None,
37 message_id: None,
38 inline_message_id: None,
39 reply_markup: None,
40 }
41 }
42
43 #[must_use]
45 pub fn business_connection_id<T: Into<Box<str>>>(self, val: T) -> Self {
46 let mut this = self;
47 this.business_connection_id = Some(val.into());
48 this
49 }
50
51 #[must_use]
53 pub fn business_connection_id_option<T: Into<Box<str>>>(self, val: Option<T>) -> Self {
54 let mut this = self;
55 this.business_connection_id = val.map(Into::into);
56 this
57 }
58
59 #[must_use]
61 pub fn chat_id<T: Into<crate::types::ChatIdKind>>(self, val: T) -> Self {
62 let mut this = self;
63 this.chat_id = Some(val.into());
64 this
65 }
66
67 #[must_use]
69 pub fn chat_id_option<T: Into<crate::types::ChatIdKind>>(self, val: Option<T>) -> Self {
70 let mut this = self;
71 this.chat_id = val.map(Into::into);
72 this
73 }
74
75 #[must_use]
77 pub fn message_id<T: Into<i64>>(self, val: T) -> Self {
78 let mut this = self;
79 this.message_id = Some(val.into());
80 this
81 }
82
83 #[must_use]
85 pub fn message_id_option<T: Into<i64>>(self, val: Option<T>) -> Self {
86 let mut this = self;
87 this.message_id = val.map(Into::into);
88 this
89 }
90
91 #[must_use]
93 pub fn inline_message_id<T: Into<Box<str>>>(self, val: T) -> Self {
94 let mut this = self;
95 this.inline_message_id = Some(val.into());
96 this
97 }
98
99 #[must_use]
101 pub fn inline_message_id_option<T: Into<Box<str>>>(self, val: Option<T>) -> Self {
102 let mut this = self;
103 this.inline_message_id = val.map(Into::into);
104 this
105 }
106
107 #[must_use]
109 pub fn reply_markup<T: Into<crate::types::InlineKeyboardMarkup>>(self, val: T) -> Self {
110 let mut this = self;
111 this.reply_markup = Some(val.into());
112 this
113 }
114
115 #[must_use]
117 pub fn reply_markup_option<T: Into<crate::types::InlineKeyboardMarkup>>(
118 self,
119 val: Option<T>,
120 ) -> Self {
121 let mut this = self;
122 this.reply_markup = val.map(Into::into);
123 this
124 }
125}
126impl Default for EditMessageReplyMarkup {
127 fn default() -> Self {
128 Self::new()
129 }
130}
131impl super::TelegramMethod for EditMessageReplyMarkup {
132 type Method = Self;
133 type Return = crate::Either<crate::types::Message, bool>;
134
135 fn build_request<Client>(self, _bot: &Bot<Client>) -> super::Request<Self::Method> {
136 super::Request::new("editMessageReplyMarkup", self, None)
137 }
138}