final case class Button(text: String = "", icon: Option[Icon] = _root_.scala.None, color: Option[Color] = _root_.scala.None, onClick: Option[OnClick] = _root_.scala.None, disabled: Boolean = false, altText: String = "", unknownFields: UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty) extends GeneratedMessage with Updatable[Button] with Product with Serializable
A text, icon, or text and icon button that users can click. For an example in Google Chat apps, see [Add a button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button).
To make an image a clickable button, specify an
[Image
][google.apps.card.v1.Image] (not an
[ImageComponent
][google.apps.card.v1.ImageComponent]) and set an
onClick
action.
[Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend):
- text
The text displayed inside the button.
- icon
The icon image. If both
icon
andtext
are set, then the icon appears before the text.- color
If set, the button is filled with a solid background color and the font color changes to maintain contrast with the background color. For example, setting a blue background likely results in white text. If unset, the image background is white and the font color is blue. For red, green, and blue, the value of each field is a
float
number that you can express in either of two ways: as a number between 0 and 255 divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents the absence of a color and 1 or 255/255 represent the full presence of that color on the RGB scale. Optionally setalpha
, which sets a level of transparency using this equation:
Forpixel color = alpha * (this color) + (1.0 - alpha) * (background color)
alpha
, a value of1
corresponds with a solid color, and a value of0
corresponds with a completely transparent color. For example, the following color represents a half transparent red:"color": { "red": 1, "green": 0, "blue": 0, "alpha": 0.5 }
- onClick
Required. The action to perform when a user clicks the button, such as opening a hyperlink or running a custom function.
- disabled
If
true
, the button is displayed in an inactive state and doesn't respond to user actions.- altText
The alternative text that's used for accessibility. Set descriptive text that lets users know what the button does. For example, if a button opens a hyperlink, you might write: "Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/workspace/chat".
- Annotations
- @SerialVersionUID()
- Source
- Button.scala
- Alphabetic
- By Inheritance
- Button
- Updatable
- GeneratedMessage
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Button(text: String = "", icon: Option[Icon] = _root_.scala.None, color: Option[Color] = _root_.scala.None, onClick: Option[OnClick] = _root_.scala.None, disabled: Boolean = false, altText: String = "", unknownFields: UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty)
- text
The text displayed inside the button.
- icon
The icon image. If both
icon
andtext
are set, then the icon appears before the text.- color
If set, the button is filled with a solid background color and the font color changes to maintain contrast with the background color. For example, setting a blue background likely results in white text. If unset, the image background is white and the font color is blue. For red, green, and blue, the value of each field is a
float
number that you can express in either of two ways: as a number between 0 and 255 divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents the absence of a color and 1 or 255/255 represent the full presence of that color on the RGB scale. Optionally setalpha
, which sets a level of transparency using this equation:
Forpixel color = alpha * (this color) + (1.0 - alpha) * (background color)
alpha
, a value of1
corresponds with a solid color, and a value of0
corresponds with a completely transparent color. For example, the following color represents a half transparent red:"color": { "red": 1, "green": 0, "blue": 0, "alpha": 0.5 }
- onClick
Required. The action to perform when a user clicks the button, such as opening a hyperlink or running a custom function.
- disabled
If
true
, the button is displayed in an inactive state and doesn't respond to user actions.- altText
The alternative text that's used for accessibility. Set descriptive text that lets users know what the button does. For example, if a button opens a hyperlink, you might write: "Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/workspace/chat".
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val altText: String
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clearColor: Button
- def clearIcon: Button
- def clearOnClick: Button
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- val color: Option[Color]
- def companion: Button.type
- Definition Classes
- Button → GeneratedMessage
- val disabled: Boolean
- def discardUnknownFields: Button
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def getColor: Color
- def getField(__field: FieldDescriptor): PValue
- Definition Classes
- Button → GeneratedMessage
- def getFieldByNumber(__fieldNumber: Int): Any
- Definition Classes
- Button → GeneratedMessage
- def getIcon: Icon
- def getOnClick: OnClick
- val icon: Option[Icon]
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- val onClick: Option[OnClick]
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def serializedSize: Int
- Definition Classes
- Button → GeneratedMessage
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- val text: String
- final def toByteArray: Array[Byte]
- Definition Classes
- GeneratedMessage
- final def toByteString: ByteString
- Definition Classes
- GeneratedMessage
- final def toPMessage: PMessage
- Definition Classes
- GeneratedMessage
- def toProtoString: String
- Definition Classes
- Button → GeneratedMessage
- val unknownFields: UnknownFieldSet
- def update(ms: (Lens[Button, Button]) => Mutation[Button]*): Button
- Definition Classes
- Updatable
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withAltText(__v: String): Button
- def withColor(__v: Color): Button
- def withDisabled(__v: Boolean): Button
- def withIcon(__v: Icon): Button
- def withOnClick(__v: OnClick): Button
- def withText(__v: String): Button
- def withUnknownFields(__v: UnknownFieldSet): Button
- final def writeDelimitedTo(output: OutputStream): Unit
- Definition Classes
- GeneratedMessage
- def writeTo(_output__: CodedOutputStream): Unit
- Definition Classes
- Button → GeneratedMessage
- final def writeTo(output: OutputStream): Unit
- Definition Classes
- GeneratedMessage