LookerDataSourceSpec

A `https://developers.google.com/apps-script/reference/spreadsheet/data-source-spec` which is used to access specifically the existing Looker data source
specifications. To create a new data source specification, use `https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet-app#newDataSourceSpec()`.

This example shows how you can get the Looker data source spec from a sheet which has just one
Looker connection.

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

const lookerDataSourceSpec = ss.getDataSources()[0].getSpec().asLooker();
```

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/spreadsheet/looker-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/looker-data-source-spec#getExploreName()` | `String` | Gets the name of the Looker explore in the model. |
| `https://developers.google.com/apps-script/reference/spreadsheet/looker-data-source-spec#getInstanceUrl()` | `String` | Gets the URL of the Looker instance. |
| `https://developers.google.com/apps-script/reference/spreadsheet/looker-data-source-spec#getModelName()` | `String` | Gets the name of the Looker model in the instance. |
| `https://developers.google.com/apps-script/reference/spreadsheet/looker-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/looker-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.

*** ** * ** ***

### `getExploreName()`

Gets the name of the Looker explore in the model.

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

const lookerDataSourceSpec = ss.getDataSources()[0].getSpec().asLooker();
const exploreName = lookerDataSourceSpec.getExploreName();
Logger.log(exploreName);
```

#### Return


`String` --- The name of the Looker explore.

*** ** * ** ***

### `getInstanceUrl()`

Gets the URL of the Looker instance.

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

const lookerDataSourceSpec = ss.getDataSources()[0].getSpec().asLooker();
const instanceUrl = lookerDataSourceSpec.getInstanceUrl();
Logger.log(instanceUrl);
```

#### Return


`String` --- The URL of the Looker instance.

*** ** * ** ***

### `getModelName()`

Gets the name of the Looker model in the instance.

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

const lookerDataSourceSpec = ss.getDataSources()[0].getSpec().asLooker();
const modelName = lookerDataSourceSpec.getModelName();
Logger.log(modelName);
```

#### Return


`String` --- The name of the Looker model.

*** ** * ** ***

### `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.

*** ** * ** ***

### `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.