Class: Google::Apis::ChatV1::GoogleAppsCardV1SwitchControl

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

Either a toggle-style switch or a checkbox.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleAppsCardV1SwitchControl

Returns a new instance of GoogleAppsCardV1SwitchControl.



2050
2051
2052
# File 'lib/google/apis/chat_v1/classes.rb', line 2050

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

Instance Attribute Details

#control_typeString

The control type, either switch or checkbox. Corresponds to the JSON property controlType

Returns:

  • (String)


2026
2027
2028
# File 'lib/google/apis/chat_v1/classes.rb', line 2026

def control_type
  @control_type
end

#nameString

The name of the switch widget that's used in formInput. Corresponds to the JSON property name

Returns:

  • (String)


2031
2032
2033
# File 'lib/google/apis/chat_v1/classes.rb', line 2031

def name
  @name
end

#on_change_actionGoogle::Apis::ChatV1::GoogleAppsCardV1Action

An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. Corresponds to the JSON property onChangeAction



2037
2038
2039
# File 'lib/google/apis/chat_v1/classes.rb', line 2037

def on_change_action
  @on_change_action
end

#selectedBoolean Also known as: selected?

If the switch is selected. Corresponds to the JSON property selected

Returns:

  • (Boolean)


2042
2043
2044
# File 'lib/google/apis/chat_v1/classes.rb', line 2042

def selected
  @selected
end

#valueString

The value is what is passed back in the callback. Corresponds to the JSON property value

Returns:

  • (String)


2048
2049
2050
# File 'lib/google/apis/chat_v1/classes.rb', line 2048

def value
  @value
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2055
2056
2057
2058
2059
2060
2061
# File 'lib/google/apis/chat_v1/classes.rb', line 2055

def update!(**args)
  @control_type = args[:control_type] if args.key?(:control_type)
  @name = args[:name] if args.key?(:name)
  @on_change_action = args[:on_change_action] if args.key?(:on_change_action)
  @selected = args[:selected] if args.key?(:selected)
  @value = args[:value] if args.key?(:value)
end