Add setters to EncryptedPassportElementTemporaryRegistration

This commit is contained in:
Temirkhan Myrzamadi 2020-07-27 17:02:32 +06:00
parent 826a1149c1
commit f8a51182de

View file

@ -717,6 +717,31 @@ pub struct EncryptedPassportElementTemporaryRegistration {
pub translation: Option<Vec<PassportFile>>, pub translation: Option<Vec<PassportFile>>,
} }
impl EncryptedPassportElementTemporaryRegistration {
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]