DataSourceRefreshSchedule

Access and modify an existing refresh schedule. To get all refresh schedules, see `https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet#getDataSourceRefreshSchedules()`.


**Only use this class with data that's connected to a database.**

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/spreadsheet/data-source-refresh-schedule#getFrequency()` | `https://developers.google.com/apps-script/reference/spreadsheet/data-source-refresh-schedule-frequency` | Gets the refresh schedule frequency, which specifies how often and when to refresh. |
| `https://developers.google.com/apps-script/reference/spreadsheet/data-source-refresh-schedule#getScope()` | `https://developers.google.com/apps-script/reference/spreadsheet/data-source-refresh-scope` | Gets the scope of this refresh schedule. |
| `https://developers.google.com/apps-script/reference/spreadsheet/data-source-refresh-schedule#getTimeIntervalOfNextRun()` | `TimeInterval` | Gets the time window of the next run of this refresh schedule. |
| `https://developers.google.com/apps-script/reference/spreadsheet/data-source-refresh-schedule#isEnabled()` | `Boolean` | Determines whether this refresh schedule is enabled. |

## Detailed documentation

### `getFrequency()`

Gets the refresh schedule frequency, which specifies how often and when to refresh.

#### Return


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

#### Authorization

Scripts that use this method require authorization with one or more of the following [scopes](https://developers.google.com/apps-script/concepts/scopes#setting_explicit_scopes):

- `https://www.googleapis.com/auth/spreadsheets.currentonly`
- `https://www.googleapis.com/auth/spreadsheets`

*** ** * ** ***

### `getScope()`

Gets the scope of this refresh schedule.

#### Return


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

#### Authorization

Scripts that use this method require authorization with one or more of the following [scopes](https://developers.google.com/apps-script/concepts/scopes#setting_explicit_scopes):

- `https://www.googleapis.com/auth/spreadsheets.currentonly`
- `https://www.googleapis.com/auth/spreadsheets`

*** ** * ** ***

### `getTimeIntervalOfNextRun()`

Gets the time window of the next run of this refresh schedule. Only applies if this refresh
schedule is enabled.

#### Return


`TimeInterval` --- The time window of the next run.

#### Authorization

Scripts that use this method require authorization with one or more of the following [scopes](https://developers.google.com/apps-script/concepts/scopes#setting_explicit_scopes):

- `https://www.googleapis.com/auth/spreadsheets.currentonly`
- `https://www.googleapis.com/auth/spreadsheets`

*** ** * ** ***

### `isEnabled()`

Determines whether this refresh schedule is enabled.

#### Return


`Boolean` --- Whether this refresh schedule is enabled.

#### Authorization

Scripts that use this method require authorization with one or more of the following [scopes](https://developers.google.com/apps-script/concepts/scopes#setting_explicit_scopes):

- `https://www.googleapis.com/auth/spreadsheets.currentonly`
- `https://www.googleapis.com/auth/spreadsheets`