tgbot/types/definitions/reply/markup/
prepared.rs1use serde::{Deserialize, Serialize};
2
3use crate::{
4 api::{Method, Payload},
5 types::{Integer, KeyboardButton},
6};
7
8#[derive(Clone, Debug, Deserialize, PartialEq, PartialOrd, Serialize)]
10pub struct PreparedKeyboardButton {
11 id: String,
12}
13
14impl<T> From<T> for PreparedKeyboardButton
15where
16 T: Into<String>,
17{
18 fn from(value: T) -> Self {
19 Self { id: value.into() }
20 }
21}
22
23#[derive(Clone, Debug, Serialize)]
25pub struct SavePreparedKeyboardButton {
26 user_id: Integer,
27 button: KeyboardButton,
28}
29
30impl SavePreparedKeyboardButton {
31 pub fn new(user_id: Integer, button: KeyboardButton) -> Self {
39 Self { user_id, button }
40 }
41}
42
43impl Method for SavePreparedKeyboardButton {
44 type Response = PreparedKeyboardButton;
45
46 fn into_payload(self) -> Payload {
47 Payload::json("savePreparedKeyboardButton", self)
48 }
49}