Class SetCredentialsResponse
Stay organized with collections
Save and categorize content based on your preferences.
SetCredentialsResponse
Builder to create a setCredentials()
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) {
// ...
}
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
Name | Type | Description |
isValid | Boolean | The 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.
[null,null,["Last updated 2024-12-02 UTC."],[[["\u003cp\u003e\u003ccode\u003eSetCredentialsResponse\u003c/code\u003e helps you create a response for your script project's \u003ccode\u003esetCredentials()\u003c/code\u003e function, indicating whether the provided credentials are valid.\u003c/p\u003e\n"],["\u003cp\u003eYou can use the \u003ccode\u003esetIsValid()\u003c/code\u003e method to set the validation status (true/false) and \u003ccode\u003ebuild()\u003c/code\u003e to finalize and return the response object in the required format for Data Studio.\u003c/p\u003e\n"],["\u003cp\u003eFor debugging, \u003ccode\u003eprintJson()\u003c/code\u003e prints the JSON representation of the \u003ccode\u003eSetCredentialsResponse\u003c/code\u003e object.\u003c/p\u003e\n"]]],[],null,["# Class SetCredentialsResponse\n\nSetCredentialsResponse\n\nBuilder to create a `set``Credentials()` response for your script project.\n\n```javascript\nconst communityConnector = DataStudioApp.createCommunityConnector();\n\nfunction setCredentials(request) {\n const isValid = validateCredentials(request);\n\n if (isValid) {\n // store the credentials somewhere.\n }\n\n return communityConnector.newSetCredentialsResponse().setIsValid(isValid).build();\n}\n\nfunction validateCredentials(request) {\n // ...\n}\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|---------------------------------------------|-----------------------------|---------------------------------------------------------------------------|\n| [build()](#build()) | `Object` | Validates this object and returns it in the format needed by Data Studio. |\n| [printJson()](#printJson()) | `String` | Prints the JSON representation of this object. |\n| [setIsValid(isValid)](#setIsValid(Boolean)) | [SetCredentialsResponse](#) | Sets the valid status of this [SetCredentialsResponse](#). |\n\nDetailed documentation\n----------------------\n\n### `build()`\n\nValidates this object and returns it in the format needed by Data Studio.\n\n#### Return\n\n\n`Object` --- The validated [SetCredentialsResponse](#) object.\n\n*** ** * ** ***\n\n### `print``Json()`\n\nPrints the JSON representation of this object. This is for debugging only.\n\n#### Return\n\n\n`String`\n\n*** ** * ** ***\n\n### `set``Is``Valid(isValid)`\n\nSets the valid status of this [SetCredentialsResponse](#). Set to `true` if the\ncredentials provided in the request were valid, `false`, otherwise.\n\n#### Parameters\n\n| Name | Type | Description |\n|-------------|-----------|--------------------------|\n| `is``Valid` | `Boolean` | The valid status to set. |\n\n#### Return\n\n\n[SetCredentialsResponse](#) --- This builder, for chaining."]]