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 = "", 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 icon and text are set, then the icon appears before the text.

color

Optional. The color of the button. If set, the button type is set to FILLED and the color of text and icon fields 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 the red, green, and blue fields. The value must be a float number between 0 and 1 based on the RGB color value, where 0 (0/255) represents the absence of color and 1 (255/255) represents the maximum intensity of the color. For example, the following sets the color to red at its maximum intensity: "color": { "red": 1, "green": 0, "blue": 0, } The alpha field 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 the color field is set, the button type is forced to FILLED and any value set for this field is ignored.

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 = "", 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 icon and text are set, then the icon appears before the text.

    color

    Optional. The color of the button. If set, the button type is set to FILLED and the color of text and icon fields 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 the red, green, and blue fields. The value must be a float number between 0 and 1 based on the RGB color value, where 0 (0/255) represents the absence of color and 1 (255/255) represents the maximum intensity of the color. For example, the following sets the color to red at its maximum intensity: "color": { "red": 1, "green": 0, "blue": 0, } The alpha field 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 the color field is set, the button type is forced to FILLED and any value set for this field is ignored.

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]) @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. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def getColor: Color
  18. def getField(__field: FieldDescriptor): PValue
    Definition Classes
    Button → GeneratedMessage
  19. def getFieldByNumber(__fieldNumber: Int): Any
    Definition Classes
    Button → GeneratedMessage
  20. def getIcon: Icon
  21. def getOnClick: OnClick
  22. val icon: Option[Icon]
  23. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  24. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. val onClick: Option[OnClick]
  28. def productElementNames: Iterator[String]
    Definition Classes
    Product
  29. def serializedSize: Int
    Definition Classes
    Button → GeneratedMessage
  30. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  31. val text: String
  32. final def toByteArray: Array[Byte]
    Definition Classes
    GeneratedMessage
  33. final def toByteString: ByteString
    Definition Classes
    GeneratedMessage
  34. final def toPMessage: PMessage
    Definition Classes
    GeneratedMessage
  35. def toProtoString: String
    Definition Classes
    Button → GeneratedMessage
  36. val type: Type
  37. val unknownFields: UnknownFieldSet
  38. def update(ms: (Lens[Button, Button]) => Mutation[Button]*): Button
    Definition Classes
    Updatable
  39. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  40. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  41. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  42. def withAltText(__v: String): Button
  43. def withColor(__v: Color): Button
  44. def withDisabled(__v: Boolean): Button
  45. def withIcon(__v: Icon): Button
  46. def withOnClick(__v: OnClick): Button
  47. def withText(__v: String): Button
  48. def withType(__v: Type): Button
  49. def withUnknownFields(__v: UnknownFieldSet): Button
  50. final def writeDelimitedTo(output: OutputStream): Unit
    Definition Classes
    GeneratedMessage
  51. def writeTo(_output__: CodedOutputStream): Unit
    Definition Classes
    Button → GeneratedMessage
  52. final def writeTo(output: OutputStream): Unit
    Definition Classes
    GeneratedMessage

Inherited from Updatable[Button]

Inherited from GeneratedMessage

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped