From f8a51182de24500559047da33ee5fb977a2584e6 Mon Sep 17 00:00:00 2001 From: Temirkhan Myrzamadi Date: Mon, 27 Jul 2020 17:02:32 +0600 Subject: [PATCH] Add setters to EncryptedPassportElementTemporaryRegistration --- src/types/encrypted_passport_element.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/types/encrypted_passport_element.rs b/src/types/encrypted_passport_element.rs index 31a8eb1e..bbf30f91 100644 --- a/src/types/encrypted_passport_element.rs +++ b/src/types/encrypted_passport_element.rs @@ -717,6 +717,31 @@ pub struct EncryptedPassportElementTemporaryRegistration { pub translation: Option>, } +impl EncryptedPassportElementTemporaryRegistration { + pub fn new(files: F) -> Self + where + F: Into>, + { + Self { files: files.into(), translation: None } + } + + pub fn files

(mut self, val: P) -> Self + where + P: Into>, + { + self.files = val.into(); + self + } + + pub fn translation

(mut self, val: P) -> Self + where + P: Into>, + { + self.translation = Some(val.into()); + self + } +} + #[serde_with_macros::skip_serializing_none] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[non_exhaustive]