Class DataSourceRefreshScheduleFrequency
详细文档
getDaysOfTheMonth()
获取要刷新数据源的月份中的某一天(以数字 1-28 表示)。仅适用于频率类型为“每月”时。
返回
Integer[]
- 刷新的日期。
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getDaysOfTheWeek()
获取要刷新数据源的星期几。仅当频率类型为每周时才适用。
返回
Weekday[]
- 刷新的日期。
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getFrequencyType()
获取频次类型。
返回
FrequencyType
- 频率类型。
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getStartHour()
获取刷新时间表运行时段的开始小时(以 0-23 之间的数字表示)。例如,如果开始小时为 13 小时,时间间隔时长为 4 小时,则数据源会在下午 1 点到下午 5 点之间刷新。小时是指电子表格的时区。
返回
Integer
- 开始小时。
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-12-02。
[null,null,["最后更新时间 (UTC):2024-12-02。"],[[["`DataSourceRefreshScheduleFrequency` allows you to access and manage the frequency of data source refreshes for spreadsheet data connected to a database."],["You can retrieve information about the refresh schedule, including the days of the month or week, the frequency type, and the start hour of the refresh."],["Use `DataSourceRefreshSchedule.getTimeIntervalOfNextRun()` to determine the next scheduled refresh time."],["Update the refresh frequency using `DataSourceRefreshSchedule.setFrequency(newFrequency)`."],["Scripts using these methods require authorization with specific scopes related to spreadsheet access."]]],["This content describes the `DataSourceRefreshScheduleFrequency` class for managing data refresh schedules connected to databases. Key actions include accessing the refresh frequency, determining the next run time via `getTimeIntervalOfNextRun()`, and updating the schedule with `setFrequency()`. Information can be retrieved for monthly refreshes, with `getDaysOfTheMonth()`, or for weekly refreshes, with `getDaysOfTheWeek()`. `getFrequencyType()` retrieves the type, and `getStartHour()` the start time. The relevant authorization scopes are also specified.\n"]]