Reference documentation and code samples for the Google Apps Chat V1 Client class SwitchControl.
Either a toggle-style switch or a checkbox inside a decoratedText
widget.
Google Workspace Add-ons and Chat
apps
:
Only supported in the decoratedText
widget.
Generated from protobuf message google.apps.card.v1.DecoratedText.SwitchControl
Namespace
Google \ Apps \ Card \ V1 \ DecoratedTextMethods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ name
string
The name by which the switch widget is identified in a form input event. For details about working with form inputs, see Receive form data .
↳ value
string
The value entered by a user, returned as part of a form input event. For details about working with form inputs, see Receive form data .
↳ selected
bool
When true
, the switch is selected.
↳ on_change_action
Google\Apps\Card\V1\Action
The action to perform when the switch state is changed, such as what function to run.
↳ control_type
getName
The name by which the switch widget is identified in a form input event.
For details about working with form inputs, see Receive form data .
string
setName
The name by which the switch widget is identified in a form input event.
For details about working with form inputs, see Receive form data .
var
string
$this
getValue
The value entered by a user, returned as part of a form input event.
For details about working with form inputs, see Receive form data .
string
setValue
The value entered by a user, returned as part of a form input event.
For details about working with form inputs, see Receive form data .
var
string
$this
getSelected
When true
, the switch is selected.
bool
setSelected
When true
, the switch is selected.
var
bool
$this
getOnChangeAction
The action to perform when the switch state is changed, such as what function to run.
hasOnChangeAction
clearOnChangeAction
setOnChangeAction
The action to perform when the switch state is changed, such as what function to run.
$this
getControlType
How the switch appears in the user interface.
int
setControlType
How the switch appears in the user interface.
var
int
$this