Class DeveloperMetadata

DeveloperMetadata

存取及修改開發人員中繼資料。如要建立新的開發人員中繼資料,請使用 Range.addDeveloperMetadata(key)Sheet.addDeveloperMetadata(key)Spreadsheet.addDeveloperMetadata(key)

方法

方法傳回類型簡短說明
getId()Integer傳回與這個開發人員中繼資料相關聯的專屬 ID。
getKey()String傳回與這個開發人員中繼資料相關聯的鍵。
getLocation()DeveloperMetadataLocation傳回這項開發人員中繼資料的位置。
getValue()String傳回與這個開發人員中繼資料相關聯的值,如果這個中繼資料沒有值,則傳回 null
getVisibility()DeveloperMetadataVisibility傳回這項開發人員中繼資料的顯示設定。
moveToColumn(column)DeveloperMetadata將這項開發人員中繼資料移至指定資料欄。
moveToRow(row)DeveloperMetadata將這項開發人員中繼資料移至指定資料列。
moveToSheet(sheet)DeveloperMetadata將這項開發人員中繼資料移至指定工作表。
moveToSpreadsheet()DeveloperMetadata將這項開發人員中繼資料移至頂層試算表。
remove()void刪除這項中繼資料。
setKey(key)DeveloperMetadata將這個開發人員中繼資料的鍵設為指定值。
setValue(value)DeveloperMetadata將與這個開發人員中繼資料相關聯的值設為指定值。
setVisibility(visibility)DeveloperMetadata將這個開發人員中繼資料的瀏覽權限設為指定瀏覽權限。

內容詳盡的說明文件

getId()

傳回與這個開發人員中繼資料相關聯的專屬 ID。

回攻員

Integer:與這個開發人員中繼資料相關聯的專屬 ID。

授權

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

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

getKey()

傳回與這個開發人員中繼資料相關聯的鍵。

回攻員

String:與這個開發人員中繼資料相關聯的鍵。

授權

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

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

getLocation()

傳回這項開發人員中繼資料的位置。

回攻員

DeveloperMetadataLocation:這項開發人員中繼資料的位置。

授權

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

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

getValue()

傳回與這個開發人員中繼資料相關聯的值,如果這個中繼資料沒有值,則傳回 null

回攻員

String:與這個開發人員中繼資料相關聯的值,如果這個中繼資料沒有值,則為 null

授權

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

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

getVisibility()

傳回這項開發人員中繼資料的顯示設定。

回攻員

DeveloperMetadataVisibility:這項開發人員中繼資料的顯示設定。

授權

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

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

moveToColumn(column)

將這項開發人員中繼資料移至指定資料欄。如果指定範圍並非單一資料欄,系統會擲回例外狀況。

參數

名稱類型說明
columnRange代表這個開發人員中繼資料新位置的範圍。

回攻員

DeveloperMetadata:開發人員中繼資料,用於鏈結。

授權

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

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

moveToRow(row)

將這項開發人員中繼資料移至指定資料列。如果指定範圍不是單一列,系統會擲回例外狀況。

參數

名稱類型說明
rowRange代表這個開發人員中繼資料新位置的資料列範圍。

回攻員

DeveloperMetadata:開發人員中繼資料,用於鏈結。

授權

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

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

moveToSheet(sheet)

將這項開發人員中繼資料移至指定工作表。

參數

名稱類型說明
sheetSheet這個開發人員中繼資料的新位置。

回攻員

DeveloperMetadata:開發人員中繼資料,用於鏈結。

授權

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

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

moveToSpreadsheet()

將這項開發人員中繼資料移至頂層試算表。

回攻員

DeveloperMetadata:開發人員中繼資料,用於鏈結。

授權

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

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

remove()

刪除這項中繼資料。

授權

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

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

setKey(key)

將這個開發人員中繼資料的鍵設為指定值。

參數

名稱類型說明
keyString要為這項中繼資料設定的新鍵。

回攻員

DeveloperMetadata - 開發人員中繼資料,用於鏈結。

授權

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

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

setValue(value)

將與這個開發人員中繼資料相關聯的值設為指定值。

參數

名稱類型說明
valueString要為這項中繼資料設定的新值。

回攻員

DeveloperMetadata:開發人員中繼資料,用於鏈結。

授權

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

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

setVisibility(visibility)

將這個開發人員中繼資料的瀏覽權限設為指定瀏覽權限。

參數

名稱類型說明
visibilityDeveloperMetadataVisibility要為這項中繼資料設定的新瀏覽權限。

回攻員

DeveloperMetadata - 開發人員中繼資料,用於鏈結。

授權

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

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