From 01f929dd4aa3708fc14d9ba7ed683760b0ebb96e Mon Sep 17 00:00:00 2001 From: Temirkhan Myrzamadi Date: Tue, 28 Jul 2020 00:49:30 +0600 Subject: [PATCH] Add setters to InputMessageContentLocation --- src/types/input_message_content.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/types/input_message_content.rs b/src/types/input_message_content.rs index ff7031f5..40fc53d7 100644 --- a/src/types/input_message_content.rs +++ b/src/types/input_message_content.rs @@ -80,6 +80,27 @@ pub struct InputMessageContentLocation { pub live_period: Option, } +impl InputMessageContentLocation { + pub fn new(latitude: f64, longitude: f64) -> Self { + Self { latitude, longitude, live_period: 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 live_period(mut self, val: u32) -> Self { + self.live_period = Some(val); + self + } +} + /// Represents the content of a venue message to be sent as the result of /// an inline query. #[serde_with_macros::skip_serializing_none]