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 serde::{Deserialize, Serialize};
/// This object contains information about a chat boost.
/// # Documentation
/// <https://core.telegram.org/bots/api#chatboost>
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ChatBoost {
/// Unique identifier of the boost
pub boost_id: Box<str>,
/// Point in time (Unix timestamp) when the chat was boosted
pub add_date: i64,
/// Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged
pub expiration_date: i64,
/// Source of the added boost
pub source: crate::types::ChatBoostSource,
}
impl ChatBoost {
/// Creates a new `ChatBoost`.
///
/// # Arguments
/// * `boost_id` - Unique identifier of the boost
/// * `add_date` - Point in time (Unix timestamp) when the chat was boosted
/// * `expiration_date` - Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged
/// * `source` - Source of the added boost
#[must_use]
pub fn new<
T0: Into<Box<str>>,
T1: Into<i64>,
T2: Into<i64>,
T3: Into<crate::types::ChatBoostSource>,
>(
boost_id: T0,
add_date: T1,
expiration_date: T2,
source: T3,
) -> Self {
Self {
boost_id: boost_id.into(),
add_date: add_date.into(),
expiration_date: expiration_date.into(),
source: source.into(),
}
}
/// Unique identifier of the boost
#[must_use]
pub fn boost_id<T: Into<Box<str>>>(self, val: T) -> Self {
let mut this = self;
this.boost_id = val.into();
this
}
/// Point in time (Unix timestamp) when the chat was boosted
#[must_use]
pub fn add_date<T: Into<i64>>(self, val: T) -> Self {
let mut this = self;
this.add_date = val.into();
this
}
/// Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged
#[must_use]
pub fn expiration_date<T: Into<i64>>(self, val: T) -> Self {
let mut this = self;
this.expiration_date = val.into();
this
}
/// Source of the added boost
#[must_use]
pub fn source<T: Into<crate::types::ChatBoostSource>>(self, val: T) -> Self {
let mut this = self;
this.source = val.into();
this
}
}