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 的數字表示),這個時間間隔是執行重新整理時間表的時段。舉例來說,如果開始時間為下午 1 點,時間間隔為 4 小時,資料來源就會在下午 1 點到 5 點之間重新整理。時間採用試算表的時區。

回攻員

Integer:開始時間 (小時)。

授權

使用這個方法的指令碼需要下列一或多個範圍的授權:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets