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

這個共用雲端硬碟或當中的共用雲端硬碟套用的一組限制。

restrictions.copyRequiresWriterPermission

boolean

對讀者和加註者停用複製、列印或下載檔案時的選項。如果將這項限制設為 true,系統便會覆寫這個共用雲端硬碟中所有檔案的類似名稱欄位。true

restrictions.domainUsersOnly

boolean

是否限制只有這個共用雲端硬碟所屬網域的使用者可以存取這個共用雲端硬碟和這個共用雲端硬碟中的項目。這個共用雲端硬碟以外的其他共用政策可能會覆寫這項限制。

restrictions.driveMembersOnly

boolean

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

restrictions.adminManagedRestrictions

boolean

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

restrictions.sharingFoldersRequiresOrganizerPermission

boolean

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

orgUnitId

string

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

方法

create

建立共用雲端硬碟。

delete

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

get

透過 ID 取得共用雲端硬碟的中繼資料。

hide

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

list

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

unhide

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

update

更新共用雲端硬碟的中繼標籤。