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,
    "canDisableInheritedPermissions": boolean,
    "canEnableInheritedPermissions": 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,
  "inheritedPermissionsDisabled": boolean
}
欄位
kind

string

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

driveId

string

僅供輸出。檔案所屬的共用雲端硬碟 ID。只有共用雲端硬碟中的項目會填入這項資料。

fileExtension

string

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

copyRequiresWriterPermission

boolean

是否應停用讀者和評論者的檔案複製、列印或下載選項。

md5Checksum

string

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

contentHints

object

檔案內容的其他資訊。這些欄位不會填入回應。

contentHints.indexableText

string

要為檔案建立索引的文字,以改善全文查詢。長度上限為 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。

檔案只能有一個父項資料夾,系統不支援指定多個父項。

如果未在建立要求中指定,檔案會直接放入使用者的「我的雲端硬碟」資料夾。如果未在複製要求中指定,檔案會繼承來源檔案的任何可探索的父項。files.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

僅供輸出。這個檔案是否有縮圖。這不會指出要求應用程式是否有權存取縮圖。如要檢查存取權,請查看是否有 thumbnailLink 欄位。

spaces[]

string

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

folderColorRgb

string

資料夾或資料夾捷徑的顏色,以 RGB 十六進位字串表示。支援的顏色會發布在 About 資源的 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

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

capabilities.canDisableInheritedPermissions

boolean

使用者是否可以停用沿用權限。

capabilities.canEnableInheritedPermissions

boolean

使用者是否可以重新啟用沿用權限。

hasAugmentedPermissions

boolean

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

trashingUser

object (User)

僅供輸出。如果檔案已明確放入垃圾桶,則為放入垃圾桶的使用者。只有共用雲端硬碟中的項目會填入這項資料。

thumbnailVersion

string (int64 format)

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

trashedTime

string

僅供輸出。項目遭到刪除的時間 (RFC 3339 日期時間)。只有共用雲端硬碟中的項目會填入這項資料。

modifiedByMe

boolean

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

permissionIds[]

string

僅供輸出。files.list 是具有此檔案存取權的使用者權限 ID。

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

僅供輸出。從圖片原始方向順時針旋轉的次數。

imageMediaMetadata.time

string

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

imageMediaMetadata.cameraMake

string

僅供輸出。用於拍攝相片的相機品牌。

imageMediaMetadata.cameraModel

string

僅供輸出。用於拍攝相片的相機型號。

imageMediaMetadata.exposureTime

number

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

imageMediaMetadata.aperture

number

僅供輸出。用於拍攝相片的光圈 (f 值)。

imageMediaMetadata.focalLength

number

僅供輸出。用於建立相片的焦距,以毫米為單位。

imageMediaMetadata.isoSpeed

integer

僅供輸出。用於拍攝相片的 ISO 速度。

imageMediaMetadata.exposureBias

number

僅供輸出。相片的曝光補償 (APEX 值)。

imageMediaMetadata.maxApertureValue

number

僅供輸出。用於拍攝相片的焦距下,鏡頭的最小光圈值 (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 雲端硬碟中的檔案填入內容,不會為 Google 文件編輯器或捷徑檔案填入內容。

sha256Checksum

string

僅供輸出。與此檔案相關聯的 SHA256 檢查碼 (如有)。這個欄位只會為內容儲存在 Google 雲端硬碟中的檔案填入資料,不會為 Google 文件編輯器或捷徑檔案填入資料。

inheritedPermissionsDisabled

boolean

這個檔案是否已停用繼承權限。沿用權限預設為啟用。

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

建立檔案的副本,並套用任何要求的更新,並附上修補語意。

create

建立新檔案。

delete

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

download

下載檔案內容。

emptyTrash

永久刪除使用者所有已刪除的檔案。

export

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

generateIds

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

get

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

list

列出使用者的檔案。

listLabels

列出檔案中的標籤。

modifyLabels

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

update

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

watch

訂閱檔案變更。