DataType

A DataType is used to set the type of a variable. The type can be one of the basic data type or a
Workspace Studio-specific resource type.

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

Sample usage:

```javascript
const dataType = AddOnsResponseService.newDataType()
    .setBasicDataType(
      AddOnsResponseService.BasicDataType.STRING
    )
    .setValueMetadata(
      AddOnsResponseService.newValueMetadata()
        .addEnumValue("sample_enum_value")
    );

let resourceField = AddOnsResponseService.newResourceField()
    .setSelector("question_1")
    .setDisplayText("Question 1")
    .setDataType(dataType);

}
```

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/add-ons-response-service/data-type#setBasicDataType(BasicDataType)` | `https://developers.google.com/apps-script/reference/add-ons-response-service/data-type#` | Sets the data type to one of the supported `https://developers.google.com/apps-script/reference/add-ons-response-service/basic-data-type`s. |
| `https://developers.google.com/apps-script/reference/add-ons-response-service/data-type#setResourceType(ResourceType)` | `https://developers.google.com/apps-script/reference/add-ons-response-service/data-type#` | Sets the data type to a custom defined `https://developers.google.com/apps-script/reference/add-ons-response-service/resource-type`. |
| `https://developers.google.com/apps-script/reference/add-ons-response-service/data-type#setValueMetadata(ValueMetadata)` | `https://developers.google.com/apps-script/reference/add-ons-response-service/data-type#` | Sets the `https://developers.google.com/apps-script/reference/add-ons-response-service/value-metadata`, which contains type-related information related to the variable. |

## Detailed documentation

### `setBasicDataType(basicDataType)`

Sets the data type to one of the supported `https://developers.google.com/apps-script/reference/add-ons-response-service/basic-data-type`s.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `basicDataType` | `https://developers.google.com/apps-script/reference/add-ons-response-service/basic-data-type` | The basic data type that the variable belongs to. |

#### Return


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

*** ** * ** ***

### `setResourceType(resourceType)`

Sets the data type to a custom defined `https://developers.google.com/apps-script/reference/add-ons-response-service/resource-type`.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `resourceType` | `https://developers.google.com/apps-script/reference/add-ons-response-service/resource-type` | The application specific(custom) resource type of the variable. |

#### Return


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

*** ** * ** ***

### `setValueMetadata(valueMetadata)`

Sets the `https://developers.google.com/apps-script/reference/add-ons-response-service/value-metadata`, which contains type-related information related to the
variable.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `valueMetadata` | `https://developers.google.com/apps-script/reference/add-ons-response-service/value-metadata` | The value metadata information about the potential values of the variable. |

#### Return


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