Class: Google::Apis::ChatV1::GoogleAppsCardV1DecoratedText

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/chat_v1/classes.rb,
lib/google/apis/chat_v1/representations.rb,
lib/google/apis/chat_v1/representations.rb

Overview

A widget that displays text with optional decorations such as a label above or below the text, an icon in front of the text, a selection widget, or a button after the text. For an example in Google Chat apps, see Decorated text.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleAppsCardV1DecoratedText

Returns a new instance of GoogleAppsCardV1DecoratedText.



1813
1814
1815
# File 'lib/google/apis/chat_v1/classes.rb', line 1813

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#bottom_labelString

The text that appears below text. Always wraps. Corresponds to the JSON property bottomLabel

Returns:

  • (String)


1745
1746
1747
# File 'lib/google/apis/chat_v1/classes.rb', line 1745

def bottom_label
  @bottom_label
end

#buttonGoogle::Apis::ChatV1::GoogleAppsCardV1Button

A text, icon, or text and icon button that users can click. For an example in Google Chat apps, see Button list. To make an image a clickable button, specify an Image ( not an ImageComponent) and set an onClick action. Corresponds to the JSON property button



1753
1754
1755
# File 'lib/google/apis/chat_v1/classes.rb', line 1753

def button
  @button
end

#end_iconGoogle::Apis::ChatV1::GoogleAppsCardV1Icon

An icon displayed in a widget on a card. For an example in Google Chat apps, see Icon. Supports built-in and custom icons. Corresponds to the JSON property endIcon



1761
1762
1763
# File 'lib/google/apis/chat_v1/classes.rb', line 1761

def end_icon
  @end_icon
end

#iconGoogle::Apis::ChatV1::GoogleAppsCardV1Icon

An icon displayed in a widget on a card. For an example in Google Chat apps, see Icon. Supports built-in and custom icons. Corresponds to the JSON property icon



1769
1770
1771
# File 'lib/google/apis/chat_v1/classes.rb', line 1769

def icon
  @icon
end

#on_clickGoogle::Apis::ChatV1::GoogleAppsCardV1OnClick

Represents how to respond when users click an interactive element on a card, such as a button. Corresponds to the JSON property onClick



1775
1776
1777
# File 'lib/google/apis/chat_v1/classes.rb', line 1775

def on_click
  @on_click
end

#start_iconGoogle::Apis::ChatV1::GoogleAppsCardV1Icon

An icon displayed in a widget on a card. For an example in Google Chat apps, see Icon. Supports built-in and custom icons. Corresponds to the JSON property startIcon



1783
1784
1785
# File 'lib/google/apis/chat_v1/classes.rb', line 1783

def start_icon
  @start_icon
end

#switch_controlGoogle::Apis::ChatV1::GoogleAppsCardV1SwitchControl

Either a toggle-style switch or a checkbox inside a decoratedText widget. Only supported in the decoratedText widget. Corresponds to the JSON property switchControl



1789
1790
1791
# File 'lib/google/apis/chat_v1/classes.rb', line 1789

def switch_control
  @switch_control
end

#textString

Required. The primary text. Supports simple formatting. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons. Corresponds to the JSON property text

Returns:

  • (String)


1798
1799
1800
# File 'lib/google/apis/chat_v1/classes.rb', line 1798

def text
  @text
end

#top_labelString

The text that appears above text. Always truncates. Corresponds to the JSON property topLabel

Returns:

  • (String)


1803
1804
1805
# File 'lib/google/apis/chat_v1/classes.rb', line 1803

def top_label
  @top_label
end

#wrap_textBoolean Also known as: wrap_text?

The wrap text setting. If true, the text wraps and displays on multiple lines. Otherwise, the text is truncated. Only applies to text, not topLabel and bottomLabel. Corresponds to the JSON property wrapText

Returns:

  • (Boolean)


1810
1811
1812
# File 'lib/google/apis/chat_v1/classes.rb', line 1810

def wrap_text
  @wrap_text
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
# File 'lib/google/apis/chat_v1/classes.rb', line 1818

def update!(**args)
  @bottom_label = args[:bottom_label] if args.key?(:bottom_label)
  @button = args[:button] if args.key?(:button)
  @end_icon = args[:end_icon] if args.key?(:end_icon)
  @icon = args[:icon] if args.key?(:icon)
  @on_click = args[:on_click] if args.key?(:on_click)
  @start_icon = args[:start_icon] if args.key?(:start_icon)
  @switch_control = args[:switch_control] if args.key?(:switch_control)
  @text = args[:text] if args.key?(:text)
  @top_label = args[:top_label] if args.key?(:top_label)
  @wrap_text = args[:wrap_text] if args.key?(:wrap_text)
end