REST Resource: files

資源:檔案

檔案的中繼資料。

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

JSON 表示法
{
  "kind": string,
  "userPermission": {
    object (Permission)
  },
  "fileExtension": string,
  "md5Checksum": string,
  "selfLink": string,
  "ownerNames": [
    string
  ],
  "lastModifyingUserName": string,
  "editable": boolean,
  "writersCanShare": boolean,
  "downloadUrl": string,
  "mimeType": string,
  "exportLinks": {
    string: string,
    ...
  },
  "driveId": string,
  "parents": [
    {
      object (ParentReference)
    }
  ],
  "thumbnailLink": string,
  "appDataContents": boolean,
  "webViewLink": string,
  "iconLink": string,
  "shared": boolean,
  "lastModifyingUser": {
    object (User)
  },
  "owners": [
    {
      object (User)
    }
  ],
  "openWithLinks": {
    string: string,
    ...
  },
  "defaultOpenWithLink": string,
  "headRevisionId": string,
  "properties": [
    {
      object (Property)
    }
  ],
  "copyable": boolean,
  "etag": string,
  "sharingUser": {
    object (User)
  },
  "alternateLink": string,
  "embedLink": string,
  "webContentLink": string,
  "fileSize": string,
  "copyRequiresWriterPermission": boolean,
  "permissions": [
    {
      object (Permission)
    }
  ],
  "hasThumbnail": boolean,
  "spaces": [
    string
  ],
  "folderColorRgb": string,
  "id": string,
  "title": string,
  "description": string,
  "labels": {
    "viewed": boolean,
    "restricted": boolean,
    "starred": boolean,
    "hidden": boolean,
    "trashed": boolean,
    "modified": boolean
  },
  "explicitlyTrashed": boolean,
  "createdDate": string,
  "modifiedDate": string,
  "modifiedByMeDate": string,
  "lastViewedByMeDate": string,
  "markedViewedByMeDate": string,
  "sharedWithMeDate": string,
  "quotaBytesUsed": string,
  "version": string,
  "indexableText": {
    "text": string
  },
  "originalFilename": string,
  "ownedByMe": boolean,
  "canComment": boolean,
  "shareable": boolean,
  "fullFileExtension": string,
  "isAppAuthorized": boolean,
  "teamDriveId": string,
  "capabilities": {
    "canChangeRestrictedDownload": 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)
  },
  "canReadRevisions": boolean,
  "thumbnailVersion": string,
  "trashedDate": string,
  "permissionIds": [
    string
  ],
  "thumbnail": {
    "image": string,
    "mimeType": 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,
    "date": 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

userPermission

object (Permission)

僅供輸出。這個檔案中已驗證使用者的權限。

fileExtension

string

僅供輸出。fullFileExtension 的最後一個元件,結尾文字似乎不屬於擴充功能的一部分。這個欄位只會針對儲存在 Google 雲端硬碟中的檔案填入內容,系統不會針對文件編輯器或捷徑檔案填入資料。

md5Checksum

string

僅供輸出。這個檔案內容的 MD5 總和檢查碼。這個欄位只會針對儲存在 Google 雲端硬碟中的檔案填入內容,系統不會針對文件編輯器或捷徑檔案填入資料。

ownerNames[]

string

僅供輸出。這個檔案擁有者的名稱。系統不會為共用雲端硬碟中的項目填入資料。

lastModifyingUserName

string

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

editable
(deprecated)

boolean

僅供輸出。已淘汰:請改用 capabilities/canEdit

writersCanShare

boolean

寫入者能否與其他使用者共用文件。系統不會為共用雲端硬碟中的項目填入資料。

downloadUrl

string

僅供輸出。檔案的簡短下載網址。這個欄位只會針對儲存在 Google 雲端硬碟中的內容填入檔案,不會針對 Google 文件或捷徑檔案填入資料。

mimeType

string

檔案的 MIME 類型。只有在上傳新內容時,才需要變動內容。這個欄位可以留空,系統會根據上傳內容的 MIME 類型決定 MIME 類型。

driveId

string

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

parents[]

object (ParentReference)

含有這個檔案的上層資料夾集合。

如未在插入要求中指定,檔案會直接放在使用者的「我的雲端硬碟」資料夾中。如未在複製要求中指定,檔案會繼承來源檔案所有可供搜尋的父項。file.update 要求也可以使用 addParentsremoveParents 參數修改父項清單。

appDataContents

boolean

僅供輸出。這個檔案是否在「Application Data」資料夾中。

shared

boolean

僅供輸出。檔案是否已共用。系統不會為共用雲端硬碟中的項目填入資料。

lastModifyingUser

object (User)

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

owners[]

object (User)

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

headRevisionId

string

僅供輸出。檔案首修訂版本的 ID。這個欄位只會針對儲存在 Google 雲端硬碟中的檔案填入內容,系統不會針對文件編輯器或捷徑檔案填入資料。

properties[]

object (Property)

屬性清單。

copyable
(deprecated)

boolean

僅供輸出。已淘汰:請改用 capabilities/canCopy

etag

string

僅供輸出。檔案的 ETag。

sharingUser

object (User)

僅供輸出。與目前使用者共用項目的使用者 (如果有的話)。

fileSize

string (int64 format)

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

copyRequiresWriterPermission

boolean

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

permissions[]

object (Permission)

僅供輸出。有權存取這個檔案的使用者權限清單。系統不會為共用雲端硬碟中的項目填入資料。

hasThumbnail

boolean

僅供輸出。這個檔案是否有縮圖。但這並不代表提出要求的應用程式是否能存取縮圖。如要確認存取權,請檢查是否有縮圖連結欄位。

spaces[]

string

僅供輸出。包含該檔案的聊天室清單。支援的值為 driveappDataFolderphotos

folderColorRgb

string

如果檔案是資料夾或資料夾捷徑,則以 RGB 十六進位字串格式呈現資料夾顏色。支援顏色的清單會出現在「About」資源的「folderColorPalette」欄位中。如果指定不支援的顏色,會在調色盤中變更為最接近的顏色。

id

string

檔案的 ID。

title

string

這個檔案的標題。請注意,對於不可變更的項目,例如共用雲端硬碟的頂層資料夾、「我的雲端硬碟」根資料夾和「應用程式資料」資料夾,標題會維持不變。

description

string

關於檔案的簡要說明。

labels

object

檔案的一組標籤。

labels.viewed

boolean

使用者是否檢視過這個檔案。

labels.restricted
(deprecated)

boolean

僅供輸出。已淘汰:請改用 copyRequiresWriterPermission

labels.starred

boolean

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

labels.hidden
(deprecated)

boolean

僅供輸出。已淘汰。

labels.trashed

boolean

這個檔案是否已移至垃圾桶。這個標籤會套用至所有使用者,但只有擁有者可以查看及移出檔案。

labels.modified

boolean

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

explicitlyTrashed

boolean

僅供輸出。這個檔案是否已明確移至垃圾桶,而非週期性移至垃圾桶。

createdDate

string

僅供輸出。這個檔案的建立時間 (格式化 RFC 3339 時間戳記)。

modifiedDate

string

任何人上次修改這個檔案的時間 (格式化的 RFC 3339 時間戳記)。只有在已設定 setModifiedDate 參數時,這項變更才會變更。

modifiedByMeDate

string

僅供輸出。使用者上次修改這個檔案的時間 (格式化的 RFC 3339 時間戳記)。請注意,設定 editDate 後,系統也會為設定日期的使用者更新 modifyByMe 日期。

lastViewedByMeDate

string

使用者上次檢視這個檔案的時間 (格式化的 RFC 3339 時間戳記)。

markedViewedByMeDate
(deprecated)

string

僅供輸出。已淘汰。

sharedWithMeDate

string

僅供輸出。與使用者共用檔案的時間 (格式化 RFC 3339 時間戳記)。

quotaBytesUsed

string (int64 format)

僅供輸出。這個檔案使用的配額位元組數。

version

string (int64 format)

僅供輸出。檔案的單調遞增版本號碼。這反映了伺服器上對檔案所做的所有變更,即使是提出要求的使用者看不見這些變更,也包含在內。

indexableText

object

檔案的可建立索引文字屬性 (只能寫入)

indexableText.text

string

要為這個檔案建立索引的文字。

originalFilename

string

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

ownedByMe

boolean

僅供輸出。檔案是否由目前使用者所擁有。系統不會為共用雲端硬碟中的項目填入資料。

canComment
(deprecated)

boolean

僅供輸出。已淘汰:請改用 capabilities/canComment

shareable
(deprecated)

boolean

僅供輸出。已淘汰:請改用 capabilities/canShare

fullFileExtension

string

僅供輸出。從標題中擷取的完整副檔名。可能包含多個串連的擴充功能,例如「tar.gz」。移除標題中的副檔名並不會清除這個欄位;但變更標題的副檔名,就會更新這個欄位。這個欄位只會針對儲存在 Google 雲端硬碟中的檔案填入內容,系統不會針對文件編輯器或捷徑檔案填入資料。

isAppAuthorized

boolean

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

teamDriveId
(deprecated)

string

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

capabilities

object

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

capabilities.canChangeRestrictedDownload
(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)

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

canReadRevisions
(deprecated)

boolean

僅供輸出。已淘汰:請改用 capabilities/canReadRevisions

thumbnailVersion

string (int64 format)

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

trashedDate

string

僅供輸出。項目移至垃圾桶的時間 (格式化 RFC 3339 時間戳記)。只有共用雲端硬碟中的項目才會填入資料。

permissionIds[]

string

僅限輸出。file.list 權限 ID 適用於擁有此檔案存取權的使用者。

thumbnail

object

檔案的縮圖。只有在無法產生標準縮圖時,系統才會使用這個縮圖。

thumbnail.image

string (bytes format)

縮圖的安全網址 Base64 編碼位元組。必須符合 RFC 4648 第 5 節的規定。

Base64 編碼的字串。

thumbnail.mimeType

string

縮圖的 MIME 類型。

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.date

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 的捷徑檔案填入資料。

shortcutDetails.targetId

string

這個捷徑指向的檔案 ID。

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)
  },
  "restrictionDate": string,
  "ownerRestricted": boolean,
  "systemRestricted": boolean
}
欄位
readOnly

boolean

檔案內容是否為唯讀狀態。如果檔案為唯讀狀態,則可能無法新增該檔案的修訂版本、註解可能無法新增或修改,且檔案標題也可能無法修改。

reason

string

檔案內容受限原因。只有在要求也設定 readOnly=true 時,才需要變動內容。

type

string

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

restrictingUser

object (User)

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

restrictionDate

string

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

ownerRestricted

boolean

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

systemRestricted

boolean

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

方法

copy

建立指定檔案的副本。

delete

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

emptyTrash

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

export

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

generateIds

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

get

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

insert

插入新檔案。

list

列出使用者的檔案。

listLabels

列出檔案的標籤。

modifyLabels

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

patch

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

touch

將檔案的更新時間設為目前的伺服器時間。

trash

將檔案移至垃圾桶。

untrash

還原垃圾桶中的檔案。

update

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

watch

訂閱檔案變更。