A valueMetadata contains information about the potential values of a variable.
Only available for Google Workspace add-ons that extend Google Workspace Studio.
Sample usage:
let allowedValue1 = "001" ; let allowedValue2 = "002" ; const valueMetadata = AddOnsResponseService . newValueMetadata () . addEnumValue ( allowedValue1 ); . addEnumValue ( allowedValue2 ) . setDefaultValue ( allowedValue1 ) . addCastableType ( AddOnsResponseService . BasicDataType . STRING ) . addCastableType ( AddOnsResponseService . BasicDataType . INTEGER );
Methods
| Method | Return type | Brief description |
|---|---|---|
Value
|
Adds a optional allowed types that can be dynamically casted for a variable data to this value metadata. | |
Value
|
Adds an optional string value to the allowed enum values of a variable, this field can only be
set if the Data
is set to String type. |
|
Value
|
Sets the optional default value of the variable, example, if the variable type is boolean,
defaultValue may be set to " true
" or " false
". |
Detailed documentation
add
Castable
Type(dataType)
Adds a optional allowed types that can be dynamically casted for a variable data to this value metadata.
Parameters
| Name | Type | Description |
|---|---|---|
data
|
Basic
|
A Basic
the variable can be casted to. |
Return
Value
— This value metadata object, for chaining.
add
Enum
Value(enumValue)
Adds an optional string value to the allowed enum values of a variable, this field can only be
set if the Data
is set to String type.
Parameters
| Name | Type | Description |
|---|---|---|
enum
|
String
|
The allowed value to add to the enumeration. |
Return
Value
— This value metadata object, for chaining.
set
Default
Value(defaultValue)
Sets the optional default value of the variable, example, if the variable type is boolean,
defaultValue may be set to " true
" or " false
".
Parameters
| Name | Type | Description |
|---|---|---|
default
|
String
|
The default value of the variable. |
Return
Value
— This value metadata object, for chaining.

