pub struct Action {
pub function: String,
pub parameters: Vec<ActionParameter>,
pub load_indicator: i32,
pub persist_values: bool,
pub interaction: i32,
}
Expand description
An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server.
Fields§
§function: String
A custom function to invoke when the containing element is clicked or othrwise activated.
For example usage, see Read form data.
parameters: Vec<ActionParameter>
List of action parameters.
load_indicator: i32
Specifies the loading indicator that the action displays while making the call to the action.
persist_values: bool
Indicates whether form values persist after the action. The default value
is false
.
If true
, form values remain after the action is triggered. To let the
user make changes while the action is being processed, set
LoadIndicator
to NONE
. For card
messages
in Chat apps, you must also set the action’s
ResponseType
to UPDATE_MESSAGE
and use the same
card_id
from the card that contained the action.
If false
, the form values are cleared when the action is triggered.
To prevent the user from making changes while the action is being
processed, set
LoadIndicator
to SPINNER
.
interaction: i32
Optional. Required when opening a dialog.
What to do in response to an interaction with a user, such as a user clicking a button in a card message.
If unspecified, the app responds by executing an action
—like opening a
link or running a function—as normal.
By specifying an interaction
, the app can respond in special interactive
ways. For example, by setting interaction
to OPEN_DIALOG
, the app can
open a dialog. When
specified, a loading indicator isn’t shown. If specified for
an add-on, the entire card is stripped and nothing is shown in the client.
Implementations§
source§impl Action
impl Action
sourcepub fn load_indicator(&self) -> LoadIndicator
pub fn load_indicator(&self) -> LoadIndicator
Returns the enum value of load_indicator
, or the default if the field is set to an invalid enum value.
sourcepub fn set_load_indicator(&mut self, value: LoadIndicator)
pub fn set_load_indicator(&mut self, value: LoadIndicator)
Sets load_indicator
to the provided enum value.
sourcepub fn interaction(&self) -> Interaction
pub fn interaction(&self) -> Interaction
Returns the enum value of interaction
, or the default if the field is set to an invalid enum value.
sourcepub fn set_interaction(&mut self, value: Interaction)
pub fn set_interaction(&mut self, value: Interaction)
Sets interaction
to the provided enum value.
Trait Implementations§
source§impl Message for Action
impl Message for Action
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for Action
impl PartialEq for Action
impl StructuralPartialEq for Action
Auto Trait Implementations§
impl Freeze for Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnwindSafe for Action
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request