Class SelectionInput (2.37.1)

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 Selection input.

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
TypeDescription
int

ITEMS_FIELD_NUMBER

public static final int ITEMS_FIELD_NUMBER
Field Value
TypeDescription
int

LABEL_FIELD_NUMBER

public static final int LABEL_FIELD_NUMBER
Field Value
TypeDescription
int

MULTI_SELECT_MAX_SELECTED_ITEMS_FIELD_NUMBER

public static final int MULTI_SELECT_MAX_SELECTED_ITEMS_FIELD_NUMBER
Field Value
TypeDescription
int

MULTI_SELECT_MIN_QUERY_LENGTH_FIELD_NUMBER

public static final int MULTI_SELECT_MIN_QUERY_LENGTH_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

ON_CHANGE_ACTION_FIELD_NUMBER

public static final int ON_CHANGE_ACTION_FIELD_NUMBER
Field Value
TypeDescription
int

PLATFORM_DATA_SOURCE_FIELD_NUMBER

public static final int PLATFORM_DATA_SOURCE_FIELD_NUMBER
Field Value
TypeDescription
int

TYPE_FIELD_NUMBER

public static final int TYPE_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static SelectionInput getDefaultInstance()
Returns
TypeDescription
SelectionInput

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static SelectionInput.Builder newBuilder()
Returns
TypeDescription
SelectionInput.Builder

newBuilder(SelectionInput prototype)

public static SelectionInput.Builder newBuilder(SelectionInput prototype)
Parameter
NameDescription
prototypeSelectionInput
Returns
TypeDescription
SelectionInput.Builder

parseDelimitedFrom(InputStream input)

public static SelectionInput parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
SelectionInput
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static SelectionInput parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
SelectionInput
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static SelectionInput parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
SelectionInput
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static SelectionInput parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
SelectionInput
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static SelectionInput parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
SelectionInput
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static SelectionInput parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
SelectionInput
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static SelectionInput parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
SelectionInput
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static SelectionInput parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
SelectionInput
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static SelectionInput parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
SelectionInput
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static SelectionInput parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
SelectionInput
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static SelectionInput parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
SelectionInput
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static SelectionInput parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
SelectionInput
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<SelectionInput> parser()
Returns
TypeDescription
Parser<SelectionInput>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public SelectionInput getDefaultInstanceForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for label.

getMultiSelectDataSourceCase()

public SelectionInput.MultiSelectDataSourceCase getMultiSelectDataSourceCase()
Returns
TypeDescription
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
TypeDescription
int

The multiSelectMaxSelectedItems.

getMultiSelectMinQueryLength()

public int getMultiSelectMinQueryLength()

For multiselect menus, the number of text characters that a user inputs before the Chat 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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ActionOrBuilder

getParserForType()

public Parser<SelectionInput> getParserForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
SelectionInput.PlatformDataSourceOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

Whether the platformDataSource field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public SelectionInput.Builder newBuilderForType()
Returns
TypeDescription
SelectionInput.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected SelectionInput.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
SelectionInput.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public SelectionInput.Builder toBuilder()
Returns
TypeDescription
SelectionInput.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException