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
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 SetStickerPositionInSetParams {
    pub sticker: String,
    pub position: i64,
}

impl_into_future!(SetStickerPositionInSetRequest<'a>);

///Use this method to move a sticker in a set created by the bot to a specific position. Returns *True* on success.
#[derive(Clone)]
pub struct SetStickerPositionInSetRequest<'a> {
    api: &'a API,
    params: SetStickerPositionInSetParams,
}

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

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

    ///New sticker position in the set, zero-based
    pub fn position(mut self, position: impl Into<i64>) -> Self {
        self.params.position = position.into();
        self
    }
}

impl<'a> API {
    ///Use this method to move a sticker in a set created by the bot to a specific position. Returns *True* on success.
    pub fn set_sticker_position_in_set(
        &'a self,
        sticker: impl Into<String>,
        position: impl Into<i64>,
    ) -> SetStickerPositionInSetRequest {
        SetStickerPositionInSetRequest::new(self, sticker.into(), position.into())
    }
}

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