Google Apps Chat V1 Client - Class SwitchControl (0.2.0)

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 \ DecoratedText

Methods

__construct

Constructor.

Parameters
Name Description
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 int

How the switch appears in the user interface. Google Workspace Add-ons and Chat apps:

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.

Returns
Type Description
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.

Parameter
Name Description
var string
Returns
Type Description
$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.

Returns
Type Description
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.

Parameter
Name Description
var string
Returns
Type Description
$this

getSelected

When true, the switch is selected.

Returns
Type Description
bool

setSelected

When true, the switch is selected.

Parameter
Name Description
var bool
Returns
Type Description
$this

getOnChangeAction

The action to perform when the switch state is changed, such as what function to run.

Returns
Type Description
Google\Apps\Card\V1\Action|null

hasOnChangeAction

clearOnChangeAction

setOnChangeAction

The action to perform when the switch state is changed, such as what function to run.

Parameter
Name Description
var Google\Apps\Card\V1\Action
Returns
Type Description
$this

getControlType

How the switch appears in the user interface.

Google Workspace Add-ons and Chat apps:

Returns
Type Description
int

setControlType

How the switch appears in the user interface.

Google Workspace Add-ons and Chat apps:

Parameter
Name Description
var int
Returns
Type Description
$this