Class DataSourceRefreshScheduleFrequency

DataSourceRefreshScheduleFrequency

访问刷新周期的频率,该频率用于指定刷新频率和时间。

仅将此类用于已连接到数据库的数据。

如需查看此刷新时间表下次安排的运行时间,请使用 DataSourceRefreshSchedule.getTimeIntervalOfNextRun()

如需更新,请使用 DataSourceRefreshSchedule.setFrequency(newFrequency)

方法

方法返回类型简介
getDaysOfTheMonth()Integer[]获取以数字 (1-28) 表示的刷新数据源的月份日期。
getDaysOfTheWeek()Weekday[]获取刷新数据源的星期几。
getFrequencyType()FrequencyType获取频次类型。
getStartHour()Integer获取刷新时间表运行的时间间隔的开始小时(以 0-23 之间的数字表示)。

详细文档

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