REST Resource: files

資源:檔案

檔案的中繼資料,

部分資源方法 (例如 files.update) 需要 fileId。使用 files.list 方法擷取檔案 ID。

JSON 表示法
{
  "kind": string,
  "driveId": string,
  "fileExtension": string,
  "copyRequiresWriterPermission": boolean,
  "md5Checksum": string,
  "contentHints": {
    "indexableText": string,
    "thumbnail": {
      "image": string,
      "mimeType": string
    }
  },
  "writersCanShare": boolean,
  "viewedByMe": boolean,
  "mimeType": string,
  "exportLinks": {
    string: string,
    ...
  },
  "parents": [
    string
  ],
  "thumbnailLink": string,
  "iconLink": string,
  "shared": boolean,
  "lastModifyingUser": {
    object (User)
  },
  "owners": [
    {
      object (User)
    }
  ],
  "headRevisionId": string,
  "sharingUser": {
    object (User)
  },
  "webViewLink": string,
  "webContentLink": string,
  "size": string,
  "viewersCanCopyContent": boolean,
  "permissions": [
    {
      object (Permission)
    }
  ],
  "hasThumbnail": boolean,
  "spaces": [
    string
  ],
  "folderColorRgb": string,
  "id": string,
  "name": string,
  "description": string,
  "starred": boolean,
  "trashed": boolean,
  "explicitlyTrashed": boolean,
  "createdTime": string,
  "modifiedTime": string,
  "modifiedByMeTime": string,
  "viewedByMeTime": string,
  "sharedWithMeTime": string,
  "quotaBytesUsed": string,
  "version": string,
  "originalFilename": string,
  "ownedByMe": boolean,
  "fullFileExtension": string,
  "properties": {
    string: value,
    ...
  },
  "appProperties": {
    string: value,
    ...
  },
  "isAppAuthorized": boolean,
  "teamDriveId": string,
  "capabilities": {
    "canChangeViewersCanCopyContent": boolean,
    "canMoveChildrenOutOfDrive": boolean,
    "canReadDrive": boolean,
    "canEdit": boolean,
    "canCopy": boolean,
    "canComment": boolean,
    "canAddChildren": boolean,
    "canDelete": boolean,
    "canDownload": boolean,
    "canListChildren": boolean,
    "canRemoveChildren": boolean,
    "canRename": boolean,
    "canTrash": boolean,
    "canReadRevisions": boolean,
    "canReadTeamDrive": boolean,
    "canMoveTeamDriveItem": boolean,
    "canChangeCopyRequiresWriterPermission": boolean,
    "canMoveItemIntoTeamDrive": boolean,
    "canUntrash": boolean,
    "canModifyContent": boolean,
    "canMoveItemWithinTeamDrive": boolean,
    "canMoveItemOutOfTeamDrive": boolean,
    "canDeleteChildren": boolean,
    "canMoveChildrenOutOfTeamDrive": boolean,
    "canMoveChildrenWithinTeamDrive": boolean,
    "canTrashChildren": boolean,
    "canMoveItemOutOfDrive": boolean,
    "canAddMyDriveParent": boolean,
    "canRemoveMyDriveParent": boolean,
    "canMoveItemWithinDrive": boolean,
    "canShare": boolean,
    "canMoveChildrenWithinDrive": boolean,
    "canModifyContentRestriction": boolean,
    "canAddFolderFromAnotherDrive": boolean,
    "canChangeSecurityUpdateEnabled": boolean,
    "canAcceptOwnership": boolean,
    "canReadLabels": boolean,
    "canModifyLabels": boolean,
    "canModifyEditorContentRestriction": boolean,
    "canModifyOwnerContentRestriction": boolean,
    "canRemoveContentRestriction": boolean
  },
  "hasAugmentedPermissions": boolean,
  "trashingUser": {
    object (User)
  },
  "thumbnailVersion": string,
  "trashedTime": string,
  "modifiedByMe": boolean,
  "permissionIds": [
    string
  ],
  "imageMediaMetadata": {
    "flashUsed": boolean,
    "meteringMode": string,
    "sensor": string,
    "exposureMode": string,
    "colorSpace": string,
    "whiteBalance": string,
    "width": integer,
    "height": integer,
    "location": {
      "latitude": number,
      "longitude": number,
      "altitude": number
    },
    "rotation": integer,
    "time": string,
    "cameraMake": string,
    "cameraModel": string,
    "exposureTime": number,
    "aperture": number,
    "focalLength": number,
    "isoSpeed": integer,
    "exposureBias": number,
    "maxApertureValue": number,
    "subjectDistance": integer,
    "lens": string
  },
  "videoMediaMetadata": {
    "width": integer,
    "height": integer,
    "durationMillis": string
  },
  "shortcutDetails": {
    "targetId": string,
    "targetMimeType": string,
    "targetResourceKey": string
  },
  "contentRestrictions": [
    {
      object (ContentRestriction)
    }
  ],
  "resourceKey": string,
  "linkShareMetadata": {
    "securityUpdateEligible": boolean,
    "securityUpdateEnabled": boolean
  },
  "labelInfo": {
    "labels": [
      {
        object (Label)
      }
    ]
  },
  "sha1Checksum": string,
  "sha256Checksum": string
}
欄位
kind

string

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

driveId

string

僅供輸出。檔案所在共用雲端硬碟的 ID。僅針對共用雲端硬碟中的項目填入資料。

fileExtension

string

僅供輸出。fullFileExtension 的最終元件。這項功能僅適用於 Google 雲端硬碟中有二進位內容的檔案。

copyRequiresWriterPermission

boolean

請為讀者和加註者停用複製、列印或下載這個檔案的選項。

md5Checksum

string

僅供輸出。檔案內容的 MD5 總和檢查碼。這種做法僅適用於 Google 雲端硬碟中有二進位內容的檔案。

contentHints

object

與檔案內容相關的資訊。回應中一律不會填入這些欄位。

contentHints.indexableText

string

要為檔案建立索引的文字,以改善 fullText 查詢。長度不得超過 128 KB,而且可能含有 HTML 元素。

contentHints.thumbnail

object

檔案的縮圖。只有在 Google 雲端硬碟無法產生標準縮圖時,才能使用這個屬性。

contentHints.thumbnail.image

string (bytes format)

使用安全網址 Base64 編碼的縮圖資料 (RFC 4648 第 5 節)。

Base64 編碼的字串。

contentHints.thumbnail.mimeType

string

縮圖的 MIME 類型。

writersCanShare

boolean

指出僅擁有 writer 權限的使用者是否可以修改檔案權限。未針對共用雲端硬碟中的項目填入資料。

viewedByMe

boolean

僅供輸出。使用者是否看過檔案。

mimeType

string

檔案的 MIME 類型。

如果沒有提供任何值,Google 雲端硬碟會嘗試自動偵測上傳內容中的適當值。必須上傳新的修訂版本,才能變更這個值。

如果使用 Google 文件的 MIME 類型建立檔案,系統會盡可能匯入上傳的內容。支援的匯入格式會發布在「關於」資源中。

parents[]

string

檔案所屬上層資料夾的 ID。

如未在建立要求中指定,檔案會直接存放在使用者的「我的雲端硬碟」資料夾。如未在複製要求中指定,檔案會沿用來源檔案任何可偵測到的父項。file.update 要求必須使用 addParentsremoveParents 參數才能修改父項清單。

shared

boolean

僅供輸出。檔案是否已共用。未針對共用雲端硬碟中的項目填入資料。

lastModifyingUser

object (User)

僅供輸出。最後一位修改檔案的使用者。

owners[]

object (User)

僅供輸出。這個檔案的擁有者。只有特定舊版檔案可能有多位擁有者。系統不會針對共用雲端硬碟中的項目填入這個欄位。

headRevisionId

string

僅供輸出。檔案頭部修訂版本的 ID。這項功能目前僅適用於 Google 雲端硬碟中有二進位內容的檔案。

sharingUser

object (User)

僅供輸出。與提出要求的使用者共用檔案的使用者 (如適用)。

size

string (int64 format)

僅供輸出。blob 和第一方編輯器檔案的大小 (以位元組為單位)。如果檔案沒有大小限制 (例如捷徑和資料夾),系統不會填入資料。

viewersCanCopyContent
(deprecated)

boolean

已淘汰:請改用 copyRequiresWriterPermission

permissions[]

object (Permission)

僅供輸出。檔案權限的完整清單。只有在提出要求的使用者能共用檔案時,才能使用這個選項。未針對共用雲端硬碟中的項目填入資料。

hasThumbnail

boolean

僅供輸出。這個檔案是否包含縮圖。但這不會指出發出要求的應用程式是否有權存取縮圖。如要檢查存取權,請找出縮圖連結欄位是否存在。

spaces[]

string

僅供輸出。包含檔案的聊天室清單。目前支援的值為「drive」、「appDataFolder」和「photos」。

folderColorRgb

string

資料夾的顏色,或是資料夾的捷徑 (格式為 RGB 十六進位字串)。支援的顏色已經發布在「關於」資源的 folderColorPalette 欄位中。

如果指定不支援的顏色,則會改用調色盤中最接近的顏色。

id

string

檔案的 ID。

name

string

檔案名稱。這在資料夾中不一定要是唯一的。請注意,不可變更的項目 (例如共用雲端硬碟的頂層資料夾、「我的雲端硬碟」根資料夾和「應用程式資料」資料夾) 的名稱會固定不變。

description

string

檔案的簡短說明。

starred

boolean

使用者是否已為檔案加上星號。

trashed

boolean

檔案是否已移至垃圾桶 (已明確或透過移至垃圾桶的上層資料夾)。只有擁有者可以將檔案移至垃圾桶,其他使用者無法查看擁有者垃圾桶中的檔案。

explicitlyTrashed

boolean

僅供輸出。檔案是否已明確移至垃圾桶,而非透過上層資料夾遞迴移至垃圾桶。

createdTime

string

檔案建立時間 (RFC 3339 日期時間)。

modifiedTime

string

上次有人修改檔案的時間 (RFC 3339 日期時間)。

請注意,設定 modifiedTime 也會更新使用者的 modifiedByMeTime

modifiedByMeTime

string

僅供輸出。使用者上次修改檔案的時間 (RFC 3339 日期時間)。

viewedByMeTime

string

使用者上次檢視檔案的時間 (RFC 3339 日期時間)。

sharedWithMeTime

string

僅供輸出。檔案與使用者共用的時間 (如適用 (RFC 3339 日期時間)。

quotaBytesUsed

string (int64 format)

僅供輸出。檔案所使用的儲存空間配額位元組數。包括修訂版本修訂版本及已啟用 keepForever 的先前修訂版本。

version

string (int64 format)

僅供輸出。單調遞增檔案的版本號碼。這會反映所有對伺服器上檔案所做的變更,包括使用者看不到的內容。

originalFilename

string

上傳內容的原始檔案名稱 (如有),或其他 name 欄位的原始值。這項功能僅適用於 Google 雲端硬碟中有二進位內容的檔案。

ownedByMe

boolean

僅供輸出。檔案是否為使用者所有。未針對共用雲端硬碟中的項目填入資料。

fullFileExtension

string

僅供輸出。從 name 欄位擷取的完整副檔名。可能包含多個串連的副檔名,例如「tar.gz」。這項功能僅適用於 Google 雲端硬碟中有二進位內容的檔案。

name 欄位變更時,這會自動更新,但如果新名稱不含有效的副檔名,則不會清除。

properties

map (key: string, value: value (Value format))

所有應用程式都能看到的任意鍵/值組合集合。

系統會清除更新和複製要求中值為空值的項目。

這個物件中包含 "key": value 組合的清單,例如:{ "name": "wrench", "mass": "1.3kg", "count": "3" }.

appProperties

map (key: string, value: value (Value format))

一組任意鍵/值組合,僅供提出要求的應用程式使用。

系統會清除更新和複製要求中值為空值的項目。

您只能透過經過驗證的要求擷取這些屬性。已驗證的要求會使用透過 OAuth 2 用戶端 ID 取得的存取權杖。您無法使用 API 金鑰擷取不公開屬性。

這個物件中包含 "key": value 組合的清單,例如:{ "name": "wrench", "mass": "1.3kg", "count": "3" }.

isAppAuthorized

boolean

僅供輸出。檔案是否由提出要求的應用程式建立或開啟。

teamDriveId
(deprecated)

string

已淘汰:僅限輸出。請改用 driveId

capabilities

object

僅供輸出。目前使用者對這個檔案的功能。每項功能都會對應到使用者可能會採取的細項動作。

capabilities.canChangeViewersCanCopyContent
(deprecated)

boolean

已淘汰:僅限輸出。

capabilities.canMoveChildrenOutOfDrive

boolean

僅供輸出。目前的使用者是否可以將這個資料夾的子項移出共用雲端硬碟。如果該項目不是資料夾,則此為 false。僅針對共用雲端硬碟中的項目填入資料。

capabilities.canReadDrive

boolean

僅供輸出。目前的使用者能否讀取這個檔案所屬的共用雲端硬碟。僅針對共用雲端硬碟中的項目填入資料。

capabilities.canEdit

boolean

僅供輸出。目前使用者是否可以編輯這個檔案。其他因素可能會限制使用者可對檔案做出的變更類型。例如,請參閱 canChangeCopyRequiresWriterPermissioncanModifyContent

capabilities.canCopy

boolean

僅供輸出。目前的使用者是否可以複製這個檔案。對於共用雲端硬碟中的項目,指出目前的使用者能否複製這個項目的非資料夾子系,或這個項目不是資料夾本身。

capabilities.canComment

boolean

僅供輸出。目前的使用者能否為這個檔案加註。

capabilities.canAddChildren

boolean

僅供輸出。目前的使用者能否在這個資料夾中新增子項。如果該項目不是資料夾,一律為 false。

capabilities.canDelete

boolean

僅供輸出。目前使用者是否可以刪除這個檔案。

capabilities.canDownload

boolean

僅供輸出。目前的使用者能否下載這個檔案。

capabilities.canListChildren

boolean

僅供輸出。目前使用者是否可列出這個資料夾的子項。如果該項目不是資料夾,一律為 false。

capabilities.canRemoveChildren

boolean

僅供輸出。目前的使用者能否從這個資料夾移除子項。如果該項目不是資料夾,一律為 false。如果是共用雲端硬碟中的資料夾,請改用 canDeleteChildrencanTrashChildren

capabilities.canRename

boolean

僅供輸出。目前的使用者能否重新命名這個檔案。

capabilities.canTrash

boolean

僅供輸出。目前的使用者能否將這個檔案移至垃圾桶。

capabilities.canReadRevisions

boolean

僅供輸出。目前使用者是否可讀取這個檔案的修訂版本資源。針對共用雲端硬碟項目,則可讀取這個項目的非資料夾子系修訂版本,還是這個項目本身 (不是資料夾) 的修訂版本。

capabilities.canReadTeamDrive
(deprecated)

boolean

已淘汰:僅限輸出。請改用 canReadDrive

capabilities.canMoveTeamDriveItem
(deprecated)

boolean

已淘汰:僅限輸出。請改用 canMoveItemWithinDrivecanMoveItemOutOfDrive

capabilities.canChangeCopyRequiresWriterPermission

boolean

僅供輸出。目前的使用者是否可以變更這個檔案的 copyRequiresWriterPermission 限制。

capabilities.canMoveItemIntoTeamDrive
(deprecated)

boolean

已淘汰:僅限輸出。請改用 canMoveItemOutOfDrive

capabilities.canUntrash

boolean

僅供輸出。目前的使用者能否從垃圾桶還原這個檔案。

capabilities.canModifyContent

boolean

僅供輸出。目前的使用者能否修改這個檔案的內容。

capabilities.canMoveItemWithinTeamDrive
(deprecated)

boolean

已淘汰:僅限輸出。請改用 canMoveItemWithinDrive

capabilities.canMoveItemOutOfTeamDrive
(deprecated)

boolean

已淘汰:僅限輸出。請改用 canMoveItemOutOfDrive

capabilities.canDeleteChildren

boolean

僅供輸出。目前的使用者能否刪除這個資料夾的子項。如果該項目不是資料夾,則此為 false。僅針對共用雲端硬碟中的項目填入資料。

capabilities.canMoveChildrenOutOfTeamDrive
(deprecated)

boolean

已淘汰:僅限輸出。請改用 canMoveChildrenOutOfDrive

capabilities.canMoveChildrenWithinTeamDrive
(deprecated)

boolean

已淘汰:僅限輸出。請改用 canMoveChildrenWithinDrive

capabilities.canTrashChildren

boolean

僅供輸出。目前的使用者是否可以將這個資料夾的子項移至垃圾桶。如果該項目不是資料夾,則此為 false。僅針對共用雲端硬碟中的項目填入資料。

capabilities.canMoveItemOutOfDrive

boolean

僅供輸出。目前的使用者能否變更父項,藉此將這個項目移出這個雲端硬碟。請注意,視要新增的新父項而定,變更項目父項的要求仍可能失敗。

capabilities.canAddMyDriveParent

boolean

僅供輸出。目前的使用者是否可以在同一個要求中為項目新增父項,而不必移除現有父項。不會為共用雲端硬碟檔案填入資料。

capabilities.canRemoveMyDriveParent

boolean

僅供輸出。目前的使用者是否可以在同一個要求中移除上層項目,而不必新增另一個父項。不會為共用雲端硬碟檔案填入資料。

capabilities.canMoveItemWithinDrive

boolean

僅供輸出。目前的使用者能否在這個雲端硬碟中移動這個項目。請注意,視要新增的新父項和要移除的父項而定,變更項目父項的要求仍可能失敗。

capabilities.canShare

boolean

僅供輸出。目前使用者是否可以修改這個檔案的共用設定。

capabilities.canMoveChildrenWithinDrive

boolean

僅供輸出。目前的使用者是否可以在這個雲端硬碟中移動這個資料夾的子項。如果該項目不是資料夾,則此為 false。請注意,根據目前使用者對子資料夾和目標資料夾的存取權,移動子項的要求仍可能失敗。

capabilities.canModifyContentRestriction
(deprecated)

boolean

已淘汰:僅限輸出。請使用 canModifyEditorContentRestrictioncanModifyOwnerContentRestrictioncanRemoveContentRestriction 其中之一。

capabilities.canAddFolderFromAnotherDrive

boolean

僅供輸出。目前的使用者能否將其他雲端硬碟 (不同共用雲端硬碟或「我的雲端硬碟」) 的資料夾新增至這個資料夾。如果該項目不是資料夾,則此為 false。僅針對共用雲端硬碟中的項目填入資料。

capabilities.canChangeSecurityUpdateEnabled

boolean

僅供輸出。指定目前的使用者能否變更連結共用中繼資料的 securityUpdateEnabled 欄位。

capabilities.canAcceptOwnership

boolean

僅供輸出。目前的使用者是否為檔案待審核的擁有者。不會為共用雲端硬碟檔案填入資料。

capabilities.canReadLabels

boolean

僅供輸出。目前使用者是否可讀取檔案中的標籤。

capabilities.canModifyLabels

boolean

僅供輸出。目前的使用者能否修改檔案中的標籤。

capabilities.canModifyEditorContentRestriction

boolean

僅供輸出。目前的使用者是否可以針對受到編輯器限制的檔案新增或修改內容限制。

capabilities.canModifyOwnerContentRestriction

boolean

僅供輸出。目前的使用者是否可以新增或修改擁有者限制的內容限制。

capabilities.canRemoveContentRestriction

boolean

僅供輸出。目前的使用者可移除檔案的內容限制。

hasAugmentedPermissions

boolean

僅供輸出。是否直接對這個檔案具備權限。系統只會針對共用雲端硬碟中的項目填入這個欄位。

trashingUser

object (User)

僅供輸出。如果檔案已明確移至垃圾桶,使用者即移至垃圾桶。僅針對共用雲端硬碟中的項目填入資料。

thumbnailVersion

string (int64 format)

僅供輸出。用於縮圖快取撤銷作業的縮圖版本。

trashedTime

string

僅供輸出。項目移至垃圾桶的時間 (RFC 3339 日期時間)。僅針對共用雲端硬碟中的項目填入資料。

modifiedByMe

boolean

僅供輸出。檔案是否已由這位使用者修改。

permissionIds[]

string

僅供輸出。使用者擁有這個檔案的存取權時,可以取得權限 ID 的 files.list。

imageMediaMetadata

object

僅供輸出。圖片媒體的其他中繼資料 (如有)。

imageMediaMetadata.flashUsed

boolean

僅供輸出。是否使用閃光燈來製作相片。

imageMediaMetadata.meteringMode

string

僅供輸出。用來建立相片的計量模式。

imageMediaMetadata.sensor

string

僅供輸出。用來建立相片的感應器類型。

imageMediaMetadata.exposureMode

string

僅供輸出。用於建立相片的曝光模式。

imageMediaMetadata.colorSpace

string

僅供輸出。相片的色彩空間。

imageMediaMetadata.whiteBalance

string

僅供輸出。用於建立相片的白平衡模式。

imageMediaMetadata.width

integer

僅供輸出。圖片寬度 (以像素為單位)。

imageMediaMetadata.height

integer

僅供輸出。圖片的高度 (以像素為單位)。

imageMediaMetadata.location

object

僅供輸出。圖片中儲存的地理位置資訊。

imageMediaMetadata.location.latitude

number

僅供輸出。儲存在圖片中的緯度。

imageMediaMetadata.location.longitude

number

僅供輸出。儲存在圖片中的經度。

imageMediaMetadata.location.altitude

number

僅供輸出。圖片中儲存的海拔高度。

imageMediaMetadata.rotation

integer

僅供輸出。圖片原始方向套用的順時針 90 度旋轉次數。

imageMediaMetadata.time

string

僅供輸出。相片的拍攝日期和時間 (EXIF 日期時間)。

imageMediaMetadata.cameraMake

string

僅供輸出。用於建立相片的相機鏡頭。

imageMediaMetadata.cameraModel

string

僅供輸出。用於建立相片的相機模型。

imageMediaMetadata.exposureTime

number

僅供輸出。曝光的時間長度 (以秒為單位)。

imageMediaMetadata.aperture

number

僅供輸出。用來建立相片的光圈 (f-number)。

imageMediaMetadata.focalLength

number

僅供輸出。製作相片時使用的焦距 (以公釐為單位)。

imageMediaMetadata.isoSpeed

integer

僅供輸出。建立相片時使用的 ISO 速度。

imageMediaMetadata.exposureBias

number

僅供輸出。相片的曝光偏誤 (APEX 值)。

imageMediaMetadata.maxApertureValue

number

僅供輸出。產生相片時使用的鏡頭焦距最小 F 數 (APEX 值)。

imageMediaMetadata.subjectDistance

integer

僅供輸出。相片主體的距離 (公尺)。

imageMediaMetadata.lens

string

僅供輸出。用來製作相片的鏡頭。

videoMediaMetadata

object

僅供輸出。影片媒體的其他中繼資料。上傳後可能無法立即顯示這項資訊。

videoMediaMetadata.width

integer

僅供輸出。影片寬度 (以像素為單位)。

videoMediaMetadata.height

integer

僅供輸出。影片的高度 (以像素為單位)。

videoMediaMetadata.durationMillis

string (int64 format)

僅供輸出。影片的時間長度 (以毫秒為單位)。

shortcutDetails

object

捷徑檔案詳細資料。只會為捷徑檔案填入 mimeType 欄位設為 application/vnd.google-apps.shortcut 的捷徑。只能針對 files.create 要求進行設定。

shortcutDetails.targetId

string

這個捷徑指向的檔案 ID。只能針對 files.create 要求進行設定。

shortcutDetails.targetMimeType

string

僅供輸出。這個捷徑所指向的檔案 MIME 類型。這個欄位的值是建立捷徑時擷取的目標 MIME 類型快照。

shortcutDetails.targetResourceKey

string

僅供輸出。目標檔案的 ResourceKey。

contentRestrictions[]

object (ContentRestriction)

檔案內容的存取限制。只有在有這類限制時才填入資料。

resourceKey

string

僅供輸出。必須透過共用連結才能存取項目。

linkShareMetadata.securityUpdateEligible

boolean

僅供輸出。檔案是否符合安全性更新資格。

linkShareMetadata.securityUpdateEnabled

boolean

僅供輸出。是否已啟用這個檔案的安全性更新。

labelInfo

object

僅供輸出。檔案標籤總覽。

labelInfo.labels[]

object (Label)

僅供輸出。檔案中的標籤組合 (由 includeLabels 參數中的標籤 ID 要求)。根據預設,系統不會傳回任何標籤。

sha1Checksum

string

僅供輸出。與這個檔案相關聯的 SHA1 總和檢查碼 (如有)。只有存放 Google 雲端硬碟內容的檔案會填入這個欄位;文件編輯器或捷徑檔案不會填入這個欄位。

sha256Checksum

string

僅供輸出。與這個檔案相關聯的 SHA256 總和檢查碼 (如果有的話)。只有存放 Google 雲端硬碟內容的檔案會填入這個欄位;文件編輯器或捷徑檔案不會填入這個欄位。

ContentRestriction

檔案內容的存取限制。

JSON 表示法
{
  "readOnly": boolean,
  "reason": string,
  "type": string,
  "restrictingUser": {
    object (User)
  },
  "restrictionTime": string,
  "ownerRestricted": boolean,
  "systemRestricted": boolean
}
欄位
readOnly

boolean

檔案內容是否為唯讀。如果檔案處於唯讀狀態,就無法加入新修訂版本、不可新增或修改註解,且檔案名稱不可修改。

reason

string

檔案內容受限的原因。這僅適用於同樣設定 readOnly=true 的要求。

type

string

僅供輸出。內容限制的類型。目前唯一可使用的值為 globalContentRestriction

restrictingUser

object (User)

僅供輸出。設定內容限制的使用者。只有在 readOnly 為 true 時才會填入值。

restrictionTime

string

僅供輸出。設定內容限制的時間 (格式為 RFC 3339 時間戳記)。只有在 readOnly 為 true 時才會填入值。

ownerRestricted

boolean

內容限制是否只能由擁有該檔案的使用者修改或移除。如果是共用雲端硬碟中的檔案,凡是具備 organizer 功能的使用者,都能修改或移除這項內容限制。

systemRestricted

boolean

僅供輸出。內容限制是否由系統套用,例如因電子簽名。使用者無法修改或移除系統受限內容限制。

方法

copy

建立檔案副本,並使用 patch 語意套用所有要求的更新。

create

建立新檔案。

delete

永久刪除使用者擁有的檔案,而不移至垃圾桶。

emptyTrash

永久刪除使用者移至垃圾桶的所有檔案。

export

將 Google Workspace 文件匯出為要求的 MIME 類型,並傳回匯出的位元組內容。

generateIds

產生一組可在建立或複製要求中提供的檔案 ID。

get

根據 ID 取得檔案的中繼資料或內容。

list

列出使用者的檔案。

listLabels

列出檔案中的標籤。

modifyLabels

修改檔案套用的標籤組合。

update

更新檔案的中繼資料和/或內容。

watch

訂閱檔案變更。