Class Section.Builder (0.55.0)

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

Represents a section in Google Chat. Sections help users organize their spaces. There are two types of sections:

  1. System Sections: These are predefined sections managed by Google Chat. Their resource names are fixed, and they cannot be created, deleted, or have their display_name modified. Examples include:
  2. users/{user}/sections/default-direct-messages
  3. users/{user}/sections/default-spaces
  4. users/{user}/sections/default-apps

  5. Custom Sections: These are sections created and managed by the user. Creating a custom section using CreateSection requires a display_name. Custom sections can be updated using UpdateSection and deleted using DeleteSection.

Protobuf type google.chat.v1.Section

Implements

SectionOrBuilder

Static Methods

getDescriptor()

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

Methods

build()

public Section build()
Returns
Type Description
Section

buildPartial()

public Section buildPartial()
Returns
Type Description
Section

clear()

public Section.Builder clear()
Returns
Type Description
Section.Builder
Overrides

clearDisplayName()

public Section.Builder clearDisplayName()

Optional. The section's display name. Only populated for sections of type CUSTOM_SECTION. Supports up to 80 characters. Required when creating a CUSTOM_SECTION.

string display_name = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Section.Builder

This builder for chaining.

clearName()

public Section.Builder clearName()

Identifier. Resource name of the section.

For system sections, the section ID is a constant string:

  • DEFAULT_DIRECT_MESSAGES: users/{user}/sections/default-direct-messages
  • DEFAULT_SPACES: users/{user}/sections/default-spaces
  • DEFAULT_APPS: users/{user}/sections/default-apps

    Format: users/{user}/sections/{section}

string name = 1 [(.google.api.field_behavior) = IDENTIFIER];

Returns
Type Description
Section.Builder

This builder for chaining.

clearSortOrder()

public Section.Builder clearSortOrder()

Output only. The order of the section in relation to other sections. Sections with a lower sort_order value appear before sections with a higher value.

int32 sort_order = 3;

Returns
Type Description
Section.Builder

This builder for chaining.

clearType()

public Section.Builder clearType()

Required. The type of the section.

.google.chat.v1.Section.SectionType type = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Section.Builder

This builder for chaining.

getDefaultInstanceForType()

public Section getDefaultInstanceForType()
Returns
Type Description
Section

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getDisplayName()

public String getDisplayName()

Optional. The section's display name. Only populated for sections of type CUSTOM_SECTION. Supports up to 80 characters. Required when creating a CUSTOM_SECTION.

string display_name = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

Optional. The section's display name. Only populated for sections of type CUSTOM_SECTION. Supports up to 80 characters. Required when creating a CUSTOM_SECTION.

string display_name = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for displayName.

getName()

public String getName()

Identifier. Resource name of the section.

For system sections, the section ID is a constant string:

  • DEFAULT_DIRECT_MESSAGES: users/{user}/sections/default-direct-messages
  • DEFAULT_SPACES: users/{user}/sections/default-spaces
  • DEFAULT_APPS: users/{user}/sections/default-apps

    Format: users/{user}/sections/{section}

string name = 1 [(.google.api.field_behavior) = IDENTIFIER];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Identifier. Resource name of the section.

For system sections, the section ID is a constant string:

  • DEFAULT_DIRECT_MESSAGES: users/{user}/sections/default-direct-messages
  • DEFAULT_SPACES: users/{user}/sections/default-spaces
  • DEFAULT_APPS: users/{user}/sections/default-apps

    Format: users/{user}/sections/{section}

string name = 1 [(.google.api.field_behavior) = IDENTIFIER];

Returns
Type Description
ByteString

The bytes for name.

getSortOrder()

public int getSortOrder()

Output only. The order of the section in relation to other sections. Sections with a lower sort_order value appear before sections with a higher value.

int32 sort_order = 3;

Returns
Type Description
int

The sortOrder.

getType()

public Section.SectionType getType()

Required. The type of the section.

.google.chat.v1.Section.SectionType type = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Section.SectionType

The type.

getTypeValue()

public int getTypeValue()

Required. The type of the section.

.google.chat.v1.Section.SectionType type = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The enum numeric value on the wire for type.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Section other)

public Section.Builder mergeFrom(Section other)
Parameter
Name Description
other Section
Returns
Type Description
Section.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Section.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Section.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Section.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Section.Builder
Overrides

setDisplayName(String value)

public Section.Builder setDisplayName(String value)

Optional. The section's display name. Only populated for sections of type CUSTOM_SECTION. Supports up to 80 characters. Required when creating a CUSTOM_SECTION.

string display_name = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The displayName to set.

Returns
Type Description
Section.Builder

This builder for chaining.

setDisplayNameBytes(ByteString value)

public Section.Builder setDisplayNameBytes(ByteString value)

Optional. The section's display name. Only populated for sections of type CUSTOM_SECTION. Supports up to 80 characters. Required when creating a CUSTOM_SECTION.

string display_name = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes for displayName to set.

Returns
Type Description
Section.Builder

This builder for chaining.

setName(String value)

public Section.Builder setName(String value)

Identifier. Resource name of the section.

For system sections, the section ID is a constant string:

  • DEFAULT_DIRECT_MESSAGES: users/{user}/sections/default-direct-messages
  • DEFAULT_SPACES: users/{user}/sections/default-spaces
  • DEFAULT_APPS: users/{user}/sections/default-apps

    Format: users/{user}/sections/{section}

string name = 1 [(.google.api.field_behavior) = IDENTIFIER];

Parameter
Name Description
value String

The name to set.

Returns
Type Description
Section.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Section.Builder setNameBytes(ByteString value)

Identifier. Resource name of the section.

For system sections, the section ID is a constant string:

  • DEFAULT_DIRECT_MESSAGES: users/{user}/sections/default-direct-messages
  • DEFAULT_SPACES: users/{user}/sections/default-spaces
  • DEFAULT_APPS: users/{user}/sections/default-apps

    Format: users/{user}/sections/{section}

string name = 1 [(.google.api.field_behavior) = IDENTIFIER];

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
Section.Builder

This builder for chaining.

setSortOrder(int value)

public Section.Builder setSortOrder(int value)

Output only. The order of the section in relation to other sections. Sections with a lower sort_order value appear before sections with a higher value.

int32 sort_order = 3;

Parameter
Name Description
value int

The sortOrder to set.

Returns
Type Description
Section.Builder

This builder for chaining.

setType(Section.SectionType value)

public Section.Builder setType(Section.SectionType value)

Required. The type of the section.

.google.chat.v1.Section.SectionType type = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value Section.SectionType

The type to set.

Returns
Type Description
Section.Builder

This builder for chaining.

setTypeValue(int value)

public Section.Builder setTypeValue(int value)

Required. The type of the section.

.google.chat.v1.Section.SectionType type = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value int

The enum numeric value on the wire for type to set.

Returns
Type Description
Section.Builder

This builder for chaining.