diff --git a/src/types/photo_size.rs b/src/types/photo_size.rs index 5efda500..64ddfac7 100644 --- a/src/types/photo_size.rs +++ b/src/types/photo_size.rs @@ -26,6 +26,53 @@ pub struct PhotoSize { pub file_size: Option, } +impl PhotoSize { + pub fn new(file_id: S1, file_unique_id: S2, width: i32, height: i32) -> Self + where + S1: Into, + S2: Into, + { + Self { + file_id: file_id.into(), + file_unique_id: file_unique_id.into(), + width, + height, + file_size: None, + } + } + + pub fn file_id(mut self, val: S) -> Self + where + S: Into, + { + self.file_id = val.into(); + self + } + + pub fn file_unique_id(mut self, val: S) -> Self + where + S: Into, + { + self.file_unique_id = val.into(); + self + } + + pub fn width(mut self, val: i32) -> Self { + self.width = val; + self + } + + pub fn height(mut self, val: i32) -> Self { + self.height = val; + self + } + + pub fn file_size(mut self, val: u32) -> Self { + self.file_size = Some(val); + self + } +} + #[cfg(test)] mod tests { use super::*;