Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/apps/card/v1/card.proto
// Protobuf Java Version: 3.25.3
package com.google.apps.card.v1;
/**
*
*
*
* A card interface displayed in a Google Chat message or Google Workspace
* Add-on.
*
* Cards support a defined layout, interactive UI elements like buttons, and
* rich media like images. Use cards to present detailed information,
* gather information from users, and guide users to take a next step.
*
* [Card builder](https://addons.gsuite.google.com/uikit/builder)
*
* To learn how
* to build cards, see the following documentation:
*
* * For Google Chat apps, see [Design the components of a card or
* dialog](https://developers.google.com/workspace/chat/design-components-card-dialog).
* * For Google Workspace Add-ons, see [Card-based
* interfaces](https://developers.google.com/apps-script/add-ons/concepts/cards).
*
* **Example: Card message for a Google Chat app**
*
* ![Example contact
* card](https://developers.google.com/workspace/chat/images/card_api_reference.png)
*
* To create the sample card message in Google Chat, use the following JSON:
*
* ```
* {
* "cardsV2": [
* {
* "cardId": "unique-card-id",
* "card": {
* "header": {
* "title": "Sasha",
* "subtitle": "Software Engineer",
* "imageUrl":
* "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png",
* "imageType": "CIRCLE",
* "imageAltText": "Avatar for Sasha"
* },
* "sections": [
* {
* "header": "Contact Info",
* "collapsible": true,
* "uncollapsibleWidgetsCount": 1,
* "widgets": [
* {
* "decoratedText": {
* "startIcon": {
* "knownIcon": "EMAIL"
* },
* "text": "sasha@example.com"
* }
* },
* {
* "decoratedText": {
* "startIcon": {
* "knownIcon": "PERSON"
* },
* "text": "<font color=\"#80e27e\">Online</font>"
* }
* },
* {
* "decoratedText": {
* "startIcon": {
* "knownIcon": "PHONE"
* },
* "text": "+1 (555) 555-1234"
* }
* },
* {
* "buttonList": {
* "buttons": [
* {
* "text": "Share",
* "onClick": {
* "openLink": {
* "url": "https://example.com/share"
* }
* }
* },
* {
* "text": "Edit",
* "onClick": {
* "action": {
* "function": "goToView",
* "parameters": [
* {
* "key": "viewType",
* "value": "EDIT"
* }
* ]
* }
* }
* }
* ]
* }
* }
* ]
* }
* ]
* }
* }
* ]
* }
* ```
*
*
* Protobuf type {@code google.apps.card.v1.Card}
*/
public final class Card extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.apps.card.v1.Card)
CardOrBuilder {
private static final long serialVersionUID = 0L;
// Use Card.newBuilder() to construct.
private Card(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Card() {
sections_ = java.util.Collections.emptyList();
sectionDividerStyle_ = 0;
cardActions_ = java.util.Collections.emptyList();
name_ = "";
displayStyle_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new Card();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.apps.card.v1.CardProto.internal_static_google_apps_card_v1_Card_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.apps.card.v1.Card.class, com.google.apps.card.v1.Card.Builder.class);
}
/**
*
*
*
* The divider style of a card. Currently only used for dividers betweens card
* sections.
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
*
* DIVIDER_STYLE_UNSPECIFIED = 0;
*/
public static final int DIVIDER_STYLE_UNSPECIFIED_VALUE = 0;
/**
*
*
*
* Default option. Render a solid divider between sections.
*
*
* SOLID_DIVIDER = 1;
*/
public static final int SOLID_DIVIDER_VALUE = 1;
/**
*
*
*
* If set, no divider is rendered between sections.
*
*
* NO_DIVIDER = 2;
*/
public static final int NO_DIVIDER_VALUE = 2;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static DividerStyle valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static DividerStyle forNumber(int value) {
switch (value) {
case 0:
return DIVIDER_STYLE_UNSPECIFIED;
case 1:
return SOLID_DIVIDER;
case 2:
return NO_DIVIDER;
default:
return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public DividerStyle findValueByNumber(int number) {
return DividerStyle.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
return com.google.apps.card.v1.Card.getDescriptor().getEnumTypes().get(0);
}
private static final DividerStyle[] VALUES = values();
public static DividerStyle valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private DividerStyle(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.apps.card.v1.Card.DividerStyle)
}
/**
*
*
*
* In Google Workspace Add-ons,
* determines how a card is displayed.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
* The header of the card appears at the bottom of the
* sidebar, partially covering the current top card of the stack. Clicking
* the header pops the card into the card stack. If the card has no header,
* a generated header is used instead.
*
*
* PEEK = 1;
*/
PEEK(1),
/**
*
*
*
* Default value. The card is shown by replacing the view of the top card in
* the card stack.
*
*
* DISPLAY_STYLE_UNSPECIFIED = 0;
*/
public static final int DISPLAY_STYLE_UNSPECIFIED_VALUE = 0;
/**
*
*
*
* The header of the card appears at the bottom of the
* sidebar, partially covering the current top card of the stack. Clicking
* the header pops the card into the card stack. If the card has no header,
* a generated header is used instead.
*
*
* PEEK = 1;
*/
public static final int PEEK_VALUE = 1;
/**
*
*
*
* Default value. The card is shown by replacing the view of the top card in
* the card stack.
*
*
* REPLACE = 2;
*/
public static final int REPLACE_VALUE = 2;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static DisplayStyle valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static DisplayStyle forNumber(int value) {
switch (value) {
case 0:
return DISPLAY_STYLE_UNSPECIFIED;
case 1:
return PEEK;
case 2:
return REPLACE;
default:
return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public DisplayStyle findValueByNumber(int number) {
return DisplayStyle.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
return com.google.apps.card.v1.Card.getDescriptor().getEnumTypes().get(1);
}
private static final DisplayStyle[] VALUES = values();
public static DisplayStyle valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private DisplayStyle(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.apps.card.v1.Card.DisplayStyle)
}
public interface CardHeaderOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.apps.card.v1.Card.CardHeader)
com.google.protobuf.MessageOrBuilder {
/**
*
*
*
* Required. The title of the card header.
* The header has a fixed height: if both a
* title and subtitle are specified, each takes up one line. If only the
* title is specified, it takes up both lines.
*
*
* string title = 1;
*
* @return The title.
*/
java.lang.String getTitle();
/**
*
*
*
* Required. The title of the card header.
* The header has a fixed height: if both a
* title and subtitle are specified, each takes up one line. If only the
* title is specified, it takes up both lines.
*
*
* string title = 1;
*
* @return The bytes for title.
*/
com.google.protobuf.ByteString getTitleBytes();
/**
*
*
*
* The subtitle of the card header. If specified, appears on its own line
* below the `title`.
*
* The subtitle of the card header. If specified, appears on its own line
* below the `title`.
*
*
* string subtitle = 2;
*
* @return The bytes for subtitle.
*/
com.google.protobuf.ByteString getSubtitleBytes();
/**
*
*
*
* The shape used to crop the image.
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
*
* .google.apps.card.v1.Widget.ImageType image_type = 3;
*
* @return The enum numeric value on the wire for imageType.
*/
int getImageTypeValue();
/**
*
*
*
* The shape used to crop the image.
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
* Represents a card header. For an example in Google Chat apps, see [Add a
* header](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_header).
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
*
* Protobuf type {@code google.apps.card.v1.Card.CardHeader}
*/
public static final class CardHeader extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.apps.card.v1.Card.CardHeader)
CardHeaderOrBuilder {
private static final long serialVersionUID = 0L;
// Use CardHeader.newBuilder() to construct.
private CardHeader(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private CardHeader() {
title_ = "";
subtitle_ = "";
imageType_ = 0;
imageUrl_ = "";
imageAltText_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new CardHeader();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_CardHeader_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_CardHeader_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.apps.card.v1.Card.CardHeader.class,
com.google.apps.card.v1.Card.CardHeader.Builder.class);
}
public static final int TITLE_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object title_ = "";
/**
*
*
*
* Required. The title of the card header.
* The header has a fixed height: if both a
* title and subtitle are specified, each takes up one line. If only the
* title is specified, it takes up both lines.
*
* Required. The title of the card header.
* The header has a fixed height: if both a
* title and subtitle are specified, each takes up one line. If only the
* title is specified, it takes up both lines.
*
*
* string title = 1;
*
* @return The bytes for title.
*/
@java.lang.Override
public com.google.protobuf.ByteString getTitleBytes() {
java.lang.Object ref = title_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
title_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SUBTITLE_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile java.lang.Object subtitle_ = "";
/**
*
*
*
* The subtitle of the card header. If specified, appears on its own line
* below the `title`.
*
* The subtitle of the card header. If specified, appears on its own line
* below the `title`.
*
*
* string subtitle = 2;
*
* @return The bytes for subtitle.
*/
@java.lang.Override
public com.google.protobuf.ByteString getSubtitleBytes() {
java.lang.Object ref = subtitle_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
subtitle_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int IMAGE_TYPE_FIELD_NUMBER = 3;
private int imageType_ = 0;
/**
*
*
*
* The shape used to crop the image.
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
*
* .google.apps.card.v1.Widget.ImageType image_type = 3;
*
* @return The enum numeric value on the wire for imageType.
*/
@java.lang.Override
public int getImageTypeValue() {
return imageType_;
}
/**
*
*
*
* The shape used to crop the image.
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
*
* .google.apps.card.v1.Widget.ImageType image_type = 3;
*
* @return The imageType.
*/
@java.lang.Override
public com.google.apps.card.v1.Widget.ImageType getImageType() {
com.google.apps.card.v1.Widget.ImageType result =
com.google.apps.card.v1.Widget.ImageType.forNumber(imageType_);
return result == null ? com.google.apps.card.v1.Widget.ImageType.UNRECOGNIZED : result;
}
public static final int IMAGE_URL_FIELD_NUMBER = 4;
@SuppressWarnings("serial")
private volatile java.lang.Object imageUrl_ = "";
/**
*
*
*
* The HTTPS URL of the image in the card header.
*
* Represents a card header. For an example in Google Chat apps, see [Add a
* header](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_header).
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
*
* Protobuf type {@code google.apps.card.v1.Card.CardHeader}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.apps.card.v1.Card.CardHeader)
com.google.apps.card.v1.Card.CardHeaderOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_CardHeader_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_CardHeader_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.apps.card.v1.Card.CardHeader.class,
com.google.apps.card.v1.Card.CardHeader.Builder.class);
}
// Construct using com.google.apps.card.v1.Card.CardHeader.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
title_ = "";
subtitle_ = "";
imageType_ = 0;
imageUrl_ = "";
imageAltText_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_CardHeader_descriptor;
}
@java.lang.Override
public com.google.apps.card.v1.Card.CardHeader getDefaultInstanceForType() {
return com.google.apps.card.v1.Card.CardHeader.getDefaultInstance();
}
@java.lang.Override
public com.google.apps.card.v1.Card.CardHeader build() {
com.google.apps.card.v1.Card.CardHeader result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.apps.card.v1.Card.CardHeader buildPartial() {
com.google.apps.card.v1.Card.CardHeader result =
new com.google.apps.card.v1.Card.CardHeader(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartial0(com.google.apps.card.v1.Card.CardHeader result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.title_ = title_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.subtitle_ = subtitle_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.imageType_ = imageType_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.imageUrl_ = imageUrl_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.imageAltText_ = imageAltText_;
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.apps.card.v1.Card.CardHeader) {
return mergeFrom((com.google.apps.card.v1.Card.CardHeader) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.apps.card.v1.Card.CardHeader other) {
if (other == com.google.apps.card.v1.Card.CardHeader.getDefaultInstance()) return this;
if (!other.getTitle().isEmpty()) {
title_ = other.title_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getSubtitle().isEmpty()) {
subtitle_ = other.subtitle_;
bitField0_ |= 0x00000002;
onChanged();
}
if (other.imageType_ != 0) {
setImageTypeValue(other.getImageTypeValue());
}
if (!other.getImageUrl().isEmpty()) {
imageUrl_ = other.imageUrl_;
bitField0_ |= 0x00000008;
onChanged();
}
if (!other.getImageAltText().isEmpty()) {
imageAltText_ = other.imageAltText_;
bitField0_ |= 0x00000010;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
title_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
subtitle_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
case 24:
{
imageType_ = input.readEnum();
bitField0_ |= 0x00000004;
break;
} // case 24
case 34:
{
imageUrl_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000008;
break;
} // case 34
case 42:
{
imageAltText_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000010;
break;
} // case 42
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object title_ = "";
/**
*
*
*
* Required. The title of the card header.
* The header has a fixed height: if both a
* title and subtitle are specified, each takes up one line. If only the
* title is specified, it takes up both lines.
*
* Required. The title of the card header.
* The header has a fixed height: if both a
* title and subtitle are specified, each takes up one line. If only the
* title is specified, it takes up both lines.
*
*
* string title = 1;
*
* @return The bytes for title.
*/
public com.google.protobuf.ByteString getTitleBytes() {
java.lang.Object ref = title_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
title_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Required. The title of the card header.
* The header has a fixed height: if both a
* title and subtitle are specified, each takes up one line. If only the
* title is specified, it takes up both lines.
*
*
* string title = 1;
*
* @param value The title to set.
* @return This builder for chaining.
*/
public Builder setTitle(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
title_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* Required. The title of the card header.
* The header has a fixed height: if both a
* title and subtitle are specified, each takes up one line. If only the
* title is specified, it takes up both lines.
*
*
* string title = 1;
*
* @return This builder for chaining.
*/
public Builder clearTitle() {
title_ = getDefaultInstance().getTitle();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
*
* Required. The title of the card header.
* The header has a fixed height: if both a
* title and subtitle are specified, each takes up one line. If only the
* title is specified, it takes up both lines.
*
*
* string title = 1;
*
* @param value The bytes for title to set.
* @return This builder for chaining.
*/
public Builder setTitleBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
title_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object subtitle_ = "";
/**
*
*
*
* The subtitle of the card header. If specified, appears on its own line
* below the `title`.
*
* The subtitle of the card header. If specified, appears on its own line
* below the `title`.
*
*
* string subtitle = 2;
*
* @param value The bytes for subtitle to set.
* @return This builder for chaining.
*/
public Builder setSubtitleBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
subtitle_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
private int imageType_ = 0;
/**
*
*
*
* The shape used to crop the image.
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
*
* .google.apps.card.v1.Widget.ImageType image_type = 3;
*
* @return The enum numeric value on the wire for imageType.
*/
@java.lang.Override
public int getImageTypeValue() {
return imageType_;
}
/**
*
*
*
* The shape used to crop the image.
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
*
* .google.apps.card.v1.Widget.ImageType image_type = 3;
*
* @param value The enum numeric value on the wire for imageType to set.
* @return This builder for chaining.
*/
public Builder setImageTypeValue(int value) {
imageType_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* The shape used to crop the image.
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
*
* .google.apps.card.v1.Widget.ImageType image_type = 3;
*
* @return The imageType.
*/
@java.lang.Override
public com.google.apps.card.v1.Widget.ImageType getImageType() {
com.google.apps.card.v1.Widget.ImageType result =
com.google.apps.card.v1.Widget.ImageType.forNumber(imageType_);
return result == null ? com.google.apps.card.v1.Widget.ImageType.UNRECOGNIZED : result;
}
/**
*
*
*
* The shape used to crop the image.
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
*
* .google.apps.card.v1.Widget.ImageType image_type = 3;
*
* @param value The imageType to set.
* @return This builder for chaining.
*/
public Builder setImageType(com.google.apps.card.v1.Widget.ImageType value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
imageType_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
*
* The shape used to crop the image.
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
* The alternative text of this image that's used for accessibility.
*
*
* string image_alt_text = 5;
*
* @param value The bytes for imageAltText to set.
* @return This builder for chaining.
*/
public Builder setImageAltTextBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
imageAltText_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.apps.card.v1.Card.CardHeader)
}
// @@protoc_insertion_point(class_scope:google.apps.card.v1.Card.CardHeader)
private static final com.google.apps.card.v1.Card.CardHeader DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.apps.card.v1.Card.CardHeader();
}
public static com.google.apps.card.v1.Card.CardHeader getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public CardHeader parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException()
.setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.apps.card.v1.Card.CardHeader getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface SectionOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.apps.card.v1.Card.Section)
com.google.protobuf.MessageOrBuilder {
/**
*
*
*
* 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](https://developers.google.com/workspace/chat/format-messages#card-formatting)
* and
* [Formatting
* text in Google Workspace
* Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
*
* 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](https://developers.google.com/workspace/chat/format-messages#card-formatting)
* and
* [Formatting
* text in Google Workspace
* Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
*
*
* string header = 1;
*
* @return The bytes for header.
*/
com.google.protobuf.ByteString getHeaderBytes();
/**
*
*
*
* All the widgets in the section.
* Must contain at least one widget.
*
* 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`.
*
* 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;
*
* @return The uncollapsibleWidgetsCount.
*/
int getUncollapsibleWidgetsCount();
}
/**
*
*
*
* 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](https://developers.google.com/workspace/extend):
*
*
* Protobuf type {@code google.apps.card.v1.Card.Section}
*/
public static final class Section extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.apps.card.v1.Card.Section)
SectionOrBuilder {
private static final long serialVersionUID = 0L;
// Use Section.newBuilder() to construct.
private Section(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Section() {
header_ = "";
widgets_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new Section();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_Section_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_Section_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.apps.card.v1.Card.Section.class,
com.google.apps.card.v1.Card.Section.Builder.class);
}
public static final int HEADER_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object header_ = "";
/**
*
*
*
* 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](https://developers.google.com/workspace/chat/format-messages#card-formatting)
* and
* [Formatting
* text in Google Workspace
* Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
*
* 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](https://developers.google.com/workspace/chat/format-messages#card-formatting)
* and
* [Formatting
* text in Google Workspace
* Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
*
*
* string header = 1;
*
* @return The bytes for header.
*/
@java.lang.Override
public com.google.protobuf.ByteString getHeaderBytes() {
java.lang.Object ref = header_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
header_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int WIDGETS_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private java.util.List widgets_;
/**
*
*
*
* All the widgets in the section.
* Must contain at least one widget.
*
* All the widgets in the section.
* Must contain at least one widget.
*
*
* repeated .google.apps.card.v1.Widget widgets = 2;
*/
@java.lang.Override
public com.google.apps.card.v1.WidgetOrBuilder getWidgetsOrBuilder(int index) {
return widgets_.get(index);
}
public static final int COLLAPSIBLE_FIELD_NUMBER = 5;
private boolean collapsible_ = false;
/**
*
*
*
* 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;
*
* @return The collapsible.
*/
@java.lang.Override
public boolean getCollapsible() {
return collapsible_;
}
public static final int UNCOLLAPSIBLE_WIDGETS_COUNT_FIELD_NUMBER = 6;
private int uncollapsibleWidgetsCount_ = 0;
/**
*
*
*
* 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;
*
* @return The uncollapsibleWidgetsCount.
*/
@java.lang.Override
public int getUncollapsibleWidgetsCount() {
return uncollapsibleWidgetsCount_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(header_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, header_);
}
for (int i = 0; i < widgets_.size(); i++) {
output.writeMessage(2, widgets_.get(i));
}
if (collapsible_ != false) {
output.writeBool(5, collapsible_);
}
if (uncollapsibleWidgetsCount_ != 0) {
output.writeInt32(6, uncollapsibleWidgetsCount_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(header_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, header_);
}
for (int i = 0; i < widgets_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, widgets_.get(i));
}
if (collapsible_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, collapsible_);
}
if (uncollapsibleWidgetsCount_ != 0) {
size +=
com.google.protobuf.CodedOutputStream.computeInt32Size(6, uncollapsibleWidgetsCount_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.apps.card.v1.Card.Section)) {
return super.equals(obj);
}
com.google.apps.card.v1.Card.Section other = (com.google.apps.card.v1.Card.Section) obj;
if (!getHeader().equals(other.getHeader())) return false;
if (!getWidgetsList().equals(other.getWidgetsList())) return false;
if (getCollapsible() != other.getCollapsible()) return false;
if (getUncollapsibleWidgetsCount() != other.getUncollapsibleWidgetsCount()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + HEADER_FIELD_NUMBER;
hash = (53 * hash) + getHeader().hashCode();
if (getWidgetsCount() > 0) {
hash = (37 * hash) + WIDGETS_FIELD_NUMBER;
hash = (53 * hash) + getWidgetsList().hashCode();
}
hash = (37 * hash) + COLLAPSIBLE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCollapsible());
hash = (37 * hash) + UNCOLLAPSIBLE_WIDGETS_COUNT_FIELD_NUMBER;
hash = (53 * hash) + getUncollapsibleWidgetsCount();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.apps.card.v1.Card.Section parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.apps.card.v1.Card.Section parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.apps.card.v1.Card.Section parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.apps.card.v1.Card.Section parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.apps.card.v1.Card.Section parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.apps.card.v1.Card.Section parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.apps.card.v1.Card.Section parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.apps.card.v1.Card.Section parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.apps.card.v1.Card.Section parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.apps.card.v1.Card.Section parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.apps.card.v1.Card.Section parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.apps.card.v1.Card.Section parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.apps.card.v1.Card.Section prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* 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](https://developers.google.com/workspace/extend):
*
*
* Protobuf type {@code google.apps.card.v1.Card.Section}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.apps.card.v1.Card.Section)
com.google.apps.card.v1.Card.SectionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_Section_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_Section_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.apps.card.v1.Card.Section.class,
com.google.apps.card.v1.Card.Section.Builder.class);
}
// Construct using com.google.apps.card.v1.Card.Section.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
header_ = "";
if (widgetsBuilder_ == null) {
widgets_ = java.util.Collections.emptyList();
} else {
widgets_ = null;
widgetsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
collapsible_ = false;
uncollapsibleWidgetsCount_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_Section_descriptor;
}
@java.lang.Override
public com.google.apps.card.v1.Card.Section getDefaultInstanceForType() {
return com.google.apps.card.v1.Card.Section.getDefaultInstance();
}
@java.lang.Override
public com.google.apps.card.v1.Card.Section build() {
com.google.apps.card.v1.Card.Section result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.apps.card.v1.Card.Section buildPartial() {
com.google.apps.card.v1.Card.Section result =
new com.google.apps.card.v1.Card.Section(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartialRepeatedFields(com.google.apps.card.v1.Card.Section result) {
if (widgetsBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0)) {
widgets_ = java.util.Collections.unmodifiableList(widgets_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.widgets_ = widgets_;
} else {
result.widgets_ = widgetsBuilder_.build();
}
}
private void buildPartial0(com.google.apps.card.v1.Card.Section result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.header_ = header_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.collapsible_ = collapsible_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.uncollapsibleWidgetsCount_ = uncollapsibleWidgetsCount_;
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.apps.card.v1.Card.Section) {
return mergeFrom((com.google.apps.card.v1.Card.Section) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.apps.card.v1.Card.Section other) {
if (other == com.google.apps.card.v1.Card.Section.getDefaultInstance()) return this;
if (!other.getHeader().isEmpty()) {
header_ = other.header_;
bitField0_ |= 0x00000001;
onChanged();
}
if (widgetsBuilder_ == null) {
if (!other.widgets_.isEmpty()) {
if (widgets_.isEmpty()) {
widgets_ = other.widgets_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureWidgetsIsMutable();
widgets_.addAll(other.widgets_);
}
onChanged();
}
} else {
if (!other.widgets_.isEmpty()) {
if (widgetsBuilder_.isEmpty()) {
widgetsBuilder_.dispose();
widgetsBuilder_ = null;
widgets_ = other.widgets_;
bitField0_ = (bitField0_ & ~0x00000002);
widgetsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getWidgetsFieldBuilder()
: null;
} else {
widgetsBuilder_.addAllMessages(other.widgets_);
}
}
}
if (other.getCollapsible() != false) {
setCollapsible(other.getCollapsible());
}
if (other.getUncollapsibleWidgetsCount() != 0) {
setUncollapsibleWidgetsCount(other.getUncollapsibleWidgetsCount());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
header_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
com.google.apps.card.v1.Widget m =
input.readMessage(com.google.apps.card.v1.Widget.parser(), extensionRegistry);
if (widgetsBuilder_ == null) {
ensureWidgetsIsMutable();
widgets_.add(m);
} else {
widgetsBuilder_.addMessage(m);
}
break;
} // case 18
case 40:
{
collapsible_ = input.readBool();
bitField0_ |= 0x00000004;
break;
} // case 40
case 48:
{
uncollapsibleWidgetsCount_ = input.readInt32();
bitField0_ |= 0x00000008;
break;
} // case 48
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object header_ = "";
/**
*
*
*
* 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](https://developers.google.com/workspace/chat/format-messages#card-formatting)
* and
* [Formatting
* text in Google Workspace
* Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
*
* 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](https://developers.google.com/workspace/chat/format-messages#card-formatting)
* and
* [Formatting
* text in Google Workspace
* Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
*
*
* string header = 1;
*
* @return The bytes for header.
*/
public com.google.protobuf.ByteString getHeaderBytes() {
java.lang.Object ref = header_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
header_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* 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](https://developers.google.com/workspace/chat/format-messages#card-formatting)
* and
* [Formatting
* text in Google Workspace
* Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
*
*
* string header = 1;
*
* @param value The header to set.
* @return This builder for chaining.
*/
public Builder setHeader(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
header_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* 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](https://developers.google.com/workspace/chat/format-messages#card-formatting)
* and
* [Formatting
* text in Google Workspace
* Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
*
* 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](https://developers.google.com/workspace/chat/format-messages#card-formatting)
* and
* [Formatting
* text in Google Workspace
* Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
*
*
* string header = 1;
*
* @param value The bytes for header to set.
* @return This builder for chaining.
*/
public Builder setHeaderBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
header_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.util.List widgets_ =
java.util.Collections.emptyList();
private void ensureWidgetsIsMutable() {
if (!((bitField0_ & 0x00000002) != 0)) {
widgets_ = new java.util.ArrayList(widgets_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.apps.card.v1.Widget,
com.google.apps.card.v1.Widget.Builder,
com.google.apps.card.v1.WidgetOrBuilder>
widgetsBuilder_;
/**
*
*
*
* All the widgets in the section.
* Must contain at least one widget.
*
* 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`.
*
* 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;
*
* @param value The collapsible to set.
* @return This builder for chaining.
*/
public Builder setCollapsible(boolean value) {
collapsible_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* 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;
*
* @return This builder for chaining.
*/
public Builder clearCollapsible() {
bitField0_ = (bitField0_ & ~0x00000004);
collapsible_ = false;
onChanged();
return this;
}
private int uncollapsibleWidgetsCount_;
/**
*
*
*
* 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;
*
* @return The uncollapsibleWidgetsCount.
*/
@java.lang.Override
public int getUncollapsibleWidgetsCount() {
return uncollapsibleWidgetsCount_;
}
/**
*
*
*
* 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;
*
* @param value The uncollapsibleWidgetsCount to set.
* @return This builder for chaining.
*/
public Builder setUncollapsibleWidgetsCount(int value) {
uncollapsibleWidgetsCount_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
*
* 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;
*
* @return This builder for chaining.
*/
public Builder clearUncollapsibleWidgetsCount() {
bitField0_ = (bitField0_ & ~0x00000008);
uncollapsibleWidgetsCount_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.apps.card.v1.Card.Section)
}
// @@protoc_insertion_point(class_scope:google.apps.card.v1.Card.Section)
private static final com.google.apps.card.v1.Card.Section DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.apps.card.v1.Card.Section();
}
public static com.google.apps.card.v1.Card.Section getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Section parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException()
.setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.apps.card.v1.Card.Section getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface CardActionOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.apps.card.v1.Card.CardAction)
com.google.protobuf.MessageOrBuilder {
/**
*
*
*
* The label that displays as the action menu item.
*
* A card action is the action associated with the card. For example,
* an invoice card might include actions such as delete invoice, email
* invoice, or open the invoice in a browser.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
*
* Protobuf type {@code google.apps.card.v1.Card.CardAction}
*/
public static final class CardAction extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.apps.card.v1.Card.CardAction)
CardActionOrBuilder {
private static final long serialVersionUID = 0L;
// Use CardAction.newBuilder() to construct.
private CardAction(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private CardAction() {
actionLabel_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new CardAction();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_CardAction_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_CardAction_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.apps.card.v1.Card.CardAction.class,
com.google.apps.card.v1.Card.CardAction.Builder.class);
}
private int bitField0_;
public static final int ACTION_LABEL_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object actionLabel_ = "";
/**
*
*
*
* The label that displays as the action menu item.
*
*
* .google.apps.card.v1.OnClick on_click = 2;
*/
@java.lang.Override
public com.google.apps.card.v1.OnClickOrBuilder getOnClickOrBuilder() {
return onClick_ == null ? com.google.apps.card.v1.OnClick.getDefaultInstance() : onClick_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(actionLabel_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, actionLabel_);
}
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(2, getOnClick());
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(actionLabel_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, actionLabel_);
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getOnClick());
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.apps.card.v1.Card.CardAction)) {
return super.equals(obj);
}
com.google.apps.card.v1.Card.CardAction other = (com.google.apps.card.v1.Card.CardAction) obj;
if (!getActionLabel().equals(other.getActionLabel())) return false;
if (hasOnClick() != other.hasOnClick()) return false;
if (hasOnClick()) {
if (!getOnClick().equals(other.getOnClick())) return false;
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + ACTION_LABEL_FIELD_NUMBER;
hash = (53 * hash) + getActionLabel().hashCode();
if (hasOnClick()) {
hash = (37 * hash) + ON_CLICK_FIELD_NUMBER;
hash = (53 * hash) + getOnClick().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.apps.card.v1.Card.CardAction parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.apps.card.v1.Card.CardAction parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.apps.card.v1.Card.CardAction parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.apps.card.v1.Card.CardAction parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.apps.card.v1.Card.CardAction parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.apps.card.v1.Card.CardAction parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.apps.card.v1.Card.CardAction parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.apps.card.v1.Card.CardAction parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.apps.card.v1.Card.CardAction parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.apps.card.v1.Card.CardAction parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.apps.card.v1.Card.CardAction parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.apps.card.v1.Card.CardAction parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.apps.card.v1.Card.CardAction prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* A card action is the action associated with the card. For example,
* an invoice card might include actions such as delete invoice, email
* invoice, or open the invoice in a browser.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
*
* Protobuf type {@code google.apps.card.v1.Card.CardAction}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.apps.card.v1.Card.CardAction)
com.google.apps.card.v1.Card.CardActionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_CardAction_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_CardAction_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.apps.card.v1.Card.CardAction.class,
com.google.apps.card.v1.Card.CardAction.Builder.class);
}
// Construct using com.google.apps.card.v1.Card.CardAction.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
getOnClickFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
actionLabel_ = "";
onClick_ = null;
if (onClickBuilder_ != null) {
onClickBuilder_.dispose();
onClickBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_CardAction_descriptor;
}
@java.lang.Override
public com.google.apps.card.v1.Card.CardAction getDefaultInstanceForType() {
return com.google.apps.card.v1.Card.CardAction.getDefaultInstance();
}
@java.lang.Override
public com.google.apps.card.v1.Card.CardAction build() {
com.google.apps.card.v1.Card.CardAction result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.apps.card.v1.Card.CardAction buildPartial() {
com.google.apps.card.v1.Card.CardAction result =
new com.google.apps.card.v1.Card.CardAction(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartial0(com.google.apps.card.v1.Card.CardAction result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.actionLabel_ = actionLabel_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000002) != 0)) {
result.onClick_ = onClickBuilder_ == null ? onClick_ : onClickBuilder_.build();
to_bitField0_ |= 0x00000001;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.apps.card.v1.Card.CardAction) {
return mergeFrom((com.google.apps.card.v1.Card.CardAction) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.apps.card.v1.Card.CardAction other) {
if (other == com.google.apps.card.v1.Card.CardAction.getDefaultInstance()) return this;
if (!other.getActionLabel().isEmpty()) {
actionLabel_ = other.actionLabel_;
bitField0_ |= 0x00000001;
onChanged();
}
if (other.hasOnClick()) {
mergeOnClick(other.getOnClick());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
actionLabel_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
input.readMessage(getOnClickFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000002;
break;
} // case 18
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object actionLabel_ = "";
/**
*
*
*
* The label that displays as the action menu item.
*
* The secondary button of the fixed footer. The button must be a text
* button with text and color set.
* If `secondaryButton` is set, you must also set `primaryButton`.
*
*
* .google.apps.card.v1.Button secondary_button = 2;
*
* @return Whether the secondaryButton field is set.
*/
boolean hasSecondaryButton();
/**
*
*
*
* The secondary button of the fixed footer. The button must be a text
* button with text and color set.
* If `secondaryButton` is set, you must also set `primaryButton`.
*
* The secondary button of the fixed footer. The button must be a text
* button with text and color set.
* If `secondaryButton` is set, you must also set `primaryButton`.
*
* A persistent (sticky) footer that that appears at the bottom of the card.
*
* Setting `fixedFooter` without specifying a `primaryButton` or a
* `secondaryButton` causes an error.
*
* For Chat apps, you can use fixed footers in
* [dialogs](https://developers.google.com/workspace/chat/dialogs), but not
* [card
* messages](https://developers.google.com/workspace/chat/create-messages#create).
* For an example in Google Chat apps, see [Add a persistent
* footer](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_persistent_footer).
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
*
* Protobuf type {@code google.apps.card.v1.Card.CardFixedFooter}
*/
public static final class CardFixedFooter extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.apps.card.v1.Card.CardFixedFooter)
CardFixedFooterOrBuilder {
private static final long serialVersionUID = 0L;
// Use CardFixedFooter.newBuilder() to construct.
private CardFixedFooter(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private CardFixedFooter() {}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new CardFixedFooter();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_CardFixedFooter_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_CardFixedFooter_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.apps.card.v1.Card.CardFixedFooter.class,
com.google.apps.card.v1.Card.CardFixedFooter.Builder.class);
}
private int bitField0_;
public static final int PRIMARY_BUTTON_FIELD_NUMBER = 1;
private com.google.apps.card.v1.Button primaryButton_;
/**
*
*
*
* The primary button of the fixed footer. The button must be a text button
* with text and color set.
*
*
* .google.apps.card.v1.Button primary_button = 1;
*
* @return Whether the primaryButton field is set.
*/
@java.lang.Override
public boolean hasPrimaryButton() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*
*
* The primary button of the fixed footer. The button must be a text button
* with text and color set.
*
* The primary button of the fixed footer. The button must be a text button
* with text and color set.
*
*
* .google.apps.card.v1.Button primary_button = 1;
*/
@java.lang.Override
public com.google.apps.card.v1.ButtonOrBuilder getPrimaryButtonOrBuilder() {
return primaryButton_ == null
? com.google.apps.card.v1.Button.getDefaultInstance()
: primaryButton_;
}
public static final int SECONDARY_BUTTON_FIELD_NUMBER = 2;
private com.google.apps.card.v1.Button secondaryButton_;
/**
*
*
*
* The secondary button of the fixed footer. The button must be a text
* button with text and color set.
* If `secondaryButton` is set, you must also set `primaryButton`.
*
*
* .google.apps.card.v1.Button secondary_button = 2;
*
* @return Whether the secondaryButton field is set.
*/
@java.lang.Override
public boolean hasSecondaryButton() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
*
*
* The secondary button of the fixed footer. The button must be a text
* button with text and color set.
* If `secondaryButton` is set, you must also set `primaryButton`.
*
* The secondary button of the fixed footer. The button must be a text
* button with text and color set.
* If `secondaryButton` is set, you must also set `primaryButton`.
*
*
* .google.apps.card.v1.Button secondary_button = 2;
*/
@java.lang.Override
public com.google.apps.card.v1.ButtonOrBuilder getSecondaryButtonOrBuilder() {
return secondaryButton_ == null
? com.google.apps.card.v1.Button.getDefaultInstance()
: secondaryButton_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(1, getPrimaryButton());
}
if (((bitField0_ & 0x00000002) != 0)) {
output.writeMessage(2, getSecondaryButton());
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPrimaryButton());
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSecondaryButton());
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.apps.card.v1.Card.CardFixedFooter)) {
return super.equals(obj);
}
com.google.apps.card.v1.Card.CardFixedFooter other =
(com.google.apps.card.v1.Card.CardFixedFooter) obj;
if (hasPrimaryButton() != other.hasPrimaryButton()) return false;
if (hasPrimaryButton()) {
if (!getPrimaryButton().equals(other.getPrimaryButton())) return false;
}
if (hasSecondaryButton() != other.hasSecondaryButton()) return false;
if (hasSecondaryButton()) {
if (!getSecondaryButton().equals(other.getSecondaryButton())) return false;
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasPrimaryButton()) {
hash = (37 * hash) + PRIMARY_BUTTON_FIELD_NUMBER;
hash = (53 * hash) + getPrimaryButton().hashCode();
}
if (hasSecondaryButton()) {
hash = (37 * hash) + SECONDARY_BUTTON_FIELD_NUMBER;
hash = (53 * hash) + getSecondaryButton().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.apps.card.v1.Card.CardFixedFooter parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.apps.card.v1.Card.CardFixedFooter parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.apps.card.v1.Card.CardFixedFooter parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.apps.card.v1.Card.CardFixedFooter parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.apps.card.v1.Card.CardFixedFooter parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.apps.card.v1.Card.CardFixedFooter parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.apps.card.v1.Card.CardFixedFooter parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.apps.card.v1.Card.CardFixedFooter parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.apps.card.v1.Card.CardFixedFooter parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.apps.card.v1.Card.CardFixedFooter parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.apps.card.v1.Card.CardFixedFooter parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.apps.card.v1.Card.CardFixedFooter parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.apps.card.v1.Card.CardFixedFooter prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* A persistent (sticky) footer that that appears at the bottom of the card.
*
* Setting `fixedFooter` without specifying a `primaryButton` or a
* `secondaryButton` causes an error.
*
* For Chat apps, you can use fixed footers in
* [dialogs](https://developers.google.com/workspace/chat/dialogs), but not
* [card
* messages](https://developers.google.com/workspace/chat/create-messages#create).
* For an example in Google Chat apps, see [Add a persistent
* footer](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_persistent_footer).
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
*
* Protobuf type {@code google.apps.card.v1.Card.CardFixedFooter}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.apps.card.v1.Card.CardFixedFooter)
com.google.apps.card.v1.Card.CardFixedFooterOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_CardFixedFooter_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_CardFixedFooter_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.apps.card.v1.Card.CardFixedFooter.class,
com.google.apps.card.v1.Card.CardFixedFooter.Builder.class);
}
// Construct using com.google.apps.card.v1.Card.CardFixedFooter.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
getPrimaryButtonFieldBuilder();
getSecondaryButtonFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
primaryButton_ = null;
if (primaryButtonBuilder_ != null) {
primaryButtonBuilder_.dispose();
primaryButtonBuilder_ = null;
}
secondaryButton_ = null;
if (secondaryButtonBuilder_ != null) {
secondaryButtonBuilder_.dispose();
secondaryButtonBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_CardFixedFooter_descriptor;
}
@java.lang.Override
public com.google.apps.card.v1.Card.CardFixedFooter getDefaultInstanceForType() {
return com.google.apps.card.v1.Card.CardFixedFooter.getDefaultInstance();
}
@java.lang.Override
public com.google.apps.card.v1.Card.CardFixedFooter build() {
com.google.apps.card.v1.Card.CardFixedFooter result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.apps.card.v1.Card.CardFixedFooter buildPartial() {
com.google.apps.card.v1.Card.CardFixedFooter result =
new com.google.apps.card.v1.Card.CardFixedFooter(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartial0(com.google.apps.card.v1.Card.CardFixedFooter result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.primaryButton_ =
primaryButtonBuilder_ == null ? primaryButton_ : primaryButtonBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.secondaryButton_ =
secondaryButtonBuilder_ == null ? secondaryButton_ : secondaryButtonBuilder_.build();
to_bitField0_ |= 0x00000002;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.apps.card.v1.Card.CardFixedFooter) {
return mergeFrom((com.google.apps.card.v1.Card.CardFixedFooter) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.apps.card.v1.Card.CardFixedFooter other) {
if (other == com.google.apps.card.v1.Card.CardFixedFooter.getDefaultInstance()) return this;
if (other.hasPrimaryButton()) {
mergePrimaryButton(other.getPrimaryButton());
}
if (other.hasSecondaryButton()) {
mergeSecondaryButton(other.getSecondaryButton());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
input.readMessage(getPrimaryButtonFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
input.readMessage(
getSecondaryButtonFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000002;
break;
} // case 18
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private com.google.apps.card.v1.Button primaryButton_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.apps.card.v1.Button,
com.google.apps.card.v1.Button.Builder,
com.google.apps.card.v1.ButtonOrBuilder>
primaryButtonBuilder_;
/**
*
*
*
* The primary button of the fixed footer. The button must be a text button
* with text and color set.
*
*
* .google.apps.card.v1.Button primary_button = 1;
*
* @return Whether the primaryButton field is set.
*/
public boolean hasPrimaryButton() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*
*
* The primary button of the fixed footer. The button must be a text button
* with text and color set.
*
* The secondary button of the fixed footer. The button must be a text
* button with text and color set.
* If `secondaryButton` is set, you must also set `primaryButton`.
*
*
* .google.apps.card.v1.Button secondary_button = 2;
*
* @return Whether the secondaryButton field is set.
*/
public boolean hasSecondaryButton() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
*
*
* The secondary button of the fixed footer. The button must be a text
* button with text and color set.
* If `secondaryButton` is set, you must also set `primaryButton`.
*
* The secondary button of the fixed footer. The button must be a text
* button with text and color set.
* If `secondaryButton` is set, you must also set `primaryButton`.
*
* The secondary button of the fixed footer. The button must be a text
* button with text and color set.
* If `secondaryButton` is set, you must also set `primaryButton`.
*
* The secondary button of the fixed footer. The button must be a text
* button with text and color set.
* If `secondaryButton` is set, you must also set `primaryButton`.
*
* The secondary button of the fixed footer. The button must be a text
* button with text and color set.
* If `secondaryButton` is set, you must also set `primaryButton`.
*
* The secondary button of the fixed footer. The button must be a text
* button with text and color set.
* If `secondaryButton` is set, you must also set `primaryButton`.
*
* The secondary button of the fixed footer. The button must be a text
* button with text and color set.
* If `secondaryButton` is set, you must also set `primaryButton`.
*
* The secondary button of the fixed footer. The button must be a text
* button with text and color set.
* If `secondaryButton` is set, you must also set `primaryButton`.
*
*
* .google.apps.card.v1.Button secondary_button = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.apps.card.v1.Button,
com.google.apps.card.v1.Button.Builder,
com.google.apps.card.v1.ButtonOrBuilder>
getSecondaryButtonFieldBuilder() {
if (secondaryButtonBuilder_ == null) {
secondaryButtonBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.apps.card.v1.Button,
com.google.apps.card.v1.Button.Builder,
com.google.apps.card.v1.ButtonOrBuilder>(
getSecondaryButton(), getParentForChildren(), isClean());
secondaryButton_ = null;
}
return secondaryButtonBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.apps.card.v1.Card.CardFixedFooter)
}
// @@protoc_insertion_point(class_scope:google.apps.card.v1.Card.CardFixedFooter)
private static final com.google.apps.card.v1.Card.CardFixedFooter DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.apps.card.v1.Card.CardFixedFooter();
}
public static com.google.apps.card.v1.Card.CardFixedFooter getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public CardFixedFooter parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException()
.setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.apps.card.v1.Card.CardFixedFooter getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private int bitField0_;
public static final int HEADER_FIELD_NUMBER = 1;
private com.google.apps.card.v1.Card.CardHeader header_;
/**
*
*
*
* The header of the card. A header usually contains a leading image and a
* title. Headers always appear at the top of a card.
*
*
* .google.apps.card.v1.Card.CardHeader header = 1;
*
* @return Whether the header field is set.
*/
@java.lang.Override
public boolean hasHeader() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*
*
* The header of the card. A header usually contains a leading image and a
* title. Headers always appear at the top of a card.
*
* The header of the card. A header usually contains a leading image and a
* title. Headers always appear at the top of a card.
*
*
* .google.apps.card.v1.Card.CardHeader header = 1;
*/
@java.lang.Override
public com.google.apps.card.v1.Card.CardHeaderOrBuilder getHeaderOrBuilder() {
return header_ == null ? com.google.apps.card.v1.Card.CardHeader.getDefaultInstance() : header_;
}
public static final int SECTIONS_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private java.util.List sections_;
/**
*
*
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
*
* repeated .google.apps.card.v1.Card.Section sections = 2;
*/
@java.lang.Override
public int getSectionsCount() {
return sections_.size();
}
/**
*
*
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
*
* repeated .google.apps.card.v1.Card.Section sections = 2;
*/
@java.lang.Override
public com.google.apps.card.v1.Card.SectionOrBuilder getSectionsOrBuilder(int index) {
return sections_.get(index);
}
public static final int SECTION_DIVIDER_STYLE_FIELD_NUMBER = 9;
private int sectionDividerStyle_ = 0;
/**
*
*
*
* The divider style between sections.
*
*
* .google.apps.card.v1.Card.DividerStyle section_divider_style = 9;
*
* @return The enum numeric value on the wire for sectionDividerStyle.
*/
@java.lang.Override
public int getSectionDividerStyleValue() {
return sectionDividerStyle_;
}
/**
*
*
*
* The divider style between sections.
*
*
* .google.apps.card.v1.Card.DividerStyle section_divider_style = 9;
*
* @return The sectionDividerStyle.
*/
@java.lang.Override
public com.google.apps.card.v1.Card.DividerStyle getSectionDividerStyle() {
com.google.apps.card.v1.Card.DividerStyle result =
com.google.apps.card.v1.Card.DividerStyle.forNumber(sectionDividerStyle_);
return result == null ? com.google.apps.card.v1.Card.DividerStyle.UNRECOGNIZED : result;
}
public static final int CARD_ACTIONS_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private java.util.List cardActions_;
/**
*
*
*
* The card's actions. Actions are added to the card's toolbar menu.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
* For example, the following JSON constructs a card action menu with
* `Settings` and `Send Feedback` options:
*
* ```
* "card_actions": [
* {
* "actionLabel": "Settings",
* "onClick": {
* "action": {
* "functionName": "goToView",
* "parameters": [
* {
* "key": "viewType",
* "value": "SETTING"
* }
* ],
* "loadIndicator": "LoadIndicator.SPINNER"
* }
* }
* },
* {
* "actionLabel": "Send Feedback",
* "onClick": {
* "openLink": {
* "url": "https://example.com/feedback"
* }
* }
* }
* ]
* ```
*
* Name of the card. Used as a card identifier in card navigation.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
*
* string name = 4;
*
* @return The bytes for name.
*/
@java.lang.Override
public com.google.protobuf.ByteString getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int FIXED_FOOTER_FIELD_NUMBER = 5;
private com.google.apps.card.v1.Card.CardFixedFooter fixedFooter_;
/**
*
*
*
* The fixed footer shown at the bottom of this card.
*
* Setting `fixedFooter` without specifying a `primaryButton` or a
* `secondaryButton` causes an error. For Chat apps, you can use fixed footers
* in
* [dialogs](https://developers.google.com/workspace/chat/dialogs), but not
* [card
* messages](https://developers.google.com/workspace/chat/create-messages#create).
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
*
* .google.apps.card.v1.Card.CardFixedFooter fixed_footer = 5;
*
* @return Whether the fixedFooter field is set.
*/
@java.lang.Override
public boolean hasFixedFooter() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
*
*
* The fixed footer shown at the bottom of this card.
*
* Setting `fixedFooter` without specifying a `primaryButton` or a
* `secondaryButton` causes an error. For Chat apps, you can use fixed footers
* in
* [dialogs](https://developers.google.com/workspace/chat/dialogs), but not
* [card
* messages](https://developers.google.com/workspace/chat/create-messages#create).
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
* The fixed footer shown at the bottom of this card.
*
* Setting `fixedFooter` without specifying a `primaryButton` or a
* `secondaryButton` causes an error. For Chat apps, you can use fixed footers
* in
* [dialogs](https://developers.google.com/workspace/chat/dialogs), but not
* [card
* messages](https://developers.google.com/workspace/chat/create-messages#create).
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
*
* .google.apps.card.v1.Card.CardFixedFooter fixed_footer = 5;
*/
@java.lang.Override
public com.google.apps.card.v1.Card.CardFixedFooterOrBuilder getFixedFooterOrBuilder() {
return fixedFooter_ == null
? com.google.apps.card.v1.Card.CardFixedFooter.getDefaultInstance()
: fixedFooter_;
}
public static final int DISPLAY_STYLE_FIELD_NUMBER = 6;
private int displayStyle_ = 0;
/**
*
*
*
* In Google Workspace Add-ons, sets the display properties of the
* `peekCardHeader`.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
*
* .google.apps.card.v1.Card.DisplayStyle display_style = 6;
*
* @return The enum numeric value on the wire for displayStyle.
*/
@java.lang.Override
public int getDisplayStyleValue() {
return displayStyle_;
}
/**
*
*
*
* In Google Workspace Add-ons, sets the display properties of the
* `peekCardHeader`.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
*
* .google.apps.card.v1.Card.DisplayStyle display_style = 6;
*
* @return The displayStyle.
*/
@java.lang.Override
public com.google.apps.card.v1.Card.DisplayStyle getDisplayStyle() {
com.google.apps.card.v1.Card.DisplayStyle result =
com.google.apps.card.v1.Card.DisplayStyle.forNumber(displayStyle_);
return result == null ? com.google.apps.card.v1.Card.DisplayStyle.UNRECOGNIZED : result;
}
public static final int PEEK_CARD_HEADER_FIELD_NUMBER = 7;
private com.google.apps.card.v1.Card.CardHeader peekCardHeader_;
/**
*
*
*
* When displaying contextual content, the peek card header acts as a
* placeholder so that the user can navigate forward between the homepage
* cards and the contextual cards.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
*
* .google.apps.card.v1.Card.CardHeader peek_card_header = 7;
*
* @return Whether the peekCardHeader field is set.
*/
@java.lang.Override
public boolean hasPeekCardHeader() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
*
*
* When displaying contextual content, the peek card header acts as a
* placeholder so that the user can navigate forward between the homepage
* cards and the contextual cards.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
* When displaying contextual content, the peek card header acts as a
* placeholder so that the user can navigate forward between the homepage
* cards and the contextual cards.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
*
* .google.apps.card.v1.Card.CardHeader peek_card_header = 7;
*/
@java.lang.Override
public com.google.apps.card.v1.Card.CardHeaderOrBuilder getPeekCardHeaderOrBuilder() {
return peekCardHeader_ == null
? com.google.apps.card.v1.Card.CardHeader.getDefaultInstance()
: peekCardHeader_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(1, getHeader());
}
for (int i = 0; i < sections_.size(); i++) {
output.writeMessage(2, sections_.get(i));
}
for (int i = 0; i < cardActions_.size(); i++) {
output.writeMessage(3, cardActions_.get(i));
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, name_);
}
if (((bitField0_ & 0x00000002) != 0)) {
output.writeMessage(5, getFixedFooter());
}
if (displayStyle_
!= com.google.apps.card.v1.Card.DisplayStyle.DISPLAY_STYLE_UNSPECIFIED.getNumber()) {
output.writeEnum(6, displayStyle_);
}
if (((bitField0_ & 0x00000004) != 0)) {
output.writeMessage(7, getPeekCardHeader());
}
if (sectionDividerStyle_
!= com.google.apps.card.v1.Card.DividerStyle.DIVIDER_STYLE_UNSPECIFIED.getNumber()) {
output.writeEnum(9, sectionDividerStyle_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getHeader());
}
for (int i = 0; i < sections_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, sections_.get(i));
}
for (int i = 0; i < cardActions_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, cardActions_.get(i));
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, name_);
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getFixedFooter());
}
if (displayStyle_
!= com.google.apps.card.v1.Card.DisplayStyle.DISPLAY_STYLE_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, displayStyle_);
}
if (((bitField0_ & 0x00000004) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getPeekCardHeader());
}
if (sectionDividerStyle_
!= com.google.apps.card.v1.Card.DividerStyle.DIVIDER_STYLE_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, sectionDividerStyle_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.apps.card.v1.Card)) {
return super.equals(obj);
}
com.google.apps.card.v1.Card other = (com.google.apps.card.v1.Card) obj;
if (hasHeader() != other.hasHeader()) return false;
if (hasHeader()) {
if (!getHeader().equals(other.getHeader())) return false;
}
if (!getSectionsList().equals(other.getSectionsList())) return false;
if (sectionDividerStyle_ != other.sectionDividerStyle_) return false;
if (!getCardActionsList().equals(other.getCardActionsList())) return false;
if (!getName().equals(other.getName())) return false;
if (hasFixedFooter() != other.hasFixedFooter()) return false;
if (hasFixedFooter()) {
if (!getFixedFooter().equals(other.getFixedFooter())) return false;
}
if (displayStyle_ != other.displayStyle_) return false;
if (hasPeekCardHeader() != other.hasPeekCardHeader()) return false;
if (hasPeekCardHeader()) {
if (!getPeekCardHeader().equals(other.getPeekCardHeader())) return false;
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasHeader()) {
hash = (37 * hash) + HEADER_FIELD_NUMBER;
hash = (53 * hash) + getHeader().hashCode();
}
if (getSectionsCount() > 0) {
hash = (37 * hash) + SECTIONS_FIELD_NUMBER;
hash = (53 * hash) + getSectionsList().hashCode();
}
hash = (37 * hash) + SECTION_DIVIDER_STYLE_FIELD_NUMBER;
hash = (53 * hash) + sectionDividerStyle_;
if (getCardActionsCount() > 0) {
hash = (37 * hash) + CARD_ACTIONS_FIELD_NUMBER;
hash = (53 * hash) + getCardActionsList().hashCode();
}
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
if (hasFixedFooter()) {
hash = (37 * hash) + FIXED_FOOTER_FIELD_NUMBER;
hash = (53 * hash) + getFixedFooter().hashCode();
}
hash = (37 * hash) + DISPLAY_STYLE_FIELD_NUMBER;
hash = (53 * hash) + displayStyle_;
if (hasPeekCardHeader()) {
hash = (37 * hash) + PEEK_CARD_HEADER_FIELD_NUMBER;
hash = (53 * hash) + getPeekCardHeader().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.apps.card.v1.Card parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.apps.card.v1.Card parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.apps.card.v1.Card parseFrom(com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.apps.card.v1.Card parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.apps.card.v1.Card parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.apps.card.v1.Card parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.apps.card.v1.Card parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.apps.card.v1.Card parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.apps.card.v1.Card parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.apps.card.v1.Card parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.apps.card.v1.Card parseFrom(com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.apps.card.v1.Card parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.apps.card.v1.Card prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* A card interface displayed in a Google Chat message or Google Workspace
* Add-on.
*
* Cards support a defined layout, interactive UI elements like buttons, and
* rich media like images. Use cards to present detailed information,
* gather information from users, and guide users to take a next step.
*
* [Card builder](https://addons.gsuite.google.com/uikit/builder)
*
* To learn how
* to build cards, see the following documentation:
*
* * For Google Chat apps, see [Design the components of a card or
* dialog](https://developers.google.com/workspace/chat/design-components-card-dialog).
* * For Google Workspace Add-ons, see [Card-based
* interfaces](https://developers.google.com/apps-script/add-ons/concepts/cards).
*
* **Example: Card message for a Google Chat app**
*
* ![Example contact
* card](https://developers.google.com/workspace/chat/images/card_api_reference.png)
*
* To create the sample card message in Google Chat, use the following JSON:
*
* ```
* {
* "cardsV2": [
* {
* "cardId": "unique-card-id",
* "card": {
* "header": {
* "title": "Sasha",
* "subtitle": "Software Engineer",
* "imageUrl":
* "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png",
* "imageType": "CIRCLE",
* "imageAltText": "Avatar for Sasha"
* },
* "sections": [
* {
* "header": "Contact Info",
* "collapsible": true,
* "uncollapsibleWidgetsCount": 1,
* "widgets": [
* {
* "decoratedText": {
* "startIcon": {
* "knownIcon": "EMAIL"
* },
* "text": "sasha@example.com"
* }
* },
* {
* "decoratedText": {
* "startIcon": {
* "knownIcon": "PERSON"
* },
* "text": "<font color=\"#80e27e\">Online</font>"
* }
* },
* {
* "decoratedText": {
* "startIcon": {
* "knownIcon": "PHONE"
* },
* "text": "+1 (555) 555-1234"
* }
* },
* {
* "buttonList": {
* "buttons": [
* {
* "text": "Share",
* "onClick": {
* "openLink": {
* "url": "https://example.com/share"
* }
* }
* },
* {
* "text": "Edit",
* "onClick": {
* "action": {
* "function": "goToView",
* "parameters": [
* {
* "key": "viewType",
* "value": "EDIT"
* }
* ]
* }
* }
* }
* ]
* }
* }
* ]
* }
* ]
* }
* }
* ]
* }
* ```
*
*
* Protobuf type {@code google.apps.card.v1.Card}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.apps.card.v1.Card)
com.google.apps.card.v1.CardOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.apps.card.v1.CardProto.internal_static_google_apps_card_v1_Card_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.apps.card.v1.CardProto
.internal_static_google_apps_card_v1_Card_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.apps.card.v1.Card.class, com.google.apps.card.v1.Card.Builder.class);
}
// Construct using com.google.apps.card.v1.Card.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
getHeaderFieldBuilder();
getSectionsFieldBuilder();
getCardActionsFieldBuilder();
getFixedFooterFieldBuilder();
getPeekCardHeaderFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
header_ = null;
if (headerBuilder_ != null) {
headerBuilder_.dispose();
headerBuilder_ = null;
}
if (sectionsBuilder_ == null) {
sections_ = java.util.Collections.emptyList();
} else {
sections_ = null;
sectionsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
sectionDividerStyle_ = 0;
if (cardActionsBuilder_ == null) {
cardActions_ = java.util.Collections.emptyList();
} else {
cardActions_ = null;
cardActionsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000008);
name_ = "";
fixedFooter_ = null;
if (fixedFooterBuilder_ != null) {
fixedFooterBuilder_.dispose();
fixedFooterBuilder_ = null;
}
displayStyle_ = 0;
peekCardHeader_ = null;
if (peekCardHeaderBuilder_ != null) {
peekCardHeaderBuilder_.dispose();
peekCardHeaderBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.apps.card.v1.CardProto.internal_static_google_apps_card_v1_Card_descriptor;
}
@java.lang.Override
public com.google.apps.card.v1.Card getDefaultInstanceForType() {
return com.google.apps.card.v1.Card.getDefaultInstance();
}
@java.lang.Override
public com.google.apps.card.v1.Card build() {
com.google.apps.card.v1.Card result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.apps.card.v1.Card buildPartial() {
com.google.apps.card.v1.Card result = new com.google.apps.card.v1.Card(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartialRepeatedFields(com.google.apps.card.v1.Card result) {
if (sectionsBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0)) {
sections_ = java.util.Collections.unmodifiableList(sections_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.sections_ = sections_;
} else {
result.sections_ = sectionsBuilder_.build();
}
if (cardActionsBuilder_ == null) {
if (((bitField0_ & 0x00000008) != 0)) {
cardActions_ = java.util.Collections.unmodifiableList(cardActions_);
bitField0_ = (bitField0_ & ~0x00000008);
}
result.cardActions_ = cardActions_;
} else {
result.cardActions_ = cardActionsBuilder_.build();
}
}
private void buildPartial0(com.google.apps.card.v1.Card result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.header_ = headerBuilder_ == null ? header_ : headerBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.sectionDividerStyle_ = sectionDividerStyle_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.name_ = name_;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.fixedFooter_ =
fixedFooterBuilder_ == null ? fixedFooter_ : fixedFooterBuilder_.build();
to_bitField0_ |= 0x00000002;
}
if (((from_bitField0_ & 0x00000040) != 0)) {
result.displayStyle_ = displayStyle_;
}
if (((from_bitField0_ & 0x00000080) != 0)) {
result.peekCardHeader_ =
peekCardHeaderBuilder_ == null ? peekCardHeader_ : peekCardHeaderBuilder_.build();
to_bitField0_ |= 0x00000004;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.apps.card.v1.Card) {
return mergeFrom((com.google.apps.card.v1.Card) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.apps.card.v1.Card other) {
if (other == com.google.apps.card.v1.Card.getDefaultInstance()) return this;
if (other.hasHeader()) {
mergeHeader(other.getHeader());
}
if (sectionsBuilder_ == null) {
if (!other.sections_.isEmpty()) {
if (sections_.isEmpty()) {
sections_ = other.sections_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureSectionsIsMutable();
sections_.addAll(other.sections_);
}
onChanged();
}
} else {
if (!other.sections_.isEmpty()) {
if (sectionsBuilder_.isEmpty()) {
sectionsBuilder_.dispose();
sectionsBuilder_ = null;
sections_ = other.sections_;
bitField0_ = (bitField0_ & ~0x00000002);
sectionsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getSectionsFieldBuilder()
: null;
} else {
sectionsBuilder_.addAllMessages(other.sections_);
}
}
}
if (other.sectionDividerStyle_ != 0) {
setSectionDividerStyleValue(other.getSectionDividerStyleValue());
}
if (cardActionsBuilder_ == null) {
if (!other.cardActions_.isEmpty()) {
if (cardActions_.isEmpty()) {
cardActions_ = other.cardActions_;
bitField0_ = (bitField0_ & ~0x00000008);
} else {
ensureCardActionsIsMutable();
cardActions_.addAll(other.cardActions_);
}
onChanged();
}
} else {
if (!other.cardActions_.isEmpty()) {
if (cardActionsBuilder_.isEmpty()) {
cardActionsBuilder_.dispose();
cardActionsBuilder_ = null;
cardActions_ = other.cardActions_;
bitField0_ = (bitField0_ & ~0x00000008);
cardActionsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getCardActionsFieldBuilder()
: null;
} else {
cardActionsBuilder_.addAllMessages(other.cardActions_);
}
}
}
if (!other.getName().isEmpty()) {
name_ = other.name_;
bitField0_ |= 0x00000010;
onChanged();
}
if (other.hasFixedFooter()) {
mergeFixedFooter(other.getFixedFooter());
}
if (other.displayStyle_ != 0) {
setDisplayStyleValue(other.getDisplayStyleValue());
}
if (other.hasPeekCardHeader()) {
mergePeekCardHeader(other.getPeekCardHeader());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
input.readMessage(getHeaderFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
com.google.apps.card.v1.Card.Section m =
input.readMessage(
com.google.apps.card.v1.Card.Section.parser(), extensionRegistry);
if (sectionsBuilder_ == null) {
ensureSectionsIsMutable();
sections_.add(m);
} else {
sectionsBuilder_.addMessage(m);
}
break;
} // case 18
case 26:
{
com.google.apps.card.v1.Card.CardAction m =
input.readMessage(
com.google.apps.card.v1.Card.CardAction.parser(), extensionRegistry);
if (cardActionsBuilder_ == null) {
ensureCardActionsIsMutable();
cardActions_.add(m);
} else {
cardActionsBuilder_.addMessage(m);
}
break;
} // case 26
case 34:
{
name_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000010;
break;
} // case 34
case 42:
{
input.readMessage(getFixedFooterFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000020;
break;
} // case 42
case 48:
{
displayStyle_ = input.readEnum();
bitField0_ |= 0x00000040;
break;
} // case 48
case 58:
{
input.readMessage(getPeekCardHeaderFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000080;
break;
} // case 58
case 72:
{
sectionDividerStyle_ = input.readEnum();
bitField0_ |= 0x00000004;
break;
} // case 72
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private com.google.apps.card.v1.Card.CardHeader header_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.apps.card.v1.Card.CardHeader,
com.google.apps.card.v1.Card.CardHeader.Builder,
com.google.apps.card.v1.Card.CardHeaderOrBuilder>
headerBuilder_;
/**
*
*
*
* The header of the card. A header usually contains a leading image and a
* title. Headers always appear at the top of a card.
*
*
* .google.apps.card.v1.Card.CardHeader header = 1;
*
* @return Whether the header field is set.
*/
public boolean hasHeader() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*
*
* The header of the card. A header usually contains a leading image and a
* title. Headers always appear at the top of a card.
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
*
* repeated .google.apps.card.v1.Card.Section sections = 2;
*/
public int getSectionsCount() {
if (sectionsBuilder_ == null) {
return sections_.size();
} else {
return sectionsBuilder_.getCount();
}
}
/**
*
*
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
* Contains a collection of widgets. Each section has its own, optional
* header. Sections are visually separated by a line divider. For an example
* in Google Chat apps, see [Define a section of a
* card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
*
*
* .google.apps.card.v1.Card.DividerStyle section_divider_style = 9;
*
* @return The enum numeric value on the wire for sectionDividerStyle.
*/
@java.lang.Override
public int getSectionDividerStyleValue() {
return sectionDividerStyle_;
}
/**
*
*
*
* The divider style between sections.
*
*
* .google.apps.card.v1.Card.DividerStyle section_divider_style = 9;
*
* @param value The enum numeric value on the wire for sectionDividerStyle to set.
* @return This builder for chaining.
*/
public Builder setSectionDividerStyleValue(int value) {
sectionDividerStyle_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* The divider style between sections.
*
*
* .google.apps.card.v1.Card.DividerStyle section_divider_style = 9;
*
* @return The sectionDividerStyle.
*/
@java.lang.Override
public com.google.apps.card.v1.Card.DividerStyle getSectionDividerStyle() {
com.google.apps.card.v1.Card.DividerStyle result =
com.google.apps.card.v1.Card.DividerStyle.forNumber(sectionDividerStyle_);
return result == null ? com.google.apps.card.v1.Card.DividerStyle.UNRECOGNIZED : result;
}
/**
*
*
*
* The divider style between sections.
*
*
* .google.apps.card.v1.Card.DividerStyle section_divider_style = 9;
*
* @param value The sectionDividerStyle to set.
* @return This builder for chaining.
*/
public Builder setSectionDividerStyle(com.google.apps.card.v1.Card.DividerStyle value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
sectionDividerStyle_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
*
* Name of the card. Used as a card identifier in card navigation.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
*
* string name = 4;
*
* @return The bytes for name.
*/
public com.google.protobuf.ByteString getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Name of the card. Used as a card identifier in card navigation.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
*
* string name = 4;
*
* @param value The name to set.
* @return This builder for chaining.
*/
public Builder setName(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
*
* Name of the card. Used as a card identifier in card navigation.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
*
* string name = 4;
*
* @return This builder for chaining.
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
bitField0_ = (bitField0_ & ~0x00000010);
onChanged();
return this;
}
/**
*
*
*
* Name of the card. Used as a card identifier in card navigation.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
*
* string name = 4;
*
* @param value The bytes for name to set.
* @return This builder for chaining.
*/
public Builder setNameBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
private com.google.apps.card.v1.Card.CardFixedFooter fixedFooter_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.apps.card.v1.Card.CardFixedFooter,
com.google.apps.card.v1.Card.CardFixedFooter.Builder,
com.google.apps.card.v1.Card.CardFixedFooterOrBuilder>
fixedFooterBuilder_;
/**
*
*
*
* The fixed footer shown at the bottom of this card.
*
* Setting `fixedFooter` without specifying a `primaryButton` or a
* `secondaryButton` causes an error. For Chat apps, you can use fixed footers
* in
* [dialogs](https://developers.google.com/workspace/chat/dialogs), but not
* [card
* messages](https://developers.google.com/workspace/chat/create-messages#create).
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
*
* .google.apps.card.v1.Card.CardFixedFooter fixed_footer = 5;
*
* @return Whether the fixedFooter field is set.
*/
public boolean hasFixedFooter() {
return ((bitField0_ & 0x00000020) != 0);
}
/**
*
*
*
* The fixed footer shown at the bottom of this card.
*
* Setting `fixedFooter` without specifying a `primaryButton` or a
* `secondaryButton` causes an error. For Chat apps, you can use fixed footers
* in
* [dialogs](https://developers.google.com/workspace/chat/dialogs), but not
* [card
* messages](https://developers.google.com/workspace/chat/create-messages#create).
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
* The fixed footer shown at the bottom of this card.
*
* Setting `fixedFooter` without specifying a `primaryButton` or a
* `secondaryButton` causes an error. For Chat apps, you can use fixed footers
* in
* [dialogs](https://developers.google.com/workspace/chat/dialogs), but not
* [card
* messages](https://developers.google.com/workspace/chat/create-messages#create).
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
* The fixed footer shown at the bottom of this card.
*
* Setting `fixedFooter` without specifying a `primaryButton` or a
* `secondaryButton` causes an error. For Chat apps, you can use fixed footers
* in
* [dialogs](https://developers.google.com/workspace/chat/dialogs), but not
* [card
* messages](https://developers.google.com/workspace/chat/create-messages#create).
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
* The fixed footer shown at the bottom of this card.
*
* Setting `fixedFooter` without specifying a `primaryButton` or a
* `secondaryButton` causes an error. For Chat apps, you can use fixed footers
* in
* [dialogs](https://developers.google.com/workspace/chat/dialogs), but not
* [card
* messages](https://developers.google.com/workspace/chat/create-messages#create).
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
* The fixed footer shown at the bottom of this card.
*
* Setting `fixedFooter` without specifying a `primaryButton` or a
* `secondaryButton` causes an error. For Chat apps, you can use fixed footers
* in
* [dialogs](https://developers.google.com/workspace/chat/dialogs), but not
* [card
* messages](https://developers.google.com/workspace/chat/create-messages#create).
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
* The fixed footer shown at the bottom of this card.
*
* Setting `fixedFooter` without specifying a `primaryButton` or a
* `secondaryButton` causes an error. For Chat apps, you can use fixed footers
* in
* [dialogs](https://developers.google.com/workspace/chat/dialogs), but not
* [card
* messages](https://developers.google.com/workspace/chat/create-messages#create).
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
* The fixed footer shown at the bottom of this card.
*
* Setting `fixedFooter` without specifying a `primaryButton` or a
* `secondaryButton` causes an error. For Chat apps, you can use fixed footers
* in
* [dialogs](https://developers.google.com/workspace/chat/dialogs), but not
* [card
* messages](https://developers.google.com/workspace/chat/create-messages#create).
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
* The fixed footer shown at the bottom of this card.
*
* Setting `fixedFooter` without specifying a `primaryButton` or a
* `secondaryButton` causes an error. For Chat apps, you can use fixed footers
* in
* [dialogs](https://developers.google.com/workspace/chat/dialogs), but not
* [card
* messages](https://developers.google.com/workspace/chat/create-messages#create).
*
* [Google Workspace Add-ons and Chat
* apps](https://developers.google.com/workspace/extend):
*
* In Google Workspace Add-ons, sets the display properties of the
* `peekCardHeader`.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
*
* .google.apps.card.v1.Card.DisplayStyle display_style = 6;
*
* @return The enum numeric value on the wire for displayStyle.
*/
@java.lang.Override
public int getDisplayStyleValue() {
return displayStyle_;
}
/**
*
*
*
* In Google Workspace Add-ons, sets the display properties of the
* `peekCardHeader`.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
*
* .google.apps.card.v1.Card.DisplayStyle display_style = 6;
*
* @param value The enum numeric value on the wire for displayStyle to set.
* @return This builder for chaining.
*/
public Builder setDisplayStyleValue(int value) {
displayStyle_ = value;
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
*
* In Google Workspace Add-ons, sets the display properties of the
* `peekCardHeader`.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
*
* .google.apps.card.v1.Card.DisplayStyle display_style = 6;
*
* @return The displayStyle.
*/
@java.lang.Override
public com.google.apps.card.v1.Card.DisplayStyle getDisplayStyle() {
com.google.apps.card.v1.Card.DisplayStyle result =
com.google.apps.card.v1.Card.DisplayStyle.forNumber(displayStyle_);
return result == null ? com.google.apps.card.v1.Card.DisplayStyle.UNRECOGNIZED : result;
}
/**
*
*
*
* In Google Workspace Add-ons, sets the display properties of the
* `peekCardHeader`.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
*
* .google.apps.card.v1.Card.DisplayStyle display_style = 6;
*
* @param value The displayStyle to set.
* @return This builder for chaining.
*/
public Builder setDisplayStyle(com.google.apps.card.v1.Card.DisplayStyle value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000040;
displayStyle_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
*
* In Google Workspace Add-ons, sets the display properties of the
* `peekCardHeader`.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
* When displaying contextual content, the peek card header acts as a
* placeholder so that the user can navigate forward between the homepage
* cards and the contextual cards.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
*
* .google.apps.card.v1.Card.CardHeader peek_card_header = 7;
*
* @return Whether the peekCardHeader field is set.
*/
public boolean hasPeekCardHeader() {
return ((bitField0_ & 0x00000080) != 0);
}
/**
*
*
*
* When displaying contextual content, the peek card header acts as a
* placeholder so that the user can navigate forward between the homepage
* cards and the contextual cards.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
* When displaying contextual content, the peek card header acts as a
* placeholder so that the user can navigate forward between the homepage
* cards and the contextual cards.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
* When displaying contextual content, the peek card header acts as a
* placeholder so that the user can navigate forward between the homepage
* cards and the contextual cards.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
* When displaying contextual content, the peek card header acts as a
* placeholder so that the user can navigate forward between the homepage
* cards and the contextual cards.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
* When displaying contextual content, the peek card header acts as a
* placeholder so that the user can navigate forward between the homepage
* cards and the contextual cards.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
* When displaying contextual content, the peek card header acts as a
* placeholder so that the user can navigate forward between the homepage
* cards and the contextual cards.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
* When displaying contextual content, the peek card header acts as a
* placeholder so that the user can navigate forward between the homepage
* cards and the contextual cards.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
* When displaying contextual content, the peek card header acts as a
* placeholder so that the user can navigate forward between the homepage
* cards and the contextual cards.
*
* [Google Workspace
* Add-ons](https://developers.google.com/workspace/add-ons):
*
*
* .google.apps.card.v1.Card.CardHeader peek_card_header = 7;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.apps.card.v1.Card.CardHeader,
com.google.apps.card.v1.Card.CardHeader.Builder,
com.google.apps.card.v1.Card.CardHeaderOrBuilder>
getPeekCardHeaderFieldBuilder() {
if (peekCardHeaderBuilder_ == null) {
peekCardHeaderBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.apps.card.v1.Card.CardHeader,
com.google.apps.card.v1.Card.CardHeader.Builder,
com.google.apps.card.v1.Card.CardHeaderOrBuilder>(
getPeekCardHeader(), getParentForChildren(), isClean());
peekCardHeader_ = null;
}
return peekCardHeaderBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.apps.card.v1.Card)
}
// @@protoc_insertion_point(class_scope:google.apps.card.v1.Card)
private static final com.google.apps.card.v1.Card DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.apps.card.v1.Card();
}
public static com.google.apps.card.v1.Card getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Card parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.apps.card.v1.Card getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}