BigQueryDataSourceSpec

Access the existing BigQuery data source specification. To create a new data source
specification, use `https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet-app#newDataSourceSpec()`.

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#copy()` | `https://developers.google.com/apps-script/reference/spreadsheet/data-source-spec-builder` | Creates a `https://developers.google.com/apps-script/reference/spreadsheet/data-source-spec-builder` based on this data source's settings. |
| `https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getDatasetId()` | `String` | Gets the BigQuery dataset ID. |
| `https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getParameters()` | `https://developers.google.com/apps-script/reference/spreadsheet/data-source-parameter` | Gets the parameters of the data source. |
| `https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getProjectId()` | `String` | Gets the billing project ID. |
| `https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getRawQuery()` | `String` | Gets the raw query string. |
| `https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getTableId()` | `String` | Gets the BigQuery table ID. |
| `https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getTableProjectId()` | `String` | Gets the BigQuery project ID for the table. |
| `https://developers.google.com/apps-script/reference/spreadsheet/big-query-data-source-spec#getType()` | `https://developers.google.com/apps-script/reference/spreadsheet/data-source-type` | Gets the type of the data source. |

## Detailed documentation

### `copy()`

Creates a `https://developers.google.com/apps-script/reference/spreadsheet/data-source-spec-builder` based on this data source's settings.

```javascript
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);
const spec = ss.getDataSources()[0].getSpec();

const newSpec = spec.copy();
```

#### Return


`https://developers.google.com/apps-script/reference/spreadsheet/data-source-spec-builder` --- The builder.

*** ** * ** ***

### `getDatasetId()`

Gets the BigQuery dataset ID.

#### Return


`String` --- The dataset ID, or an empty string if the data source spec is defined by a raw query.

*** ** * ** ***

### `getParameters()`

Gets the parameters of the data source.

```javascript
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);
const spec = ss.getDataSources()[0].getSpec();
const parameters = spec.getParameters();
```

This method is only available for BigQuery data sources.

#### Return


`https://developers.google.com/apps-script/reference/spreadsheet/data-source-parameter` --- The parameter list.

*** ** * ** ***

### `getProjectId()`

Gets the billing project ID.

#### Return


`String` --- The project ID.

*** ** * ** ***

### `getRawQuery()`

Gets the raw query string.

#### Return


`String` --- The raw query string.

*** ** * ** ***

### `getTableId()`

Gets the BigQuery table ID.

#### Return


`String` --- The table ID, or an empty string if the data source spec is defined by a raw query.

*** ** * ** ***

### `getTableProjectId()`

Gets the BigQuery project ID for the table.

#### Return


`String` --- The table project ID, or an empty string if the data source spec is defined by a raw
query.

*** ** * ** ***

### `getType()`

Gets the type of the data source.

```javascript
// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);
const spec = ss.getDataSources()[0].getSpec();
const type = spec.getType();
```

#### Return


`https://developers.google.com/apps-script/reference/spreadsheet/data-source-type` --- The data source type.