用于为脚本项目创建 set 响应的构建器。
const communityConnector = DataStudioApp.createCommunityConnector(); function setCredentials(request) { const isValid = validateCredentials(request); if (isValid) { // store the credentials somewhere. } return communityConnector.newSetCredentialsResponse().setIsValid(isValid).build(); } function validateCredentials(request) { // ... }
方法
| 方法 | 返回类型 | 简介 | 
|---|---|---|
| build() | Object | 验证此对象,并以数据分析所需的格式返回该对象。 | 
| print | String | 输出此对象的 JSON 表示法。 | 
| set | Set | 设置此 Set的有效状态。 | 
详细文档
build()
print
输出此对象的 JSON 表示法。这仅用于调试。
返回
String
set
设置此 Set 的有效状态。如果请求中提供的凭据有效,则设置为 true;否则设置为 false。
参数
| 名称 | 类型 | 说明 | 
|---|---|---|
| is | Boolean | 要设置的有效状态。 | 
返回
Set - 此构建器,用于链式调用。