Builder to create a set
response for your script project.
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) { // ... }
Methods
Method | Return type | Brief description |
---|---|---|
build() | Object | Validates this object and returns it in the format needed by Data Studio. |
print | String | Prints the JSON representation of this object. |
set | Set | Sets the valid status of this Set . |
Detailed documentation
build()
Validates this object and returns it in the format needed by Data Studio.
Return
Object
— The validated Set
object.
printJson()
Prints the JSON representation of this object. This is for debugging only.
Return
String
setIsValid(isValid)
Sets the valid status of this Set
. Set to true
if the
credentials provided in the request were valid, false
, otherwise.
Parameters
Name | Type | Description |
---|---|---|
is | Boolean | The valid status to set. |
Return
Set
— This builder, for chaining.