REST Resource: drives

資源:雲端硬碟

代表共用雲端硬碟。

部分資源方法 (例如 drives.update) 需要 driveId。使用 drives.list 方法擷取共用雲端硬碟的 ID。

JSON 表示法
{
  "id": string,
  "name": string,
  "colorRgb": string,
  "kind": string,
  "backgroundImageLink": string,
  "capabilities": {
    "canAddChildren": boolean,
    "canComment": boolean,
    "canCopy": boolean,
    "canDeleteDrive": boolean,
    "canDownload": boolean,
    "canEdit": boolean,
    "canListChildren": boolean,
    "canManageMembers": boolean,
    "canReadRevisions": boolean,
    "canRename": boolean,
    "canRenameDrive": boolean,
    "canChangeDriveBackground": boolean,
    "canShare": boolean,
    "canChangeCopyRequiresWriterPermissionRestriction": boolean,
    "canChangeDomainUsersOnlyRestriction": boolean,
    "canChangeDriveMembersOnlyRestriction": boolean,
    "canChangeSharingFoldersRequiresOrganizerPermissionRestriction": boolean,
    "canResetDriveRestrictions": boolean,
    "canDeleteChildren": boolean,
    "canTrashChildren": boolean
  },
  "themeId": string,
  "backgroundImageFile": {
    "id": string,
    "xCoordinate": number,
    "yCoordinate": number,
    "width": number
  },
  "createdTime": string,
  "hidden": boolean,
  "restrictions": {
    "copyRequiresWriterPermission": boolean,
    "domainUsersOnly": boolean,
    "driveMembersOnly": boolean,
    "adminManagedRestrictions": boolean,
    "sharingFoldersRequiresOrganizerPermission": boolean
  },
  "orgUnitId": string
}
欄位
id

string

僅供輸出。這個共用雲端硬碟的 ID,也是這個共用雲端硬碟的頂層資料夾 ID。

name

string

這個共用雲端硬碟的名稱。

colorRgb

string

這個共用雲端硬碟的顏色,以 RGB 十六進位字串的形式表示。只能在未設定 themeIddrive.drives.update 要求中設定。

kind

string

僅供輸出。識別資源的種類。值:固定字串 "drive#drive"

capabilities

object

僅供輸出。這個共用雲端硬碟的目前使用者俱備的功能。

capabilities.canAddChildren

boolean

僅供輸出。目前使用者能否將子項新增至這個共用雲端硬碟中的資料夾。

capabilities.canComment

boolean

僅供輸出。目前的使用者能否對這個共用雲端硬碟中的檔案加註。

capabilities.canCopy

boolean

僅供輸出。目前的使用者能否複製這個共用雲端硬碟中的檔案。

capabilities.canDeleteDrive

boolean

僅供輸出。目前的使用者能否刪除這個共用雲端硬碟。如果共用雲端硬碟中含有未移至垃圾桶的項目,嘗試刪除該共用雲端硬碟可能還是會失敗。

capabilities.canDownload

boolean

僅供輸出。目前的使用者能否下載這個共用雲端硬碟中的檔案。

capabilities.canEdit

boolean

僅供輸出。目前的使用者能否編輯這個共用雲端硬碟中的檔案

capabilities.canListChildren

boolean

僅供輸出。目前的使用者能否列出這個共用雲端硬碟中資料夾的子項。

capabilities.canManageMembers

boolean

僅供輸出。目前的使用者能否為這個共用雲端硬碟新增成員、移除他們或變更角色。

capabilities.canReadRevisions

boolean

僅供輸出。目前的使用者能否讀取這個共用雲端硬碟中檔案的修訂版本資源。

capabilities.canRename

boolean

僅供輸出。目前的使用者是否可以重新命名這個共用雲端硬碟中的檔案或資料夾。

capabilities.canRenameDrive

boolean

僅供輸出。目前的使用者能否重新命名這個共用雲端硬碟。

capabilities.canChangeDriveBackground

boolean

僅供輸出。目前的使用者是否可以變更這個共用雲端硬碟的背景。

capabilities.canShare

boolean

僅供輸出。目前的使用者能否將這個共用雲端硬碟中的檔案或資料夾設為共用。

capabilities.canChangeCopyRequiresWriterPermissionRestriction

boolean

僅供輸出。目前的使用者是否可以變更這個共用雲端硬碟的「copyRequiresWriterPermission」限制。

capabilities.canChangeDomainUsersOnlyRestriction

boolean

僅供輸出。目前的使用者是否可以變更這個共用雲端硬碟的「domainUsersOnly」限制。

capabilities.canChangeDriveMembersOnlyRestriction

boolean

僅供輸出。目前的使用者是否可以變更這個共用雲端硬碟的「driveMembersOnly」限制。

capabilities.canChangeSharingFoldersRequiresOrganizerPermissionRestriction

boolean

僅供輸出。目前的使用者是否可以變更這個共用雲端硬碟的「sharingFoldersRequiresOrganizerPermission」限制。

capabilities.canResetDriveRestrictions

boolean

僅供輸出。目前的使用者能否將共用雲端硬碟限制重設為預設值。

capabilities.canDeleteChildren

boolean

僅供輸出。目前的使用者能否從這個共用雲端硬碟的資料夾中刪除子項。

capabilities.canTrashChildren

boolean

僅供輸出。目前的使用者是否可以將這個共用雲端硬碟中資料夾中的子項移至垃圾桶。

themeId

string

要設定背景圖片和顏色的主題 ID。可從 drive.about.get 回應擷取可能的 driveThemes 組合。如未在 drive.drives.create 要求中指定,系統會隨機選擇主題,也就是設定背景圖片和顏色。這是寫入專用的欄位,只能在未設定 colorRgbbackgroundImageFile 的要求中設定。

backgroundImageFile

object

圖片檔和裁剪參數 (已設定這個共用雲端硬碟的背景圖片)。這是寫入專用欄位,只能針對未設定 themeIddrive.drives.update 要求設定。如果有指定,就必須設定 backgroundImageFile 的所有欄位。

backgroundImageFile.id

string

這是 Google 雲端硬碟中用於背景圖片的圖片檔 ID。

backgroundImageFile.xCoordinate

number

在背景圖片中,裁剪區域左上角的 X 座標。這個值是介於 0 到 1 之間的值。這個值代表從整張圖片左側到裁剪區域左側的水平距離,除以整張圖片的寬度。

backgroundImageFile.yCoordinate

number

背景圖片裁剪區域左上角的 Y 座標。這個值是介於 0 到 1 之間的值。這個值代表從整張圖片頂端到裁剪區域頂端到裁剪區域頂端的垂直距離,除以整張圖片的高度。

backgroundImageFile.width

number

裁剪圖片的寬度在 0 到 1 的封閉範圍內。這個值代表裁剪圖片的寬度除以整張圖片的寬度。將寬度套用於高度顯示比例 80 至 9,藉此計算高度。最終產生的圖片寬度至少必須為 1280 像素,高度至少 144 像素。

createdTime

string

僅供輸出。共用雲端硬碟的建立時間 (RFC 3339 日期和時間)。

hidden

boolean

共用雲端硬碟是否在預設檢視畫面中隱藏。

restrictions

object

這組限制適用於這個共用雲端硬碟或這個共用雲端硬碟中的項目。請注意,建立共用雲端硬碟時無法設定限制。如要新增限制,請先建立共用雲端硬碟,再透過「drives.update」新增限制。

restrictions.copyRequiresWriterPermission

boolean

是否要為檢視者和加註者停用從這個共用雲端硬碟中複製、列印或下載檔案的選項。如果設為 true,系統就會針對這個共用雲端硬碟中的任何檔案,將名稱類似的欄位覆寫為 true

restrictions.domainUsersOnly

boolean

這個共用雲端硬碟的存取權以及這個共用雲端硬碟中的項目是否只限於這個共用雲端硬碟所屬的網域使用者。如果這個共用雲端硬碟以外控管的其他共用政策,可能會覆寫這項限制。

restrictions.driveMembersOnly

boolean

這個共用雲端硬碟中的項目是否僅限成員存取。

restrictions.adminManagedRestrictions

boolean

是否要修改這個共用雲端硬碟的管理員權限。

restrictions.sharingFoldersRequiresOrganizerPermission

boolean

設為 True 時,只有具備主辦人角色的使用者才能共用資料夾。如果設為 false,具備「發起人」角色或「檔案管理者」角色的使用者可以共用資料夾。

orgUnitId

string

僅供輸出。這個共用雲端硬碟的機構單位。只有在 useDomainAdminAccess 參數設為 true 時,才能在 drives.list 回應中填入這個欄位。

方法

create

建立共用雲端硬碟。

delete

永久刪除使用者處於「organizer」的共用雲端硬碟。

get

根據 ID 取得共用雲端硬碟的中繼資料。

hide

共用雲端硬碟的預設檢視畫面會隱藏。

list

列出使用者的共用雲端硬碟。

unhide

將共用雲端硬碟還原為預設檢視畫面。

update

更新共用雲端硬碟的中繼資料。