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

string

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

userPermission

object (Permission)

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

fileExtension

string

僅供輸出。fullFileExtension 的最後一個組成部分,其中包含尾隨文字,但該文字似乎不是副檔名一部分,因此已移除。這個欄位只會為內容儲存在 Google 雲端硬碟中的檔案填入資料,不會為 Google 文件編輯器或捷徑檔案填入資料。

md5Checksum

string

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

ownerNames[]

string

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

lastModifyingUserName

string

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

editable
(deprecated)

boolean

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

writersCanShare

boolean

作者是否可以與其他使用者共用文件。不會填入共用雲端硬碟中的項目。

downloadUrl

string

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

mimeType

string

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

driveId

string

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

parents[]

object (ParentReference)

包含檔案的父項資料夾 ID。

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

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

appDataContents

boolean

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

shared

boolean

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

lastModifyingUser

object (User)

僅供輸出。上次修改這個檔案的使用者。只有在登入使用者上次修改時,這個欄位才會填入資料。

owners[]

object (User)

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

headRevisionId

string

僅供輸出。檔案主修訂版本的 ID。這個欄位只會為儲存在 Google 雲端硬碟中的檔案填入內容,不會為 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

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

spaces[]

string

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

folderColorRgb

string

如果檔案是資料夾或資料夾的捷徑,則資料夾顏色會以 RGB 十六進位字串的形式顯示。如要查看支援的顏色清單,請在「關於」資源的 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 雲端硬碟的檔案,不會填入 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 時間戳記格式)。只有共用雲端硬碟中的項目會填入這項資料。

permissionIds[]

string

僅供輸出。files.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

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

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

僅供輸出。用於拍攝相片的焦距下,鏡頭的最小光圈值 (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。

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)
  },
  "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

訂閱檔案變更。