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 {
|
impl EncryptedPassportElementPassportRegistration {
|
||||||
pub fn new<F>(files: F) -> Self
|
pub fn new<F>(files: F) -> Self
|
||||||
where
|
where
|
||||||
F: Into<Vec<PassportFile>>,
|
F: Into<Vec<PassportFile>>,
|
||||||
{
|
{
|
||||||
Self { files: files.into(), translation: None }
|
Self { files: files.into(), translation: None }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn files<P>(mut self, val: P) -> Self
|
pub fn files<P>(mut self, val: P) -> Self
|
||||||
where
|
where
|
||||||
P: Into<Vec<PassportFile>>,
|
P: Into<Vec<PassportFile>>,
|
||||||
{
|
{
|
||||||
self.files = val.into();
|
self.files = val.into();
|
||||||
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>>,
|
||||||
{
|
{
|
||||||
self.translation = Some(val.into());
|
self.translation = Some(val.into());
|
||||||
self
|
self
|
||||||
|
@ -719,23 +719,23 @@ pub struct EncryptedPassportElementTemporaryRegistration {
|
||||||
|
|
||||||
impl EncryptedPassportElementTemporaryRegistration {
|
impl EncryptedPassportElementTemporaryRegistration {
|
||||||
pub fn new<F>(files: F) -> Self
|
pub fn new<F>(files: F) -> Self
|
||||||
where
|
where
|
||||||
F: Into<Vec<PassportFile>>,
|
F: Into<Vec<PassportFile>>,
|
||||||
{
|
{
|
||||||
Self { files: files.into(), translation: None }
|
Self { files: files.into(), translation: None }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn files<P>(mut self, val: P) -> Self
|
pub fn files<P>(mut self, val: P) -> Self
|
||||||
where
|
where
|
||||||
P: Into<Vec<PassportFile>>,
|
P: Into<Vec<PassportFile>>,
|
||||||
{
|
{
|
||||||
self.files = val.into();
|
self.files = val.into();
|
||||||
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>>,
|
||||||
{
|
{
|
||||||
self.translation = Some(val.into());
|
self.translation = Some(val.into());
|
||||||
self
|
self
|
||||||
|
@ -751,6 +751,23 @@ pub struct EncryptedPassportElementPhoneNumber {
|
||||||
pub phone_number: String,
|
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]
|
#[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]
|
||||||
|
|
Loading…
Reference in a new issue