mirror of
https://github.com/teloxide/teloxide.git
synced 2024-10-24 09:57:18 +02:00
Add setters to EncryptedPassportElementPhoneNumber
This commit is contained in:
parent
f8a51182de
commit
e415393d14
1 changed files with 29 additions and 12 deletions
|
@ -667,23 +667,23 @@ pub struct EncryptedPassportElementPassportRegistration {
|
|||
|
||||
impl EncryptedPassportElementPassportRegistration {
|
||||
pub fn new<F>(files: F) -> Self
|
||||
where
|
||||
F: Into<Vec<PassportFile>>,
|
||||
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>>,
|
||||
where
|
||||
P: Into<Vec<PassportFile>>,
|
||||
{
|
||||
self.files = val.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn translation<P>(mut self, val: P) -> Self
|
||||
where
|
||||
P: Into<Vec<PassportFile>>,
|
||||
where
|
||||
P: Into<Vec<PassportFile>>,
|
||||
{
|
||||
self.translation = Some(val.into());
|
||||
self
|
||||
|
@ -719,23 +719,23 @@ pub struct EncryptedPassportElementTemporaryRegistration {
|
|||
|
||||
impl EncryptedPassportElementTemporaryRegistration {
|
||||
pub fn new<F>(files: F) -> Self
|
||||
where
|
||||
F: Into<Vec<PassportFile>>,
|
||||
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>>,
|
||||
where
|
||||
P: Into<Vec<PassportFile>>,
|
||||
{
|
||||
self.files = val.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn translation<P>(mut self, val: P) -> Self
|
||||
where
|
||||
P: Into<Vec<PassportFile>>,
|
||||
where
|
||||
P: Into<Vec<PassportFile>>,
|
||||
{
|
||||
self.translation = Some(val.into());
|
||||
self
|
||||
|
@ -751,6 +751,23 @@ pub struct EncryptedPassportElementPhoneNumber {
|
|||
pub phone_number: String,
|
||||
}
|
||||
|
||||
impl EncryptedPassportElementPhoneNumber {
|
||||
pub fn new<S>(phone_number: S) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
Self { phone_number: phone_number.into() }
|
||||
}
|
||||
|
||||
pub fn phone_number<S>(mut self, val: S) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
self.phone_number = val.into();
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
#[serde_with_macros::skip_serializing_none]
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
|
||||
#[non_exhaustive]
|
||||
|
|
Loading…
Reference in a new issue