SetCredentialsResponse

Builder to create a `setCredentials()` response for your script project.

```javascript
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 |
|---|---|---|
| `https://developers.google.com/apps-script/reference/data-studio/set-credentials-response#build()` | `Object` | Validates this object and returns it in the format needed by Data Studio. |
| `https://developers.google.com/apps-script/reference/data-studio/set-credentials-response#printJson()` | `String` | Prints the JSON representation of this object. |
| `https://developers.google.com/apps-script/reference/data-studio/set-credentials-response#setIsValid(Boolean)` | `https://developers.google.com/apps-script/reference/data-studio/set-credentials-response#` | Sets the valid status of this `https://developers.google.com/apps-script/reference/data-studio/set-credentials-response#`. |

## Detailed documentation

### `build()`

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

#### Return


`Object` --- The validated `https://developers.google.com/apps-script/reference/data-studio/set-credentials-response#` object.

*** ** * ** ***

### `printJson()`

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

#### Return


`String`

*** ** * ** ***

### `setIsValid(isValid)`

Sets the valid status of this `https://developers.google.com/apps-script/reference/data-studio/set-credentials-response#`. 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


`https://developers.google.com/apps-script/reference/data-studio/set-credentials-response#` --- This builder, for chaining.