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
}
pub fn translation<P>(mut self, val: P) -> Self
where
P: Into<Vec<PassportFile>>,
@ -508,6 +509,31 @@ pub struct EncryptedPassportElementUtilityBill {
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]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]