pub struct SendOtpRequest {
pub to: String,
pub code: Option<String>,
pub ttl: Option<u32>,
pub digits: Option<u8>,
pub intent: Option<String>,
pub channel: Option<OtpChannel>,
pub signature: Option<String>,
pub template_id: Option<String>,
}Expand description
Parameters accepted by otp.send.
Fields§
§to: StringDestination phone number in E.164 format.
code: Option<String>Caller-provided code. When omitted, Unimatrix generates one.
ttl: Option<u32>Code lifetime in seconds.
digits: Option<u8>Number of digits in an automatically generated code.
intent: Option<String>Application-defined verification intent.
channel: Option<OtpChannel>Preferred delivery channel.
signature: Option<String>Message signature used by an SMS template.
template_id: Option<String>Message template ID used to deliver the code.
Implementations§
Source§impl SendOtpRequest
impl SendOtpRequest
Sourcepub fn new(to: impl Into<String>) -> Self
pub fn new(to: impl Into<String>) -> Self
Creates a request that lets Unimatrix generate and deliver the code.
Sourcepub fn with_code(self, code: impl Into<String>) -> Self
pub fn with_code(self, code: impl Into<String>) -> Self
Uses a caller-provided verification code.
Sourcepub fn with_digits(self, digits: u8) -> Self
pub fn with_digits(self, digits: u8) -> Self
Sets the number of digits in an automatically generated code.
Sourcepub fn with_intent(self, intent: impl Into<String>) -> Self
pub fn with_intent(self, intent: impl Into<String>) -> Self
Associates an application-defined intent with the verification.
Sourcepub fn with_channel(self, channel: OtpChannel) -> Self
pub fn with_channel(self, channel: OtpChannel) -> Self
Selects the preferred delivery channel.
Trait Implementations§
Source§impl Clone for SendOtpRequest
impl Clone for SendOtpRequest
Source§fn clone(&self) -> SendOtpRequest
fn clone(&self) -> SendOtpRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SendOtpRequest
impl Debug for SendOtpRequest
Auto Trait Implementations§
impl Freeze for SendOtpRequest
impl RefUnwindSafe for SendOtpRequest
impl Send for SendOtpRequest
impl Sync for SendOtpRequest
impl Unpin for SendOtpRequest
impl UnsafeUnpin for SendOtpRequest
impl UnwindSafe for SendOtpRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more