Class SetCredentialsResponse

  • TheSetCredentialsResponse is a builder used to create a response for thesetCredentials() function in a script project.

  • Thebuild() method validates the object and returns it in the format required by Data Studio.

  • TheprintJson() method prints the JSON representation of the object for debugging.

  • ThesetIsValid(isValid) method sets the validity status of theSetCredentialsResponse.

SetCredentialsResponse

Builder to create asetCredentials() 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

MethodReturn typeBrief description
build()ObjectValidates this object and returns it in the format needed by Data Studio.
printJson()StringPrints the JSON representation of this object.
setIsValid(isValid)SetCredentialsResponseSets the valid status of thisSetCredentialsResponse.

Detailed documentation

build()

Validates this object and returns it in the format needed by Data Studio.

Return

Object — The validatedSetCredentialsResponse object.


printJson()

Prints the JSON representation of this object. This is for debugging only.

Return

String


setIsValid(isValid)

Sets the valid status of thisSetCredentialsResponse. Set totrue if thecredentials provided in the request were valid,false, otherwise.

Parameters

NameTypeDescription
isValidBooleanThe valid status to set.

Return

SetCredentialsResponse — 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.