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 an incoming shipping query.
/// # Documentation
/// <https://core.telegram.org/bots/api#shippingquery>
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ShippingQuery {
/// Unique query identifier
pub id: Box<str>,
/// User who sent the query
pub from: Box<crate::types::User>,
/// Bot-specified invoice payload
pub invoice_payload: Box<str>,
/// User specified shipping address
pub shipping_address: crate::types::ShippingAddress,
}
impl ShippingQuery {
/// Creates a new `ShippingQuery`.
///
/// # Arguments
/// * `id` - Unique query identifier
/// * `from` - User who sent the query
/// * `invoice_payload` - Bot-specified invoice payload
/// * `shipping_address` - User specified shipping address
#[must_use]
pub fn new<
T0: Into<Box<str>>,
T1: Into<crate::types::User>,
T2: Into<Box<str>>,
T3: Into<crate::types::ShippingAddress>,
>(
id: T0,
from: T1,
invoice_payload: T2,
shipping_address: T3,
) -> Self {
Self {
id: id.into(),
from: Box::new(from.into()),
invoice_payload: invoice_payload.into(),
shipping_address: shipping_address.into(),
}
}
/// Unique query identifier
#[must_use]
pub fn id<T: Into<Box<str>>>(self, val: T) -> Self {
let mut this = self;
this.id = val.into();
this
}
/// User who sent the query
#[must_use]
pub fn from<T: Into<crate::types::User>>(self, val: T) -> Self {
let mut this = self;
this.from = Box::new(val.into());
this
}
/// Bot-specified invoice payload
#[must_use]
pub fn invoice_payload<T: Into<Box<str>>>(self, val: T) -> Self {
let mut this = self;
this.invoice_payload = val.into();
this
}
/// User specified shipping address
#[must_use]
pub fn shipping_address<T: Into<crate::types::ShippingAddress>>(self, val: T) -> Self {
let mut this = self;
this.shipping_address = val.into();
this
}
}