1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
use crate::api::API;
use crate::errors::ConogramError;
use crate::impl_into_future;
use crate::request::RequestT;
use serde::Serialize;
use std::future::{Future, IntoFuture};
use std::pin::Pin;

#[derive(Debug, Clone, Serialize)]
pub struct SetStickerEmojiListParams {
    pub sticker: String,
    pub emoji_list: Vec<String>,
}

impl_into_future!(SetStickerEmojiListRequest<'a>);

///Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns *True* on success.
#[derive(Clone)]
pub struct SetStickerEmojiListRequest<'a> {
    api: &'a API,
    params: SetStickerEmojiListParams,
}

impl<'a> RequestT for SetStickerEmojiListRequest<'a> {
    type ParamsType = SetStickerEmojiListParams;
    type ReturnType = bool;
    fn get_name() -> &'static str {
        "setStickerEmojiList"
    }
    fn get_api_ref(&self) -> &API {
        self.api
    }
    fn get_params_ref(&self) -> &Self::ParamsType {
        &self.params
    }
    fn is_multipart() -> bool {
        false
    }
}
impl<'a> SetStickerEmojiListRequest<'a> {
    pub fn new(api: &'a API, sticker: String, emoji_list: Vec<String>) -> Self {
        Self {
            api,
            params: SetStickerEmojiListParams {
                sticker,
                emoji_list,
            },
        }
    }

    ///File identifier of the sticker
    pub fn sticker(mut self, sticker: impl Into<String>) -> Self {
        self.params.sticker = sticker.into();
        self
    }

    ///A JSON-serialized list of 1-20 emoji associated with the sticker
    pub fn emoji_list(mut self, emoji_list: impl Into<Vec<String>>) -> Self {
        self.params.emoji_list = emoji_list.into();
        self
    }
}

impl<'a> API {
    ///Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns *True* on success.
    pub fn set_sticker_emoji_list(
        &'a self,
        sticker: impl Into<String>,
        emoji_list: impl Into<Vec<String>>,
    ) -> SetStickerEmojiListRequest {
        SetStickerEmojiListRequest::new(self, sticker.into(), emoji_list.into())
    }
}

// Divider: all content below this line will be preserved after code regen