Packages

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 and text 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 set alpha, which sets a level of transparency using this equation: pixel color = alpha * (this color) + (1.0 - alpha) * (background color) For alpha, a value of 1 corresponds with a solid color, and a value of 0 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
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Button
  2. Updatable
  3. GeneratedMessage
  4. Serializable
  5. Product
  6. Equals
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. 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 and text 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 set alpha, which sets a level of transparency using this equation: pixel color = alpha * (this color) + (1.0 - alpha) * (background color) For alpha, a value of 1 corresponds with a solid color, and a value of 0 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

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val altText: String
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clearColor: Button
  7. def clearIcon: Button
  8. def clearOnClick: Button
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  10. val color: Option[Color]
  11. def companion: Button.type
    Definition Classes
    Button → GeneratedMessage
  12. val disabled: Boolean
  13. def discardUnknownFields: Button
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  16. def getColor: Color
  17. def getField(__field: FieldDescriptor): PValue
    Definition Classes
    Button → GeneratedMessage
  18. def getFieldByNumber(__fieldNumber: Int): Any
    Definition Classes
    Button → GeneratedMessage
  19. def getIcon: Icon
  20. def getOnClick: OnClick
  21. val icon: Option[Icon]
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  26. val onClick: Option[OnClick]
  27. def productElementNames: Iterator[String]
    Definition Classes
    Product
  28. def serializedSize: Int
    Definition Classes
    Button → GeneratedMessage
  29. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  30. val text: String
  31. final def toByteArray: Array[Byte]
    Definition Classes
    GeneratedMessage
  32. final def toByteString: ByteString
    Definition Classes
    GeneratedMessage
  33. final def toPMessage: PMessage
    Definition Classes
    GeneratedMessage
  34. def toProtoString: String
    Definition Classes
    Button → GeneratedMessage
  35. val unknownFields: UnknownFieldSet
  36. def update(ms: (Lens[Button, Button]) => Mutation[Button]*): Button
    Definition Classes
    Updatable
  37. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  38. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  39. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  40. def withAltText(__v: String): Button
  41. def withColor(__v: Color): Button
  42. def withDisabled(__v: Boolean): Button
  43. def withIcon(__v: Icon): Button
  44. def withOnClick(__v: OnClick): Button
  45. def withText(__v: String): Button
  46. def withUnknownFields(__v: UnknownFieldSet): Button
  47. final def writeDelimitedTo(output: OutputStream): Unit
    Definition Classes
    GeneratedMessage
  48. def writeTo(_output__: CodedOutputStream): Unit
    Definition Classes
    Button → GeneratedMessage
  49. final def writeTo(output: OutputStream): Unit
    Definition Classes
    GeneratedMessage

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Updatable[Button]

Inherited from GeneratedMessage

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped