use serde::{Deserialize, Serialize};
use crate::types::{InlineKeyboardMarkup, InputMessageContent};
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultVenue {
pub id: String,
pub latitude: f64,
pub longitude: f64,
pub title: String,
pub address: String,
pub foursquare_id: Option<String>,
pub foursquare_type: Option<String>,
pub google_place_id: Option<String>,
pub google_place_type: Option<String>,
pub reply_markup: Option<InlineKeyboardMarkup>,
pub input_message_content: Option<InputMessageContent>,
pub thumb_url: Option<reqwest::Url>,
pub thumb_width: Option<i32>,
pub thumb_height: Option<i32>,
}
impl InlineQueryResultVenue {
pub fn new<S1, S2, S3>(id: S1, latitude: f64, longitude: f64, title: S2, address: S3) -> Self
where
S1: Into<String>,
S2: Into<String>,
S3: Into<String>,
{
Self {
id: id.into(),
latitude,
longitude,
title: title.into(),
address: address.into(),
foursquare_id: None,
foursquare_type: None,
google_place_id: None,
google_place_type: None,
reply_markup: None,
input_message_content: None,
thumb_url: None,
thumb_width: None,
thumb_height: None,
}
}
pub fn id<S>(mut self, val: S) -> Self
where
S: Into<String>,
{
self.id = val.into();
self
}
#[must_use]
pub fn latitude(mut self, val: f64) -> Self {
self.latitude = val;
self
}
#[must_use]
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
}
pub fn google_place_id<S>(mut self, val: S) -> Self
where
S: Into<String>,
{
self.google_place_id = Some(val.into());
self
}
pub fn google_place_type<S>(mut self, val: S) -> Self
where
S: Into<String>,
{
self.google_place_type = Some(val.into());
self
}
#[must_use]
pub fn reply_markup(mut self, val: InlineKeyboardMarkup) -> Self {
self.reply_markup = Some(val);
self
}
#[must_use]
pub fn input_message_content(mut self, val: InputMessageContent) -> Self {
self.input_message_content = Some(val);
self
}
#[must_use]
pub fn thumb_url(mut self, val: reqwest::Url) -> Self {
self.thumb_url = Some(val);
self
}
#[must_use]
pub fn thumb_width(mut self, val: i32) -> Self {
self.thumb_width = Some(val);
self
}
#[must_use]
pub fn thumb_height(mut self, val: i32) -> Self {
self.thumb_height = Some(val);
self
}
}