Add setters to EncryptedPassportElementUtilityBill

This commit is contained in:
Temirkhan Myrzamadi 2020-07-27 16:59:32 +06:00
parent ffedac94fc
commit b3c89af68c

View file

@ -440,6 +440,7 @@ impl EncryptedPassportElementInternalPassport {
self.selfie = val; self.selfie = val;
self self
} }
pub fn translation<P>(mut self, val: P) -> Self pub fn translation<P>(mut self, val: P) -> Self
where where
P: Into<Vec<PassportFile>>, P: Into<Vec<PassportFile>>,
@ -508,6 +509,31 @@ pub struct EncryptedPassportElementUtilityBill {
pub translation: Option<Vec<PassportFile>>, pub translation: Option<Vec<PassportFile>>,
} }
impl EncryptedPassportElementUtilityBill {
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]