mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
Add setters to InputMessageContentVenue
This commit is contained in:
parent
01f929dd4a
commit
b3cf5be0e5
1 changed files with 59 additions and 0 deletions
|
@ -128,6 +128,65 @@ pub struct InputMessageContentVenue {
|
|||
pub foursquare_type: Option<String>,
|
||||
}
|
||||
|
||||
impl InputMessageContentVenue {
|
||||
pub fn new<S1, S2>(latitude: f64, longitude: f64, title: S1, address: S2) -> Self
|
||||
where
|
||||
S1: Into<String>,
|
||||
S2: Into<String>,
|
||||
{
|
||||
Self {
|
||||
latitude,
|
||||
longitude,
|
||||
title: title.into(),
|
||||
address: address.into(),
|
||||
foursquare_id: None,
|
||||
foursquare_type: None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn latitude(mut self, val: f64) -> Self {
|
||||
self.latitude = val;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn longitude(mut self, val: f64) -> Self {
|
||||
self.longitude = val;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn title<S>(mut self, val: S) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
self.title = val.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn address<S>(mut self, val: S) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
self.address = val.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn foursquare_id<S>(mut self, val: S) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
self.foursquare_id = Some(val.into());
|
||||
self
|
||||
}
|
||||
|
||||
pub fn foursquare_type<S>(mut self, val: S) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
self.foursquare_type = Some(val.into());
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents the content of a contact message to be sent as the result of
|
||||
/// an inline query.
|
||||
#[serde_with_macros::skip_serializing_none]
|
||||
|
|
Loading…
Add table
Reference in a new issue