From e415393d14c9a72ae8f15cd19254ab2daee552a6 Mon Sep 17 00:00:00 2001 From: Temirkhan Myrzamadi Date: Mon, 27 Jul 2020 17:05:44 +0600 Subject: [PATCH] Add setters to EncryptedPassportElementPhoneNumber --- src/types/encrypted_passport_element.rs | 41 +++++++++++++++++-------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/src/types/encrypted_passport_element.rs b/src/types/encrypted_passport_element.rs index bbf30f91..87a9714b 100644 --- a/src/types/encrypted_passport_element.rs +++ b/src/types/encrypted_passport_element.rs @@ -667,23 +667,23 @@ pub struct EncryptedPassportElementPassportRegistration { impl EncryptedPassportElementPassportRegistration { pub fn new(files: F) -> Self - where - F: Into>, + where + F: Into>, { Self { files: files.into(), translation: None } } pub fn files

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

(mut self, val: P) -> Self - where - P: Into>, + where + P: Into>, { self.translation = Some(val.into()); self @@ -719,23 +719,23 @@ pub struct EncryptedPassportElementTemporaryRegistration { impl EncryptedPassportElementTemporaryRegistration { pub fn new(files: F) -> Self - where - F: Into>, + where + F: Into>, { Self { files: files.into(), translation: None } } pub fn files

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

(mut self, val: P) -> Self - where - P: Into>, + where + P: Into>, { self.translation = Some(val.into()); self @@ -751,6 +751,23 @@ pub struct EncryptedPassportElementPhoneNumber { pub phone_number: String, } +impl EncryptedPassportElementPhoneNumber { + pub fn new(phone_number: S) -> Self + where + S: Into, + { + Self { phone_number: phone_number.into() } + } + + pub fn phone_number(mut self, val: S) -> Self + where + S: Into, + { + self.phone_number = val.into(); + self + } +} + #[serde_with_macros::skip_serializing_none] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[non_exhaustive]