added skip_serializing_if to Option<> fields

This commit is contained in:
P0lunin 2019-10-19 18:43:52 +03:00
parent 2cb5adeebe
commit 6467f03978

View file

@ -1,11 +1,19 @@
#[derive(Debug, Deserialize, Hash, PartialEq, Eq, Serialize, Clone)]
pub struct ChatPermissions {
#[serde(skip_serializing_if = "Option::is_none")]
pub can_send_messages: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub can_send_media_messages: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub can_send_polls: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub can_send_other_messages: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub can_add_web_page_previews: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub can_change_info: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub can_invite_users: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub can_pin_messages: Option<bool>,
}