[][src]Struct approveapi_openapi::models::CreatePromptRequest

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.

Methods

impl CreatePromptRequest[src]

pub fn new(user: String, body: String) -> CreatePromptRequest[src]

Trait Implementations

impl Debug for CreatePromptRequest[src]

impl Serialize for CreatePromptRequest[src]

impl<'de> Deserialize<'de> for CreatePromptRequest[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Erased for T