Class TextInput (2.38.0)

public final class TextInput extends GeneratedMessageV3 implements TextInputOrBuilder

A field in which users can enter text. Supports suggestions and on-change actions. For an example in Google Chat apps, see Add a field in which a user can enter text.

Chat apps receive and can process the value of entered text during form input events. For details about working with form inputs, see Receive form data.

When you need to collect undefined or abstract data from users, use a text input. To collect defined or enumerated data from users, use the SelectionInput widget.

Google Workspace Add-ons and Chat apps:

Protobuf type google.apps.card.v1.TextInput

Implements

TextInputOrBuilder

Static Fields

AUTO_COMPLETE_ACTION_FIELD_NUMBER

public static final int AUTO_COMPLETE_ACTION_FIELD_NUMBER
Field Value
Type Description
int

HINT_TEXT_FIELD_NUMBER

public static final int HINT_TEXT_FIELD_NUMBER
Field Value
Type Description
int

INITIAL_SUGGESTIONS_FIELD_NUMBER

public static final int INITIAL_SUGGESTIONS_FIELD_NUMBER
Field Value
Type Description
int

LABEL_FIELD_NUMBER

public static final int LABEL_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

PLACEHOLDER_TEXT_FIELD_NUMBER

public static final int PLACEHOLDER_TEXT_FIELD_NUMBER
Field Value
Type Description
int

TYPE_FIELD_NUMBER

public static final int TYPE_FIELD_NUMBER
Field Value
Type Description
int

VALUE_FIELD_NUMBER

public static final int VALUE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static TextInput getDefaultInstance()
Returns
Type Description
TextInput

getDescriptor()

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

newBuilder()

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

newBuilder(TextInput prototype)

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

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

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

getAutoCompleteAction()

public Action getAutoCompleteAction()

Optional. Specify what action to take when the text input field provides suggestions to users who interact with it.

If unspecified, the suggestions are set by initialSuggestions and are processed by the client.

If specified, the app takes the action specified here, such as running a custom function.

Google Workspace Add-ons:

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

Returns
Type Description
Action

The autoCompleteAction.

getAutoCompleteActionOrBuilder()

public ActionOrBuilder getAutoCompleteActionOrBuilder()

Optional. Specify what action to take when the text input field provides suggestions to users who interact with it.

If unspecified, the suggestions are set by initialSuggestions and are processed by the client.

If specified, the app takes the action specified here, such as running a custom function.

Google Workspace Add-ons:

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

Returns
Type Description
ActionOrBuilder

getDefaultInstanceForType()

public TextInput getDefaultInstanceForType()
Returns
Type Description
TextInput

getHintText()

public String getHintText()

Text that appears below the text input field meant to assist users by prompting them to enter a certain value. This text is always visible.

Required if label is unspecified. Otherwise, optional.

string hint_text = 3;

Returns
Type Description
String

The hintText.

getHintTextBytes()

public ByteString getHintTextBytes()

Text that appears below the text input field meant to assist users by prompting them to enter a certain value. This text is always visible.

Required if label is unspecified. Otherwise, optional.

string hint_text = 3;

Returns
Type Description
ByteString

The bytes for hintText.

getInitialSuggestions()

public Suggestions getInitialSuggestions()

Suggested values that users can enter. These values appear when users click inside the text input field. As users type, the suggested values dynamically filter to match what the users have typed.

For example, a text input field for programming language might suggest Java, JavaScript, Python, and C++. When users start typing Jav, the list of suggestions filters to show just Java and JavaScript.

Suggested values help guide users to enter values that your app can make sense of. When referring to JavaScript, some users might enter javascript and others java script. Suggesting JavaScript can standardize how users interact with your app.

When specified, TextInput.type is always SINGLE_LINE, even if it's set to MULTIPLE_LINE.

Google Workspace Add-ons and Chat apps:

.google.apps.card.v1.Suggestions initial_suggestions = 7;

Returns
Type Description
Suggestions

The initialSuggestions.

getInitialSuggestionsOrBuilder()

public SuggestionsOrBuilder getInitialSuggestionsOrBuilder()

Suggested values that users can enter. These values appear when users click inside the text input field. As users type, the suggested values dynamically filter to match what the users have typed.

For example, a text input field for programming language might suggest Java, JavaScript, Python, and C++. When users start typing Jav, the list of suggestions filters to show just Java and JavaScript.

Suggested values help guide users to enter values that your app can make sense of. When referring to JavaScript, some users might enter javascript and others java script. Suggesting JavaScript can standardize how users interact with your app.

When specified, TextInput.type is always SINGLE_LINE, even if it's set to MULTIPLE_LINE.

Google Workspace Add-ons and Chat apps:

.google.apps.card.v1.Suggestions initial_suggestions = 7;

Returns
Type Description
SuggestionsOrBuilder

getLabel()

public String getLabel()

The text that appears above the text input field in the user interface.

Specify text that helps the user enter the information your app needs. For example, if you are asking someone's name, but specifically need their surname, write surname instead of name.

Required if hintText is unspecified. Otherwise, optional.

string label = 2;

Returns
Type Description
String

The label.

getLabelBytes()

public ByteString getLabelBytes()

The text that appears above the text input field in the user interface.

Specify text that helps the user enter the information your app needs. For example, if you are asking someone's name, but specifically need their surname, write surname instead of name.

Required if hintText is unspecified. Otherwise, optional.

string label = 2;

Returns
Type Description
ByteString

The bytes for label.

getName()

public String getName()

The name by which the text input is identified 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 by which the text input is identified 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()

What to do when a change occurs in the text input field. For example, a user adding to the field or deleting text.

Examples of actions to take include running a custom function or opening a dialog in Google Chat.

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

Returns
Type Description
Action

The onChangeAction.

getOnChangeActionOrBuilder()

public ActionOrBuilder getOnChangeActionOrBuilder()

What to do when a change occurs in the text input field. For example, a user adding to the field or deleting text.

Examples of actions to take include running a custom function or opening a dialog in Google Chat.

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

Returns
Type Description
ActionOrBuilder

getParserForType()

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

getPlaceholderText()

public String getPlaceholderText()

Text that appears in the text input field when the field is empty. Use this text to prompt users to enter a value. For example, Enter a number from 0 to 100.

Google Chat apps:

string placeholder_text = 12;

Returns
Type Description
String

The placeholderText.

getPlaceholderTextBytes()

public ByteString getPlaceholderTextBytes()

Text that appears in the text input field when the field is empty. Use this text to prompt users to enter a value. For example, Enter a number from 0 to 100.

Google Chat apps:

string placeholder_text = 12;

Returns
Type Description
ByteString

The bytes for placeholderText.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getType()

public TextInput.Type getType()

How a text input field appears in the user interface. For example, whether the field is single or multi-line.

.google.apps.card.v1.TextInput.Type type = 5;

Returns
Type Description
TextInput.Type

The type.

getTypeValue()

public int getTypeValue()

How a text input field appears in the user interface. For example, whether the field is single or multi-line.

.google.apps.card.v1.TextInput.Type type = 5;

Returns
Type Description
int

The enum numeric value on the wire for type.

getValue()

public String getValue()

The value entered by a user, returned as part of a form input event.

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

string value = 4;

Returns
Type Description
String

The value.

getValueBytes()

public ByteString getValueBytes()

The value entered by a user, returned as part of a form input event.

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

string value = 4;

Returns
Type Description
ByteString

The bytes for value.

hasAutoCompleteAction()

public boolean hasAutoCompleteAction()

Optional. Specify what action to take when the text input field provides suggestions to users who interact with it.

If unspecified, the suggestions are set by initialSuggestions and are processed by the client.

If specified, the app takes the action specified here, such as running a custom function.

Google Workspace Add-ons:

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

Returns
Type Description
boolean

Whether the autoCompleteAction field is set.

hasInitialSuggestions()

public boolean hasInitialSuggestions()

Suggested values that users can enter. These values appear when users click inside the text input field. As users type, the suggested values dynamically filter to match what the users have typed.

For example, a text input field for programming language might suggest Java, JavaScript, Python, and C++. When users start typing Jav, the list of suggestions filters to show just Java and JavaScript.

Suggested values help guide users to enter values that your app can make sense of. When referring to JavaScript, some users might enter javascript and others java script. Suggesting JavaScript can standardize how users interact with your app.

When specified, TextInput.type is always SINGLE_LINE, even if it's set to MULTIPLE_LINE.

Google Workspace Add-ons and Chat apps:

.google.apps.card.v1.Suggestions initial_suggestions = 7;

Returns
Type Description
boolean

Whether the initialSuggestions field is set.

hasOnChangeAction()

public boolean hasOnChangeAction()

What to do when a change occurs in the text input field. For example, a user adding to the field or deleting text.

Examples of actions to take include running a custom function or opening a dialog in Google Chat.

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

Returns
Type Description
boolean

Whether the onChangeAction 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 TextInput.Builder newBuilderForType()
Returns
Type Description
TextInput.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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