REST Resource: files

資源:File

檔案的中繼資料。

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

JSON 表示法
{
  "ownerNames": [
    string
  ],
  "exportLinks": {
    string: string,
    ...
  },
  "parents": [
    {
      object (ParentReference)
    }
  ],
  "owners": [
    {
      object (User)
    }
  ],
  "openWithLinks": {
    string: string,
    ...
  },
  "properties": [
    {
      object (Property)
    }
  ],
  "permissions": [
    {
      object (Permission)
    }
  ],
  "spaces": [
    string
  ],
  "permissionIds": [
    string
  ],
  "contentRestrictions": [
    {
      object (ContentRestriction)
    }
  ],
  "kind": string,
  "userPermission": {
    object (Permission)
  },
  "fileExtension": string,
  "md5Checksum": string,
  "selfLink": string,
  "lastModifyingUserName": string,
  "editable": boolean,
  "writersCanShare": boolean,
  "downloadUrl": string,
  "mimeType": string,
  "driveId": string,
  "thumbnailLink": string,
  "appDataContents": boolean,
  "webViewLink": string,
  "iconLink": string,
  "shared": boolean,
  "lastModifyingUser": {
    object (User)
  },
  "defaultOpenWithLink": string,
  "headRevisionId": string,
  "copyable": boolean,
  "etag": string,
  "sharingUser": {
    object (User)
  },
  "alternateLink": string,
  "embedLink": string,
  "webContentLink": string,
  "fileSize": string,
  "copyRequiresWriterPermission": boolean,
  "hasThumbnail": boolean,
  "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,
    "canDisableInheritedPermissions": boolean,
    "canEnableInheritedPermissions": boolean
  },
  "hasAugmentedPermissions": boolean,
  "trashingUser": {
    object (User)
  },
  "canReadRevisions": boolean,
  "thumbnailVersion": string,
  "trashedDate": 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
  },
  "resourceKey": string,
  "linkShareMetadata": {
    "securityUpdateEligible": boolean,
    "securityUpdateEnabled": boolean
  },
  "labelInfo": {
    "labels": [
      {
        object (Label)
      }
    ]
  },
  "sha1Checksum": string,
  "sha256Checksum": string,
  "inheritedPermissionsDisabled": boolean
}
欄位
ownerNames[]

string

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

parents[]

object (ParentReference)

含有該檔案的上層資料夾 ID。

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

如果未在插入要求中指定,檔案會直接放在使用者的「我的雲端硬碟」資料夾中。如果未在複製要求中指定,檔案會沿用來源檔案可探索到的任何上層項目。files.update 要求必須使用 addParentsremoveParents 參數來修改上層項目清單。

owners[]

object (User)

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

properties[]

object (Property)

屬性清單。

permissions[]

object (Permission)

僅供輸出。這份清單列出有權存取這個檔案的使用者,共用雲端硬碟中的項目不會填入這項資訊。

spaces[]

string

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

permissionIds[]

string

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

contentRestrictions[]

object (ContentRestriction)

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

kind

string

僅供輸出。檔案類型。這個值一律為 drive#file

userPermission

object (Permission)

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

fileExtension

string

僅供輸出。fullFileExtension 的最後一個組成部分,並移除結尾不屬於副檔名的文字。這個欄位只會填入儲存在 Google 雲端硬碟中的檔案內容,不會填入文件編輯器或捷徑檔案。

md5Checksum

string

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

lastModifyingUserName

string

僅供輸出。上次修改這個檔案的使用者名稱。

editable
(deprecated)

boolean

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

writersCanShare

boolean

撰稿人是否可以與其他使用者共用文件。共用雲端硬碟中的項目不會填入這項資訊。

downloadUrl

string

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

mimeType

string

檔案的 MIME 類型。上傳新內容時,只能在更新時變更這項設定。這個欄位可以留空,系統會根據上傳內容的 MIME 類型判斷 MIME 類型。

driveId

string

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

appDataContents

boolean

僅供輸出。這個檔案是否位於「應用程式資料」資料夾中。

shared

boolean

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

lastModifyingUser

object (User)

僅供輸出。上次修改這個檔案的使用者。只有在上次修改是由已登入的使用者執行時,系統才會填寫這個欄位。

headRevisionId

string

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

copyable
(deprecated)

boolean

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

etag

string

僅供輸出。檔案的 ETag。

sharingUser

object (User)

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

fileSize

string (int64 format)

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

copyRequiresWriterPermission

boolean

是否要禁止讀者和加註者複製、列印或下載這個檔案。

hasThumbnail

boolean

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

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 時間戳記格式)。請注意,設定 modifiedDate 也會更新設定日期的使用者之 modifiedByMe 日期。

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

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

capabilities.canDisableInheritedPermissions

boolean

僅供輸出。使用者是否可以停用沿用權限。

capabilities.canEnableInheritedPermissions

boolean

僅供輸出。使用者是否可以重新啟用沿用權限。

hasAugmentedPermissions

boolean

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

trashingUser

object (User)

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

canReadRevisions
(deprecated)

boolean

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

thumbnailVersion

string (int64 format)

僅供輸出。用於縮圖快取失效的縮圖版本。

trashedDate

string

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

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 值)。

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.insert 要求中設定。

shortcutDetails.targetId

string

捷徑指向的檔案 ID。只能在 files.insert 要求中設定。

shortcutDetails.targetMimeType

string

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

shortcutDetails.targetResourceKey

string

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

resourceKey

string

僅供輸出。透過共用連結存取項目時所需的金鑰。

linkShareMetadata.securityUpdateEligible

boolean

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

linkShareMetadata.securityUpdateEnabled

boolean

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

labelInfo

object

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

labelInfo.labels[]

object (Label)

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

sha1Checksum

string

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

sha256Checksum

string

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

inheritedPermissionsDisabled

boolean

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

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

訂閱檔案變更。