ValueMetadata

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:

```javascript
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 |
|---|---|---|
| `https://developers.google.com/apps-script/reference/add-ons-response-service/value-metadata#addCastableType(BasicDataType)` | `https://developers.google.com/apps-script/reference/add-ons-response-service/value-metadata#` | Adds a optional allowed types that can be dynamically casted for a variable data to this value metadata. |
| `https://developers.google.com/apps-script/reference/add-ons-response-service/value-metadata#addEnumValue(String)` | `https://developers.google.com/apps-script/reference/add-ons-response-service/value-metadata#` | Adds an optional string value to the allowed enum values of a variable, this field can only be set if the `https://developers.google.com/apps-script/reference/add-ons-response-service/data-type` is set to String type. |
| `https://developers.google.com/apps-script/reference/add-ons-response-service/value-metadata#setDefaultValue(String)` | `https://developers.google.com/apps-script/reference/add-ons-response-service/value-metadata#` | 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

### `addCastableType(dataType)`

Adds a optional allowed types that can be dynamically casted for a variable data to this value
metadata.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `dataType` | `https://developers.google.com/apps-script/reference/add-ons-response-service/basic-data-type` | A `https://developers.google.com/apps-script/reference/add-ons-response-service/basic-data-type` the variable can be casted to. |

#### Return


`https://developers.google.com/apps-script/reference/add-ons-response-service/value-metadata#` --- This value metadata object, for chaining.

*** ** * ** ***

### `addEnumValue(enumValue)`

Adds an optional string value to the allowed enum values of a variable, this field can only be
set if the `https://developers.google.com/apps-script/reference/add-ons-response-service/data-type` is set to String type.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `enumValue` | `String` | The allowed value to add to the enumeration. |

#### Return


`https://developers.google.com/apps-script/reference/add-ons-response-service/value-metadata#` --- This value metadata object, for chaining.

*** ** * ** ***

### `setDefaultValue(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 |
|---|---|---|
| `defaultValue` | `String` | The default value of the variable. |

#### Return


`https://developers.google.com/apps-script/reference/add-ons-response-service/value-metadata#` --- This value metadata object, for chaining.