Add setters to InlineQueryResultDocument

This commit is contained in:
Temirkhan Myrzamadi 2020-07-27 20:08:28 +06:00
parent 0c47f2b0f5
commit d7336fe2cb

View file

@ -56,3 +56,83 @@ pub struct InlineQueryResultDocument {
/// Thumbnail height. /// Thumbnail height.
pub thumb_height: Option<i32>, pub thumb_height: Option<i32>,
} }
impl InlineQueryResultDocument {
pub fn id<S>(mut self, val: S) -> Self
where
S: Into<String>,
{
self.id = val.into();
self
}
pub fn title<S>(mut self, val: S) -> Self
where
S: Into<String>,
{
self.title = val.into();
self
}
pub fn caption<S>(mut self, val: S) -> Self
where
S: Into<String>,
{
self.caption = Some(val.into());
self
}
pub fn parse_mode<S>(mut self, val: ParseMode) -> Self {
self.parse_mode = Some(val);
self
}
pub fn document_url<S>(mut self, val: S) -> Self
where
S: Into<String>,
{
self.document_url = val.into();
self
}
pub fn mime_type(mut self, val: MimeWrapper) -> Self {
self.mime_type = val;
self
}
pub fn description<S>(mut self, val: S) -> Self
where
S: Into<String>,
{
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<S>(mut self, val: S) -> Self
where
S: Into<String>,
{
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
}
}