Class SetCredentialsResponse Stay organized with collections Save and categorize content based on your preferences.
Page Summary
The
SetCredentialsResponseis a builder used to create a response for thesetCredentials()function in a script project.The
build()method validates the object and returns it in the format required by Data Studio.The
printJson()method prints the JSON representation of the object for debugging.The
setIsValid(isValid)method sets the validity status of theSetCredentialsResponse.
Builder to create aset response for your script project.
constcommunityConnector=DataStudioApp.createCommunityConnector();functionsetCredentials(request){constisValid=validateCredentials(request);if(isValid){// store the credentials somewhere.}returncommunityConnector.newSetCredentialsResponse().setIsValid(isValid).build();}functionvalidateCredentials(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 thisSet. |
Detailed documentation
build()
Validates this object and returns it in the format needed by Data Studio.
Return
Object — The validatedSet object.
printJson()
Prints the JSON representation of this object. This is for debugging only.
Return
String
setIsValid(isValid)
Sets the valid status of thisSet. Set totrue if thecredentials 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.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-11 UTC.