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
  },
  "createdDate": 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.insert 要求中指定,系統會隨機選擇主題,並設定背景圖片和顏色。這是一個只讀欄位,只能在未設定 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 像素。

createdDate

string

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

hidden

boolean

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

restrictions

object

套用至這個共用雲端硬碟或共用雲端硬碟內項目的一組限制。

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 回應中填入這個欄位。

方法

delete

永久刪除使用者為organizer的共用雲端硬碟。

get

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

hide

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

insert

建立新的共用雲端硬碟。

list

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

unhide

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

update

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