mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-03 09:49:07 +01:00
fix optional value
This commit is contained in:
parent
c3f543786d
commit
3443942cf9
1 changed files with 11 additions and 0 deletions
|
@ -12,9 +12,11 @@ pub struct GetUserProfilePhotos<'a> {
|
||||||
user_id: i32,
|
user_id: i32,
|
||||||
/// Sequential number of the first photo to be returned. By default, all
|
/// Sequential number of the first photo to be returned. By default, all
|
||||||
/// photos are returned.
|
/// photos are returned.
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
offset: Option<i64>,
|
offset: Option<i64>,
|
||||||
///Limits the number of photos to be retrieved. Values between 1—100 are
|
///Limits the number of photos to be retrieved. Values between 1—100 are
|
||||||
/// accepted. Defaults to 100.
|
/// accepted. Defaults to 100.
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
limit: Option<i64>,
|
limit: Option<i64>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,4 +61,13 @@ impl<'a> GetUserProfilePhotos<'a> {
|
||||||
self.offset = Some(offset.into());
|
self.offset = Some(offset.into());
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn limit<T>(mut self, limit: T) -> Self
|
||||||
|
where
|
||||||
|
T: Into<i64>,
|
||||||
|
{
|
||||||
|
self.limit = Some(limit.into());
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue