GetSchemaResponse

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

```javascript
function getSchema() {
  const cc = DataStudioApp.createCommunityConnector();
  const fields = cc.getFields();

  fields.newDimension()
      .setId('Created')
      .setName('Date Created')
      .setDescription('The date that this was created')
      .setType(cc.FieldType.YEAR_MONTH_DAY);

  fields.newMetric()
      .setId('Amount')
      .setName('Amount (USD)')
      .setDescription('The cost in US dollars')
      .setType(cc.FieldType.CURRENCY_USD);

  return cc.newGetSchemaResponse().setFields(fields).build();
}
```

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/data-studio/get-schema-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/get-schema-response#printJson()` | `String` | Prints the JSON representation of this object. |
| `https://developers.google.com/apps-script/reference/data-studio/get-schema-response#setFields(Fields)` | `https://developers.google.com/apps-script/reference/data-studio/get-schema-response#` | Sets the `https://developers.google.com/apps-script/reference/data-studio/fields` of the builder. |

## 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/get-schema-response#` object.

*** ** * ** ***

### `printJson()`

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

#### Return


`String`

*** ** * ** ***

### `setFields(fields)`

Sets the `https://developers.google.com/apps-script/reference/data-studio/fields` of the builder.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `fields` | `https://developers.google.com/apps-script/reference/data-studio/fields` | The fields to set. |

#### Return


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