Make setters of KeyboardButtonRequestUsers must use

This commit is contained in:
Akshett Rai Jindal 2024-08-20 19:53:53 +05:30
parent e1f1b4e874
commit a48d071456

View file

@ -59,18 +59,21 @@ impl KeyboardButtonRequestUsers {
} }
/// Setter for `user_is_bot` field /// Setter for `user_is_bot` field
#[must_use]
pub fn user_is_bot(mut self, value: bool) -> Self { pub fn user_is_bot(mut self, value: bool) -> Self {
self.user_is_bot = Some(value); self.user_is_bot = Some(value);
self self
} }
/// Setter for `user_is_premium` field /// Setter for `user_is_premium` field
#[must_use]
pub fn user_is_premium(mut self, value: bool) -> Self { pub fn user_is_premium(mut self, value: bool) -> Self {
self.user_is_premium = Some(value); self.user_is_premium = Some(value);
self self
} }
/// Setter for `max_quantity` field, the value must be in the range 1..=10 /// Setter for `max_quantity` field, the value must be in the range 1..=10
#[must_use]
pub fn max_quantity(mut self, value: u8) -> Self { pub fn max_quantity(mut self, value: u8) -> Self {
assert!((1..=10).contains(&value)); assert!((1..=10).contains(&value));
@ -79,18 +82,21 @@ impl KeyboardButtonRequestUsers {
} }
/// Setter for `request_name` field /// Setter for `request_name` field
#[must_use]
pub fn request_name(mut self, value: bool) -> Self { pub fn request_name(mut self, value: bool) -> Self {
self.request_name = Some(value); self.request_name = Some(value);
self self
} }
/// Setter for `request_username` field /// Setter for `request_username` field
#[must_use]
pub fn request_username(mut self, value: bool) -> Self { pub fn request_username(mut self, value: bool) -> Self {
self.request_username = Some(value); self.request_username = Some(value);
self self
} }
/// Setter for `request_photo` field /// Setter for `request_photo` field
#[must_use]
pub fn request_photo(mut self, value: bool) -> Self { pub fn request_photo(mut self, value: bool) -> Self {
self.request_photo = Some(value); self.request_photo = Some(value);
self self