pub struct CreatePromptRequest {
pub user: String,
pub body: String,
pub title: Option<String>,
pub approve_text: Option<String>,
pub approve_redirect_url: Option<String>,
pub reject_text: Option<String>,
pub reject_redirect_url: Option<String>,
pub long_poll: Option<bool>,
pub expires_in: Option<f32>,
pub metadata: Option<PromptMetadata>,
pub internal_data: Option<HashMap<String, String>>,
pub idempotency_key: Option<String>,
}
Fields§
§user: String
The user to send the approval request to. Can be either an email address or a phone number.
body: String
The body of the approval request to show the user.
title: Option<String>
The title of an approval request. Defaults to an empty string.
approve_text: Option<String>
The approve action text. Defaults to ‘Approve’.
approve_redirect_url: Option<String>
An HTTPS URL to redirect the user to if the prompt is approved. This URL is kept secret until the user is redirected to it.
reject_text: Option<String>
The reject action text. If not specified the reject button will NOT be rendered, and the user will only see an approve action button.
reject_redirect_url: Option<String>
An HTTPS URL to redirect the user to if the prompt is rejected. This URL is kept secret until the user is redirected to it.
long_poll: Option<bool>
If true, the request waits (long-polls) until the user responds to the prompt or more than 10 minutes pass. Defaults to false.
expires_in: Option<f32>
The number of seconds until this request can no longer be answered.
metadata: Option<PromptMetadata>
§internal_data: Option<HashMap<String, String>>
§idempotency_key: Option<String>
Allows calling create_prompt
multiple times idempotently, such that a prompt is sent at-most once. This key should contain sufficient randomness. Idempotent requests are stored for 24 hours. After that time, the same key will create a new request.
Implementations§
Source§impl CreatePromptRequest
impl CreatePromptRequest
pub fn new(user: String, body: String) -> CreatePromptRequest
Trait Implementations§
Source§impl Debug for CreatePromptRequest
impl Debug for CreatePromptRequest
Source§impl<'de> Deserialize<'de> for CreatePromptRequest
impl<'de> Deserialize<'de> for CreatePromptRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for CreatePromptRequest
impl RefUnwindSafe for CreatePromptRequest
impl Send for CreatePromptRequest
impl Sync for CreatePromptRequest
impl Unpin for CreatePromptRequest
impl UnwindSafe for CreatePromptRequest
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more