From d7336fe2cbcb9824c52730d50b944b0dd42b3a49 Mon Sep 17 00:00:00 2001 From: Temirkhan Myrzamadi Date: Mon, 27 Jul 2020 20:08:28 +0600 Subject: [PATCH] Add setters to InlineQueryResultDocument --- src/types/inline_query_result_document.rs | 80 +++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/src/types/inline_query_result_document.rs b/src/types/inline_query_result_document.rs index 5027edcb..ea66f561 100644 --- a/src/types/inline_query_result_document.rs +++ b/src/types/inline_query_result_document.rs @@ -56,3 +56,83 @@ pub struct InlineQueryResultDocument { /// Thumbnail height. pub thumb_height: Option, } + +impl InlineQueryResultDocument { + pub fn id(mut self, val: S) -> Self + where + S: Into, + { + self.id = val.into(); + self + } + + pub fn title(mut self, val: S) -> Self + where + S: Into, + { + self.title = val.into(); + self + } + + pub fn caption(mut self, val: S) -> Self + where + S: Into, + { + self.caption = Some(val.into()); + self + } + + pub fn parse_mode(mut self, val: ParseMode) -> Self { + self.parse_mode = Some(val); + self + } + + pub fn document_url(mut self, val: S) -> Self + where + S: Into, + { + self.document_url = val.into(); + self + } + + pub fn mime_type(mut self, val: MimeWrapper) -> Self { + self.mime_type = val; + self + } + + pub fn description(mut self, val: S) -> Self + where + S: Into, + { + self.description = Some(val.into()); + self + } + + pub fn reply_markup(mut self, val: InlineKeyboardMarkup) -> Self { + self.reply_markup = Some(val); + self + } + + pub fn input_message_content(mut self, val: InputMessageContent) -> Self { + self.input_message_content = Some(val); + self + } + + pub fn thumb_url(mut self, val: S) -> Self + where + S: Into, + { + self.thumb_url = Some(val.into()); + self + } + + pub fn thumb_width(mut self, val: i32) -> Self { + self.thumb_width = Some(val); + self + } + + pub fn thumb_height(mut self, val: i32) -> Self { + self.thumb_height = Some(val); + self + } +}