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 = "", type: Type = com.google.apps.card.v1.card.Button.Type.TYPE_UNSPECIFIED, 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
An icon displayed inside the button. If both
iconandtextare set, then the icon appears before the text.- color
Optional. The color of the button. If set, the button
typeis set toFILLEDand the color oftextandiconfields are set to a contrasting color for readability. For example, if the button color is set to blue, any text or icons in the button are set to white. To set the button color, specify a value for thered,green, andbluefields. The value must be a float number between 0 and 1 based on the RGB color value, where0(0/255) represents the absence of color and1(255/255) represents the maximum intensity of the color. For example, the following sets the color to red at its maximum intensity:The"color": { "red": 1, "green": 0, "blue": 0, }alphafield is unavailable for button color. If specified, this field is ignored.- 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".
- type
Optional. The type of a button. If unset, button type defaults to
OUTLINED. If thecolorfield is set, the button type is forced toFILLEDand any value set for this field is ignored.
- 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 = "", type: Type = com.google.apps.card.v1.card.Button.Type.TYPE_UNSPECIFIED, unknownFields: UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty)
- text
The text displayed inside the button.
- icon
An icon displayed inside the button. If both
iconandtextare set, then the icon appears before the text.- color
Optional. The color of the button. If set, the button
typeis set toFILLEDand the color oftextandiconfields are set to a contrasting color for readability. For example, if the button color is set to blue, any text or icons in the button are set to white. To set the button color, specify a value for thered,green, andbluefields. The value must be a float number between 0 and 1 based on the RGB color value, where0(0/255) represents the absence of color and1(255/255) represents the maximum intensity of the color. For example, the following sets the color to red at its maximum intensity:The"color": { "red": 1, "green": 0, "blue": 0, }alphafield is unavailable for button color. If specified, this field is ignored.- 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".
- type
Optional. The type of a button. If unset, button type defaults to
OUTLINED. If thecolorfield is set, the button type is forced toFILLEDand any value set for this field is ignored.
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]) @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
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @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
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @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 type: Type
- val unknownFields: UnknownFieldSet
- def update(ms: (Lens[Button, Button]) => Mutation[Button]*): Button
- Definition Classes
- Updatable
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- 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()
- 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 withType(__v: Type): 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