Class DataType

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:

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

MethodReturn typeBrief description
setBasicDataType(basicDataType)DataTypeSets the data type to one of the supported BasicDataTypes.
setResourceType(resourceType)DataTypeSets the data type to a custom defined ResourceType.
setValueMetadata(valueMetadata)DataTypeSets the ValueMetadata, which contains type-related information related to the variable.

Detailed documentation

setBasicDataType(basicDataType)

Sets the data type to one of the supported BasicDataTypes.

Parameters

NameTypeDescription
basicDataTypeBasicDataTypeThe basic data type that the variable belongs to.

Return

DataType — This data type object, for chaining.


setResourceType(resourceType)

Sets the data type to a custom defined ResourceType.

Parameters

NameTypeDescription
resourceTypeResourceTypeThe application specific(custom) resource type of the variable.

Return

DataType — This data type object, for chaining.


setValueMetadata(valueMetadata)

Sets the ValueMetadata, which contains type-related information related to the variable.

Parameters

NameTypeDescription
valueMetadataValueMetadataThe value metadata information about the potential values of the variable.

Return

DataType — This data type object, for chaining.