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 的顯示比例來計算。產生的圖片寬度必須至少為 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

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