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
use serde::{Deserialize, Serialize};
/// Represents a location to which a chat is connected.
/// # Documentation
/// <https://core.telegram.org/bots/api#chatlocation>
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ChatLocation {
/// The location to which the supergroup is connected. Can't be a live location.
pub location: crate::types::Location,
/// Location address; 1-64 characters, as defined by the chat owner
pub address: Box<str>,
}
impl ChatLocation {
/// Creates a new `ChatLocation`.
///
/// # Arguments
/// * `location` - The location to which the supergroup is connected. Can't be a live location.
/// * `address` - Location address; 1-64 characters, as defined by the chat owner
#[must_use]
pub fn new<T0: Into<crate::types::Location>, T1: Into<Box<str>>>(
location: T0,
address: T1,
) -> Self {
Self {
location: location.into(),
address: address.into(),
}
}
/// The location to which the supergroup is connected. Can't be a live location.
#[must_use]
pub fn location<T: Into<crate::types::Location>>(self, val: T) -> Self {
let mut this = self;
this.location = val.into();
this
}
/// Location address; 1-64 characters, as defined by the chat owner
#[must_use]
pub fn address<T: Into<Box<str>>>(self, val: T) -> Self {
let mut this = self;
this.address = val.into();
this
}
}