Added Venue; #[skip_serizlizing_if = "Option::is_none"] where it is missed

This commit is contained in:
Mr-Andersen 2019-09-03 21:44:38 +03:00
parent 3a80ecacc0
commit 52e8507be4
5 changed files with 24 additions and 0 deletions

View file

@ -2,5 +2,6 @@
pub struct AnswerPreCheckoutQuery { pub struct AnswerPreCheckoutQuery {
pub pre_checkout_query_id: String, pub pre_checkout_query_id: String,
pub ok: bool, pub ok: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub error_message: Option<String>, pub error_message: Option<String>,
} }

View file

@ -4,6 +4,8 @@ use crate::core::types::ShippingOption;
pub struct AnswerShippingQuery { pub struct AnswerShippingQuery {
pub shipping_query_id: String, pub shipping_query_id: String,
pub ok: bool, pub ok: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub shipping_options: Option<Vec<ShippingOption>>, pub shipping_options: Option<Vec<ShippingOption>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub error_message: Option<String>, pub error_message: Option<String>,
} }

View file

@ -5,9 +5,14 @@ use crate::core::types::PhotoSize;
pub struct Audio { pub struct Audio {
pub file_id: String, pub file_id: String,
pub duration: u32, pub duration: u32,
#[serde(skip_serializing_if = "Option::is_none")]
pub performer: Option<String>, pub performer: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub title: Option<String>, pub title: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mime_type: Option<String>, pub mime_type: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub file_size: Option<u32>, pub file_size: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub thumb: Option<PhotoSize> pub thumb: Option<PhotoSize>
} }

View file

@ -1,7 +1,10 @@
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)] #[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct LoginUrl { pub struct LoginUrl {
url: String, url: String,
#[serde(skip_serializing_if = "Option::is_none")]
forward_text: Option<String>, forward_text: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
bot_username: Option<String>, bot_username: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
request_write_access: Option<bool>, request_write_access: Option<bool>,
} }

13
src/core/types/venue.rs Normal file
View file

@ -0,0 +1,13 @@
use crate::core::types::Location;
#[derive(Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub struct Venue {
pub location: Location,
pub title: String,
pub address: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub foursquare_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub foursquare_type: Option<String>
}