访问和修改现有的刷新时间表。如需获取所有刷新时间表,请参阅 Spreadsheet.getDataSourceRefreshSchedules()
。
此类只能用于连接到数据库的数据。
方法
方法 | 返回类型 | 简介 |
---|---|---|
getFrequency() | DataSourceRefreshScheduleFrequency | 获取刷新频率(用于指定刷新频率和刷新时间)。 |
getScope() | DataSourceRefreshScope | 获取此刷新时间表的范围。 |
getTimeIntervalOfNextRun() | TimeInterval | 获取此刷新时间表的下次运行的时间窗口。 |
isEnabled() | Boolean | 确定是否启用了此刷新时间表。 |
详细文档
getFrequency()
获取刷新频率(用于指定刷新频率和刷新时间)。
返回
DataSourceRefreshScheduleFrequency
- 刷新时间表频率。
授权
使用此方法的脚本需要通过以下一个或多个范围进行授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getScope()
获取此刷新时间表的范围。
返回
DataSourceRefreshScope
- 刷新范围。
授权
使用此方法的脚本需要通过以下一个或多个范围进行授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getTimeIntervalOfNextRun()
获取此刷新时间表的下次运行的时间窗口。仅在启用此刷新时间表时适用。
返回
TimeInterval
- 下次运行的时间窗口。
授权
使用此方法的脚本需要通过以下一个或多个范围进行授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
isEnabled()
确定是否启用了此刷新时间表。
返回
Boolean
- 此刷新时间表是否已启用。
授权
使用此方法的脚本需要通过以下一个或多个范围进行授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets