REST Resource: projects.locations.dataStores.documents

資源:Document

文件是擷取至資料儲存庫的單一內容單位。是 DataStore 的子資源。擷取期間,系統會剖析文件並切成一或多個區塊。

JSON 表示法
{
  "name": string,
  "createTime": string,
  "updateTime": string,
  "content": {
    object (Content)
  },
  "etag": string,
  "metadata": {
    object (DocumentMetadata)
  }
}
欄位
name

string

ID。文件的完整資源名稱。

格式:projects/{project}/locations/{location}/dataStores/{dataStoreId}/documents/{documentId} documentId 的長度必須介於 1 至 63 個字元之間,且符合 RFC1035 規定。

ImportDocuments 直接匯入檔案 (預設來源格式) 時,服務會從檔案的 Cloud Storage URI 衍生 documentId:重新匯入相同的 URI 會更新相同的文件,而重新命名或移動的檔案會成為新文件。使用 SOURCE_FORMAT_DOCUMENT_JSON 時,documentId 會取自輸入檔案中提供的 name。

createTime

string (Timestamp format)

僅供輸出。文件建立時間的時間戳記。

使用 RFC 3339,產生的輸出內容一律會經過 Z 正規化,並使用 0、3、6 或 9 個小數位數,也接受「Z」以外的偏移量。範例:"2014-10-02T15:01:23Z"、"2014-10-02T15:01:23.045123456Z" 或 "2014-10-02T15:01:23+05:30"。

updateTime

string (Timestamp format)

僅供輸出。文件上次更新的時間戳記。

使用 RFC 3339,產生的輸出內容一律會經過 Z 正規化,並使用 0、3、6 或 9 個小數位數,也接受「Z」以外的偏移量。範例:"2014-10-02T15:01:23Z"、"2014-10-02T15:01:23.045123456Z" 或 "2014-10-02T15:01:23+05:30"。

content

object (Content)

選用。與這份文件連結的非結構化資料:匯入來源 Cloud Storage 檔案。SOURCE_FORMAT_DOCUMENT_JSON 輸入檔案的每一行都必須包含這個欄位。

etag

string

選用。文件的 etag。

metadata

object (DocumentMetadata)

選用。這份文件的使用者定義中繼資料。中繼資料值必須符合父項 DataStore 定義的 documentMetadataSchema。

內容

連結至這份文件的非結構化資料。

JSON 表示法
{

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "gcsUri": string
  // End of mutually exclusive fields.
}
欄位
非結構化文件的內容。以下是互斥欄位清單。回應中最多會設定下列其中一個欄位:
gcsUri

string

內容的 Cloud Storage URI。僅支援 Cloud Storage URI (例如 gs://bucket-name/path/to/file)。

互斥欄位結束。

DocumentMetadata

與文件相關聯的使用者定義中繼資料。

JSON 表示法
{
  "value": {
    object
  }
}
欄位
value

object (Struct format)

選用。中繼資料值,以 JSON 物件表示。這個值必須符合父項 DataStore 定義的 documentMetadataSchema。

方法

get

取得文件。

list

列出 DataStore 中的文件。
搜尋單一 DataStore 的文件。