pub struct SelectionInput {
pub name: String,
pub label: String,
pub type: i32,
pub items: Vec<SelectionItem>,
pub on_change_action: Option<Action>,
pub multi_select_max_selected_items: i32,
pub multi_select_min_query_length: i32,
pub multi_select_data_source: Option<MultiSelectDataSource>,
}
Expand description
A widget that creates one or more UI items that users can select. For example, a dropdown menu or checkboxes. You can use this widget to collect data that can be predicted or enumerated. For an example in Google Chat apps, see Add selectable UI elements.
Chat apps can process the value of items that users select or input. For details about working with form inputs, see Receive form data.
To collect undefined or abstract data from users, use the [TextInput][google.apps.card.v1.TextInput] widget.
Fields§
§name: String
The name that identifies the selection input in a form input event.
For details about working with form inputs, see Receive form data.
label: String
The text that appears above the selection input field in the user interface.
Specify text that helps the user enter the information your app needs. For example, if users are selecting the urgency of a work ticket from a drop-down menu, the label might be “Urgency” or “Select urgency”.
type: i32
The type of items that are displayed to users in a SelectionInput
widget.
Selection types support different types of interactions. For example, users
can select one or more checkboxes, but they can only select one value from
a dropdown menu.
items: Vec<SelectionItem>
An array of selectable items. For example, an array of radio buttons or checkboxes. Supports up to 100 items.
on_change_action: Option<Action>
If specified, the form is submitted when the selection changes. If not specified, you must specify a separate button that submits the form.
For details about working with form inputs, see Receive form data.
multi_select_max_selected_items: i32
For multiselect menus, the maximum number of items that a user can select. Minimum value is 1 item. If unspecified, defaults to 3 items.
multi_select_min_query_length: i32
For multiselect menus, the number of text characters that a user inputs before the app queries autocomplete and displays suggested items in the menu.
If unspecified, defaults to 0 characters for static data sources and 3 characters for external data sources.
multi_select_data_source: Option<MultiSelectDataSource>
For a multiselect menu, the data source that populates selection items.
Implementations§
Source§impl SelectionInput
impl SelectionInput
Sourcepub fn type(&self) -> SelectionType
pub fn type(&self) -> SelectionType
Returns the enum value of type
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_type(&mut self, value: SelectionType)
pub fn set_type(&mut self, value: SelectionType)
Sets type
to the provided enum value.
Trait Implementations§
Source§impl Clone for SelectionInput
impl Clone for SelectionInput
Source§fn clone(&self) -> SelectionInput
fn clone(&self) -> SelectionInput
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SelectionInput
impl Debug for SelectionInput
Source§impl Default for SelectionInput
impl Default for SelectionInput
Source§fn default() -> SelectionInput
fn default() -> SelectionInput
Source§impl Message for SelectionInput
impl Message for SelectionInput
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 SelectionInput
impl PartialEq for SelectionInput
impl StructuralPartialEq for SelectionInput
Auto Trait Implementations§
impl Freeze for SelectionInput
impl RefUnwindSafe for SelectionInput
impl Send for SelectionInput
impl Sync for SelectionInput
impl Unpin for SelectionInput
impl UnwindSafe for SelectionInput
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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