mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-19 21:49:00 +01:00
Add setters to EncryptedPassportElementPassportRegistration
This commit is contained in:
parent
55a66bd58f
commit
826a1149c1
1 changed files with 25 additions and 0 deletions
|
@ -665,6 +665,31 @@ pub struct EncryptedPassportElementPassportRegistration {
|
||||||
pub translation: Option<Vec<PassportFile>>,
|
pub translation: Option<Vec<PassportFile>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl EncryptedPassportElementPassportRegistration {
|
||||||
|
pub fn new<F>(files: F) -> Self
|
||||||
|
where
|
||||||
|
F: Into<Vec<PassportFile>>,
|
||||||
|
{
|
||||||
|
Self { files: files.into(), translation: None }
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn files<P>(mut self, val: P) -> Self
|
||||||
|
where
|
||||||
|
P: Into<Vec<PassportFile>>,
|
||||||
|
{
|
||||||
|
self.files = val.into();
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn translation<P>(mut self, val: P) -> Self
|
||||||
|
where
|
||||||
|
P: Into<Vec<PassportFile>>,
|
||||||
|
{
|
||||||
|
self.translation = Some(val.into());
|
||||||
|
self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[serde_with_macros::skip_serializing_none]
|
#[serde_with_macros::skip_serializing_none]
|
||||||
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
|
|
Loading…
Add table
Reference in a new issue