Class Card.Section.Builder (2.37.1)

public static final class Card.Section.Builder extends GeneratedMessageV3.Builder<Card.Section.Builder> implements Card.SectionOrBuilder

A section contains a collection of widgets that are rendered vertically in the order that they're specified.

Google Workspace Add-ons and Chat apps:

Protobuf type google.apps.card.v1.Card.Section

Static Methods

getDescriptor()

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

Methods

addAllWidgets(Iterable<? extends Widget> values)

public Card.Section.Builder addAllWidgets(Iterable<? extends Widget> values)

All the widgets in the section. Must contain at least one widget.

repeated .google.apps.card.v1.Widget widgets = 2;

Parameter
NameDescription
valuesIterable<? extends com.google.apps.card.v1.Widget>
Returns
TypeDescription
Card.Section.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Card.Section.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Card.Section.Builder
Overrides

addWidgets(Widget value)

public Card.Section.Builder addWidgets(Widget value)

All the widgets in the section. Must contain at least one widget.

repeated .google.apps.card.v1.Widget widgets = 2;

Parameter
NameDescription
valueWidget
Returns
TypeDescription
Card.Section.Builder

addWidgets(Widget.Builder builderForValue)

public Card.Section.Builder addWidgets(Widget.Builder builderForValue)

All the widgets in the section. Must contain at least one widget.

repeated .google.apps.card.v1.Widget widgets = 2;

Parameter
NameDescription
builderForValueWidget.Builder
Returns
TypeDescription
Card.Section.Builder

addWidgets(int index, Widget value)

public Card.Section.Builder addWidgets(int index, Widget value)

All the widgets in the section. Must contain at least one widget.

repeated .google.apps.card.v1.Widget widgets = 2;

Parameters
NameDescription
indexint
valueWidget
Returns
TypeDescription
Card.Section.Builder

addWidgets(int index, Widget.Builder builderForValue)

public Card.Section.Builder addWidgets(int index, Widget.Builder builderForValue)

All the widgets in the section. Must contain at least one widget.

repeated .google.apps.card.v1.Widget widgets = 2;

Parameters
NameDescription
indexint
builderForValueWidget.Builder
Returns
TypeDescription
Card.Section.Builder

addWidgetsBuilder()

public Widget.Builder addWidgetsBuilder()

All the widgets in the section. Must contain at least one widget.

repeated .google.apps.card.v1.Widget widgets = 2;

Returns
TypeDescription
Widget.Builder

addWidgetsBuilder(int index)

public Widget.Builder addWidgetsBuilder(int index)

All the widgets in the section. Must contain at least one widget.

repeated .google.apps.card.v1.Widget widgets = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Widget.Builder

build()

public Card.Section build()
Returns
TypeDescription
Card.Section

buildPartial()

public Card.Section buildPartial()
Returns
TypeDescription
Card.Section

clear()

public Card.Section.Builder clear()
Returns
TypeDescription
Card.Section.Builder
Overrides

clearCollapsible()

public Card.Section.Builder clearCollapsible()

Indicates whether this section is collapsible.

Collapsible sections hide some or all widgets, but users can expand the section to reveal the hidden widgets by clicking Show more. Users can hide the widgets again by clicking Show less.

To determine which widgets are hidden, specify uncollapsibleWidgetsCount.

bool collapsible = 5;

Returns
TypeDescription
Card.Section.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Card.Section.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Card.Section.Builder
Overrides

clearHeader()

public Card.Section.Builder clearHeader()

Text that appears at the top of a section. Supports simple HTML formatted text. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.

string header = 1;

Returns
TypeDescription
Card.Section.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Card.Section.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Card.Section.Builder
Overrides

clearUncollapsibleWidgetsCount()

public Card.Section.Builder clearUncollapsibleWidgetsCount()

The number of uncollapsible widgets which remain visible even when a section is collapsed.

For example, when a section contains five widgets and the uncollapsibleWidgetsCount is set to 2, the first two widgets are always shown and the last three are collapsed by default. The uncollapsibleWidgetsCount is taken into account only when collapsible is true.

int32 uncollapsible_widgets_count = 6;

Returns
TypeDescription
Card.Section.Builder

This builder for chaining.

clearWidgets()

public Card.Section.Builder clearWidgets()

All the widgets in the section. Must contain at least one widget.

repeated .google.apps.card.v1.Widget widgets = 2;

Returns
TypeDescription
Card.Section.Builder

clone()

public Card.Section.Builder clone()
Returns
TypeDescription
Card.Section.Builder
Overrides

getCollapsible()

public boolean getCollapsible()

Indicates whether this section is collapsible.

Collapsible sections hide some or all widgets, but users can expand the section to reveal the hidden widgets by clicking Show more. Users can hide the widgets again by clicking Show less.

To determine which widgets are hidden, specify uncollapsibleWidgetsCount.

bool collapsible = 5;

Returns
TypeDescription
boolean

The collapsible.

getDefaultInstanceForType()

public Card.Section getDefaultInstanceForType()
Returns
TypeDescription
Card.Section

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getHeader()

public String getHeader()

Text that appears at the top of a section. Supports simple HTML formatted text. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.

string header = 1;

Returns
TypeDescription
String

The header.

getHeaderBytes()

public ByteString getHeaderBytes()

Text that appears at the top of a section. Supports simple HTML formatted text. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.

string header = 1;

Returns
TypeDescription
ByteString

The bytes for header.

getUncollapsibleWidgetsCount()

public int getUncollapsibleWidgetsCount()

The number of uncollapsible widgets which remain visible even when a section is collapsed.

For example, when a section contains five widgets and the uncollapsibleWidgetsCount is set to 2, the first two widgets are always shown and the last three are collapsed by default. The uncollapsibleWidgetsCount is taken into account only when collapsible is true.

int32 uncollapsible_widgets_count = 6;

Returns
TypeDescription
int

The uncollapsibleWidgetsCount.

getWidgets(int index)

public Widget getWidgets(int index)

All the widgets in the section. Must contain at least one widget.

repeated .google.apps.card.v1.Widget widgets = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Widget

getWidgetsBuilder(int index)

public Widget.Builder getWidgetsBuilder(int index)

All the widgets in the section. Must contain at least one widget.

repeated .google.apps.card.v1.Widget widgets = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Widget.Builder

getWidgetsBuilderList()

public List<Widget.Builder> getWidgetsBuilderList()

All the widgets in the section. Must contain at least one widget.

repeated .google.apps.card.v1.Widget widgets = 2;

Returns
TypeDescription
List<Builder>

getWidgetsCount()

public int getWidgetsCount()

All the widgets in the section. Must contain at least one widget.

repeated .google.apps.card.v1.Widget widgets = 2;

Returns
TypeDescription
int

getWidgetsList()

public List<Widget> getWidgetsList()

All the widgets in the section. Must contain at least one widget.

repeated .google.apps.card.v1.Widget widgets = 2;

Returns
TypeDescription
List<Widget>

getWidgetsOrBuilder(int index)

public WidgetOrBuilder getWidgetsOrBuilder(int index)

All the widgets in the section. Must contain at least one widget.

repeated .google.apps.card.v1.Widget widgets = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
WidgetOrBuilder

getWidgetsOrBuilderList()

public List<? extends WidgetOrBuilder> getWidgetsOrBuilderList()

All the widgets in the section. Must contain at least one widget.

repeated .google.apps.card.v1.Widget widgets = 2;

Returns
TypeDescription
List<? extends com.google.apps.card.v1.WidgetOrBuilder>

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Card.Section other)

public Card.Section.Builder mergeFrom(Card.Section other)
Parameter
NameDescription
otherCard.Section
Returns
TypeDescription
Card.Section.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Card.Section.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Card.Section.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Card.Section.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Card.Section.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Card.Section.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Card.Section.Builder
Overrides

removeWidgets(int index)

public Card.Section.Builder removeWidgets(int index)

All the widgets in the section. Must contain at least one widget.

repeated .google.apps.card.v1.Widget widgets = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Card.Section.Builder

setCollapsible(boolean value)

public Card.Section.Builder setCollapsible(boolean value)

Indicates whether this section is collapsible.

Collapsible sections hide some or all widgets, but users can expand the section to reveal the hidden widgets by clicking Show more. Users can hide the widgets again by clicking Show less.

To determine which widgets are hidden, specify uncollapsibleWidgetsCount.

bool collapsible = 5;

Parameter
NameDescription
valueboolean

The collapsible to set.

Returns
TypeDescription
Card.Section.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Card.Section.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Card.Section.Builder
Overrides

setHeader(String value)

public Card.Section.Builder setHeader(String value)

Text that appears at the top of a section. Supports simple HTML formatted text. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.

string header = 1;

Parameter
NameDescription
valueString

The header to set.

Returns
TypeDescription
Card.Section.Builder

This builder for chaining.

setHeaderBytes(ByteString value)

public Card.Section.Builder setHeaderBytes(ByteString value)

Text that appears at the top of a section. Supports simple HTML formatted text. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.

string header = 1;

Parameter
NameDescription
valueByteString

The bytes for header to set.

Returns
TypeDescription
Card.Section.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Card.Section.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Card.Section.Builder
Overrides

setUncollapsibleWidgetsCount(int value)

public Card.Section.Builder setUncollapsibleWidgetsCount(int value)

The number of uncollapsible widgets which remain visible even when a section is collapsed.

For example, when a section contains five widgets and the uncollapsibleWidgetsCount is set to 2, the first two widgets are always shown and the last three are collapsed by default. The uncollapsibleWidgetsCount is taken into account only when collapsible is true.

int32 uncollapsible_widgets_count = 6;

Parameter
NameDescription
valueint

The uncollapsibleWidgetsCount to set.

Returns
TypeDescription
Card.Section.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final Card.Section.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Card.Section.Builder
Overrides

setWidgets(int index, Widget value)

public Card.Section.Builder setWidgets(int index, Widget value)

All the widgets in the section. Must contain at least one widget.

repeated .google.apps.card.v1.Widget widgets = 2;

Parameters
NameDescription
indexint
valueWidget
Returns
TypeDescription
Card.Section.Builder

setWidgets(int index, Widget.Builder builderForValue)

public Card.Section.Builder setWidgets(int index, Widget.Builder builderForValue)

All the widgets in the section. Must contain at least one widget.

repeated .google.apps.card.v1.Widget widgets = 2;

Parameters
NameDescription
indexint
builderForValueWidget.Builder
Returns
TypeDescription
Card.Section.Builder