ResourceData

Represents a application specific resource data, a resource data contains a collection of
key-value pairs of variable names and `https://developers.google.com/apps-script/reference/add-ons-response-service/variable-data`.

Only available for Google Workspace add-ons that extend Google Workspace Studio.

Sample usage:

```javascript
let customResourceData = AddOnsResponseService.newResourceData()
  .setVariableDataMap(
    {
      "field_1": fieldData_1,
      "field_2": fieldData_2
    }
  );

let outputVariableData = AddOnsResponseService.newVariableData()
  .addResourceData(customResourceData);

let workflowAction = AddOnsResponseService.newReturnOutputVariablesAction()
  .setVariableDataMap({ "resource_data": outputVariableData });
```

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/add-ons-response-service/resource-data#addVariableData(String,VariableData)` | `https://developers.google.com/apps-script/reference/add-ons-response-service/resource-data#` | Adds a `https://developers.google.com/apps-script/reference/add-ons-response-service/variable-data` keyed by its variable name, a value is overwritten if the key already exists. |
| `https://developers.google.com/apps-script/reference/add-ons-response-service/resource-data#setVariableDataMap(Object)` | `https://developers.google.com/apps-script/reference/add-ons-response-service/resource-data#` | Sets the map of the variable data keyed by variable names. |

## Detailed documentation

### `addVariableData(key, value)`

Adds a `https://developers.google.com/apps-script/reference/add-ons-response-service/variable-data` keyed by its variable name, a value is overwritten if the key
already exists.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `key` | `String` | The variable name to retrieve the corresponding variable data. |
| `value` | `https://developers.google.com/apps-script/reference/add-ons-response-service/variable-data` | The `https://developers.google.com/apps-script/reference/add-ons-response-service/variable-data` to be added. |

#### Return


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

*** ** * ** ***

### `setVariableDataMap(fields)`

Sets the map of the variable data keyed by variable names.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `fields` | `Object` | A collection of key-value pairs of string and variable data. |

#### Return


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