Class SelectionInput (2.42.0)

public final class SelectionInput extends GeneratedMessageV3 implements SelectionInputOrBuilder

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 widget.

Google Workspace Add-ons and Chat apps:

Protobuf type google.apps.card.v1.SelectionInput

Static Fields

EXTERNAL_DATA_SOURCE_FIELD_NUMBER

public static final int EXTERNAL_DATA_SOURCE_FIELD_NUMBER
Field Value
Type Description
int

ITEMS_FIELD_NUMBER

public static final int ITEMS_FIELD_NUMBER
Field Value
Type Description
int

LABEL_FIELD_NUMBER

public static final int LABEL_FIELD_NUMBER
Field Value
Type Description
int

MULTI_SELECT_MAX_SELECTED_ITEMS_FIELD_NUMBER

public static final int MULTI_SELECT_MAX_SELECTED_ITEMS_FIELD_NUMBER
Field Value
Type Description
int

MULTI_SELECT_MIN_QUERY_LENGTH_FIELD_NUMBER

public static final int MULTI_SELECT_MIN_QUERY_LENGTH_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

ON_CHANGE_ACTION_FIELD_NUMBER

public static final int ON_CHANGE_ACTION_FIELD_NUMBER
Field Value
Type Description
int

PLATFORM_DATA_SOURCE_FIELD_NUMBER

public static final int PLATFORM_DATA_SOURCE_FIELD_NUMBER
Field Value
Type Description
int

TYPE_FIELD_NUMBER

public static final int TYPE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static SelectionInput getDefaultInstance()
Returns
Type Description
SelectionInput

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static SelectionInput.Builder newBuilder()
Returns
Type Description
SelectionInput.Builder

newBuilder(SelectionInput prototype)

public static SelectionInput.Builder newBuilder(SelectionInput prototype)
Parameter
Name Description
prototype SelectionInput
Returns
Type Description
SelectionInput.Builder

parseDelimitedFrom(InputStream input)

public static SelectionInput parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
SelectionInput
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static SelectionInput parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SelectionInput
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static SelectionInput parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
SelectionInput
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static SelectionInput parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SelectionInput
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static SelectionInput parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
SelectionInput
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static SelectionInput parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SelectionInput
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static SelectionInput parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
SelectionInput
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static SelectionInput parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SelectionInput
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static SelectionInput parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
SelectionInput
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static SelectionInput parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SelectionInput
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static SelectionInput parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
SelectionInput
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static SelectionInput parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SelectionInput
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<SelectionInput> parser()
Returns
Type Description
Parser<SelectionInput>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public SelectionInput getDefaultInstanceForType()
Returns
Type Description
SelectionInput

getExternalDataSource()

public Action getExternalDataSource()

An external data source, such as a relational data base.

.google.apps.card.v1.Action external_data_source = 8;

Returns
Type Description
Action

The externalDataSource.

getExternalDataSourceOrBuilder()

public ActionOrBuilder getExternalDataSourceOrBuilder()

An external data source, such as a relational data base.

.google.apps.card.v1.Action external_data_source = 8;

Returns
Type Description
ActionOrBuilder

getItems(int index)

public SelectionInput.SelectionItem getItems(int index)

An array of selectable items. For example, an array of radio buttons or checkboxes. Supports up to 100 items.

repeated .google.apps.card.v1.SelectionInput.SelectionItem items = 4;

Parameter
Name Description
index int
Returns
Type Description
SelectionInput.SelectionItem

getItemsCount()

public int getItemsCount()

An array of selectable items. For example, an array of radio buttons or checkboxes. Supports up to 100 items.

repeated .google.apps.card.v1.SelectionInput.SelectionItem items = 4;

Returns
Type Description
int

getItemsList()

public List<SelectionInput.SelectionItem> getItemsList()

An array of selectable items. For example, an array of radio buttons or checkboxes. Supports up to 100 items.

repeated .google.apps.card.v1.SelectionInput.SelectionItem items = 4;

Returns
Type Description
List<SelectionItem>

getItemsOrBuilder(int index)

public SelectionInput.SelectionItemOrBuilder getItemsOrBuilder(int index)

An array of selectable items. For example, an array of radio buttons or checkboxes. Supports up to 100 items.

repeated .google.apps.card.v1.SelectionInput.SelectionItem items = 4;

Parameter
Name Description
index int
Returns
Type Description
SelectionInput.SelectionItemOrBuilder

getItemsOrBuilderList()

public List<? extends SelectionInput.SelectionItemOrBuilder> getItemsOrBuilderList()

An array of selectable items. For example, an array of radio buttons or checkboxes. Supports up to 100 items.

repeated .google.apps.card.v1.SelectionInput.SelectionItem items = 4;

Returns
Type Description
List<? extends com.google.apps.card.v1.SelectionInput.SelectionItemOrBuilder>

getLabel()

public String getLabel()

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".

string label = 2;

Returns
Type Description
String

The label.

getLabelBytes()

public ByteString getLabelBytes()

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".

string label = 2;

Returns
Type Description
ByteString

The bytes for label.

getMultiSelectDataSourceCase()

public SelectionInput.MultiSelectDataSourceCase getMultiSelectDataSourceCase()
Returns
Type Description
SelectionInput.MultiSelectDataSourceCase

getMultiSelectMaxSelectedItems()

public int getMultiSelectMaxSelectedItems()

For multiselect menus, the maximum number of items that a user can select. Minimum value is 1 item. If unspecified, defaults to 3 items.

int32 multi_select_max_selected_items = 6;

Returns
Type Description
int

The multiSelectMaxSelectedItems.

getMultiSelectMinQueryLength()

public int getMultiSelectMinQueryLength()

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.

int32 multi_select_min_query_length = 7;

Returns
Type Description
int

The multiSelectMinQueryLength.

getName()

public String getName()

The name that identifies the selection input in a form input event.

For details about working with form inputs, see Receive form data.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

The name that identifies the selection input in a form input event.

For details about working with form inputs, see Receive form data.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getOnChangeAction()

public Action getOnChangeAction()

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.

.google.apps.card.v1.Action on_change_action = 5;

Returns
Type Description
Action

The onChangeAction.

getOnChangeActionOrBuilder()

public ActionOrBuilder getOnChangeActionOrBuilder()

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.

.google.apps.card.v1.Action on_change_action = 5;

Returns
Type Description
ActionOrBuilder

getParserForType()

public Parser<SelectionInput> getParserForType()
Returns
Type Description
Parser<SelectionInput>
Overrides

getPlatformDataSource()

public SelectionInput.PlatformDataSource getPlatformDataSource()

A data source from Google Workspace.

.google.apps.card.v1.SelectionInput.PlatformDataSource platform_data_source = 9;

Returns
Type Description
SelectionInput.PlatformDataSource

The platformDataSource.

getPlatformDataSourceOrBuilder()

public SelectionInput.PlatformDataSourceOrBuilder getPlatformDataSourceOrBuilder()

A data source from Google Workspace.

.google.apps.card.v1.SelectionInput.PlatformDataSource platform_data_source = 9;

Returns
Type Description
SelectionInput.PlatformDataSourceOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getType()

public SelectionInput.SelectionType getType()

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.

.google.apps.card.v1.SelectionInput.SelectionType type = 3;

Returns
Type Description
SelectionInput.SelectionType

The type.

getTypeValue()

public int getTypeValue()

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.

.google.apps.card.v1.SelectionInput.SelectionType type = 3;

Returns
Type Description
int

The enum numeric value on the wire for type.

hasExternalDataSource()

public boolean hasExternalDataSource()

An external data source, such as a relational data base.

.google.apps.card.v1.Action external_data_source = 8;

Returns
Type Description
boolean

Whether the externalDataSource field is set.

hasOnChangeAction()

public boolean hasOnChangeAction()

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.

.google.apps.card.v1.Action on_change_action = 5;

Returns
Type Description
boolean

Whether the onChangeAction field is set.

hasPlatformDataSource()

public boolean hasPlatformDataSource()

A data source from Google Workspace.

.google.apps.card.v1.SelectionInput.PlatformDataSource platform_data_source = 9;

Returns
Type Description
boolean

Whether the platformDataSource field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public SelectionInput.Builder newBuilderForType()
Returns
Type Description
SelectionInput.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected SelectionInput.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
SelectionInput.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public SelectionInput.Builder toBuilder()
Returns
Type Description
SelectionInput.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException