Class SetCredentialsResponse

  • The SetCredentialsResponse is a builder used to create a response for the setCredentials() 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 the SetCredentialsResponse.

SetCredentialsResponse

Builder to create a setCredentials() 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) SetCredentialsResponse Sets the valid status of this SetCredentialsResponse .

Detailed documentation

build()

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

Return

Object — The validated SetCredentialsResponse object.


printJson()

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

Return

String


setIsValid(isValid)

Sets the valid status of this SetCredentialsResponse . Set to true if the credentials 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 the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024年12月02日 UTC.