REST Resource: drives

資源:Drive

共用雲端硬碟的代表圖示。

部分資源方法 (例如 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,
    "canChangeDownloadRestriction": 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,
    "downloadRestriction": {
      object (DownloadRestriction)
    }
  },
  "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

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

capabilities.canChangeDownloadRestriction

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 之間 (含 0 和 1)。這個值代表從整張圖片左側到裁剪區域左側的水平距離,除以整張圖片的寬度。

backgroundImageFile.yCoordinate

number

背景圖片中裁剪區域左上角的 Y 座標。這個值必須介於 0 到 1 之間 (含 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,則具備主辦人角色或檔案主辦人角色的使用者可以共用資料夾。

restrictions.downloadRestriction

object (DownloadRestriction)

共用雲端硬碟管理員套用的下載限制。

orgUnitId

string

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

方法

create

建立共用雲端硬碟。

delete

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

get

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

hide

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

list

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

unhide

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

update

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