Method: labels.delta

套用一組更新要求,產生新的草稿修訂版本,以便更新單一標籤。批次更新屬於全部或無效:如果有任何無效的更新要求,則不會套用任何變更。必須先發布產生的草稿修訂版本,才能與雲端硬碟項目搭配使用。

HTTP 要求

POST https://drivelabels.googleapis.com/v2/{name=labels/*}:delta

這個網址使用 gRPC 轉碼語法。

路徑參數

參數
name

string

必要欄位。要更新標籤的資源名稱。

要求主體

要求主體的資料會採用以下結構:

JSON 表示法
{
  "writeControl": {
    object (WriteControl)
  },
  "requests": [
    {
      object (Request)
    }
  ],
  "useAdminAccess": boolean,
  "view": enum (LabelView),
  "languageCode": string
}
欄位
writeControl

object (WriteControl)

可讓您控管寫入要求的執行方式。

requests[]

object (Request)

要套用至標籤的更新清單。系統會按照指定的順序套用要求。

useAdminAccess

boolean

如要使用使用者的管理員憑證,請設為 true。伺服器會先驗證使用者是否是該標籤的管理員,再授予存取權。

view

enum (LabelView)

如果有指定,系統只會傳回屬於指定檢視畫面的特定欄位。

languageCode

string

include_label_in_responsetrue 時,用於評估本地化欄位標籤的 BCP-47 語言代碼。

回應主體

如果成功,回應主體即會包含具有以下結構的資料:

標籤更新的回應。

JSON 表示法
{
  "responses": [
    {
      object (Response)
    }
  ],
  "updatedLabel": {
    object (Label)
  }
}
欄位
responses[]

object (Response)

更新的回覆。這會將 1:1 與更新內容對應,不過部分要求的回應可能為空白。

updatedLabel

object (Label)

套用更新後的標籤。只有在 [BatchUpdateLabelResponse2.include_label_in_response] 是 true 且沒有錯誤時,才需要設定這個屬性。

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/drive.labels
  • https://www.googleapis.com/auth/drive.admin.labels

詳情請參閱授權指南

要求

套用至單一標籤的一種更新。

JSON 表示法
{

  // Union field kind can be only one of the following:
  "updateLabel": {
    object (UpdateLabelPropertiesRequest)
  },
  "createField": {
    object (CreateFieldRequest)
  },
  "updateField": {
    object (UpdateFieldPropertiesRequest)
  },
  "updateFieldType": {
    object (UpdateFieldTypeRequest)
  },
  "enableField": {
    object (EnableFieldRequest)
  },
  "disableField": {
    object (DisableFieldRequest)
  },
  "deleteField": {
    object (DeleteFieldRequest)
  },
  "createSelectionChoice": {
    object (CreateSelectionChoiceRequest)
  },
  "updateSelectionChoiceProperties": {
    object (UpdateSelectionChoicePropertiesRequest)
  },
  "enableSelectionChoice": {
    object (EnableSelectionChoiceRequest)
  },
  "disableSelectionChoice": {
    object (DisableSelectionChoiceRequest)
  },
  "deleteSelectionChoice": {
    object (DeleteSelectionChoiceRequest)
  }
  // End of list of possible types for union field kind.
}
欄位
聯集欄位 kind。更新的類型。只需要一個欄位。kind 只能是下列其中一項:
updateLabel

object (UpdateLabelPropertiesRequest)

更新標籤屬性。

createField

object (CreateFieldRequest)

建立新欄位。

updateField

object (UpdateFieldPropertiesRequest)

更新欄位的基本屬性。

updateFieldType

object (UpdateFieldTypeRequest)

更新欄位類型和/或類型選項。

enableField

object (EnableFieldRequest)

啟用欄位。

disableField

object (DisableFieldRequest)

停用「欄位」

deleteField

object (DeleteFieldRequest)

從標籤中刪除欄位。

createSelectionChoice

object (CreateSelectionChoiceRequest)

在「選取」欄位中建立選擇。

updateSelectionChoiceProperties

object (UpdateSelectionChoicePropertiesRequest)

請更新選取欄位內的 Choice 屬性。

enableSelectionChoice

object (EnableSelectionChoiceRequest)

啟用選取欄位內的選項。

disableSelectionChoice

object (DisableSelectionChoiceRequest)

停用選取欄位內的選項。

deleteSelectionChoice

object (DeleteSelectionChoiceRequest)

可刪除選取欄位內的選項。

UpdateLabelPropertiesRequest

更新標籤的基本屬性。

JSON 表示法
{
  "updateMask": string,
  "properties": {
    object (Properties)
  }
}
欄位
updateMask

string (FieldMask format)

要更新的欄位。至少須指定一個欄位。根層級 label_properties 以隱含方式使用,因此不應該指定。您可以將單一 * 做為更新每個欄位的簡短檔案。

properties

object (Properties)

必要欄位。為要更新的資源加上標籤。

CreateFieldRequest

要求在標籤中建立欄位。

JSON 表示法
{
  "field": {
    object (Field)
  }
}
欄位
field

object (Field)

必要欄位。要建立的欄位。

UpdateFieldPropertiesRequest

要求更新欄位屬性。

JSON 表示法
{
  "updateMask": string,
  "id": string,
  "properties": {
    object (Properties)
  }
}
欄位
updateMask

string (FieldMask format)

要更新的欄位。至少須指定一個欄位。根層級 properties 以隱含方式使用,因此不應該指定。您可以將單一 * 做為更新每個欄位的簡短檔案。

id

string

必要欄位。要更新的欄位。

properties

object (Properties)

必要欄位。Basic Field 屬性。

UpdateFieldTypeRequest

要求變更欄位類型。

JSON 表示法
{
  "updateMask": string,
  "id": string,

  // Union field type_options can be only one of the following:
  "textOptions": {
    object (TextOptions)
  },
  "longTextOptions": {
    object (LongTextOptions)
  },
  "integerOptions": {
    object (IntegerOptions)
  },
  "dateOptions": {
    object (DateOptions)
  },
  "selectionOptions": {
    object (SelectionOptions)
  },
  "userOptions": {
    object (UserOptions)
  }
  // End of list of possible types for union field type_options.
}
欄位
updateMask

string (FieldMask format)

要更新的欄位。至少須指定一個欄位。type_options 的根會以隱含方式表示,因此不應指定。您可以將單一 * 做為更新每個欄位的簡短檔案。

id

string

必要欄位。要更新的欄位。

聯集欄位 type_options

type_options 只能採用下列其中一種設定:

textOptions

object (TextOptions)

將欄位更新為文字。

longTextOptions

object (LongTextOptions)

將欄位更新為「長文字」。

integerOptions

object (IntegerOptions)

將欄位更新為整數。

dateOptions

object (DateOptions)

將欄位更新為日期。

selectionOptions

object (SelectionOptions)

將欄位更新為「Selection」。

userOptions

object (UserOptions)

將欄位更新為「使用者」。

LongTextOptions

選擇「長文字」欄位類型。

JSON 表示法
{
  "minLength": integer,
  "maxLength": integer
}
欄位
minLength

integer

僅供輸出。文字欄位的值下限值。

maxLength

integer

僅供輸出。文字欄位的有效值長度上限。

EnableFieldRequest

要求啟用欄位。

JSON 表示法
{
  "id": string
}
欄位
id

string

必要欄位。要啟用的欄位 ID。

DisableFieldRequest

要求停用欄位。

JSON 表示法
{
  "updateMask": string,
  "id": string,
  "disabledPolicy": {
    object (DisabledPolicy)
  }
}
欄位
updateMask

string (FieldMask format)

要更新的欄位。至少須指定一個欄位。根層級 disabledPolicy 以隱含方式使用,因此不應該指定。您可以將單一 * 做為更新每個欄位的簡短檔案。

id

string

必要欄位。要停用的欄位鍵。

disabledPolicy

object (DisabledPolicy)

必要欄位。欄位已停用政策。

DeleteFieldRequest

要求刪除欄位。

JSON 表示法
{
  "id": string
}
欄位
id

string

必要欄位。要刪除的欄位 ID。

CreateSelectionChoiceRequest

要求建立選取項目。

JSON 表示法
{
  "fieldId": string,
  "choice": {
    object (Choice)
  }
}
欄位
fieldId

string

必要欄位。要在其建立選項的「Selection Field」(選取欄位)。

choice

object (Choice)

必要欄位。要建立的選擇。

UpdateSelectionChoicePropertiesRequest

要求更新 Choice 屬性。

JSON 表示法
{
  "updateMask": string,
  "fieldId": string,
  "id": string,
  "properties": {
    object (Properties)
  }
}
欄位
updateMask

string (FieldMask format)

要更新的欄位。至少須指定一個欄位。根層級 properties 以隱含方式使用,因此不應該指定。您可以將單一 * 做為更新每個欄位的簡短檔案。

fieldId

string

必要欄位。要更新的「Selection 」欄位。

id

string

必要欄位。要更新的選項。

properties

object (Properties)

必要欄位。要更新的 Choice 屬性。

EnableSelectionChoiceRequest

要求啟用選項。

JSON 表示法
{
  "fieldId": string,
  "id": string
}
欄位
fieldId

string

必要欄位。在何種情況下啟用選項的「選取欄位」。

id

string

必要欄位。選擇啟用。

DisableSelectionChoiceRequest

要求停用 Choice。

JSON 表示法
{
  "updateMask": string,
  "fieldId": string,
  "id": string,
  "disabledPolicy": {
    object (DisabledPolicy)
  }
}
欄位
updateMask

string (FieldMask format)

要更新的欄位。至少須指定一個欄位。根層級 disabledPolicy 以隱含方式使用,因此不應該指定。您可以將單一 * 做為更新每個欄位的簡短檔案。

fieldId

string

必要欄位。要停用選項的「Selection Field」(選取欄位)。

id

string

必要欄位。可選擇停用。

disabledPolicy

object (DisabledPolicy)

必要欄位。要更新的停用政策。

DeleteSelectionChoiceRequest

要求刪除選項。

JSON 表示法
{
  "fieldId": string,
  "id": string
}
欄位
fieldId

string

必要欄位。即將刪除選項的「Selection 欄位」。

id

string

必要欄位。刪除選項。

回應

來自更新的個別回應。

JSON 表示法
{

  // Union field response can be only one of the following:
  "updateLabel": {
    object (UpdateLabelPropertiesResponse)
  },
  "createField": {
    object (CreateFieldResponse)
  },
  "updateField": {
    object (UpdateFieldPropertiesResponse)
  },
  "updateFieldType": {
    object (UpdateFieldTypeResponse)
  },
  "enableField": {
    object (EnableFieldResponse)
  },
  "disableField": {
    object (DisableFieldResponse)
  },
  "deleteField": {
    object (DeleteFieldResponse)
  },
  "createSelectionChoice": {
    object (CreateSelectionChoiceResponse)
  },
  "updateSelectionChoiceProperties": {
    object (UpdateSelectionChoicePropertiesResponse)
  },
  "enableSelectionChoice": {
    object (EnableSelectionChoiceResponse)
  },
  "disableSelectionChoice": {
    object (DisableSelectionChoiceResponse)
  },
  "deleteSelectionChoice": {
    object (DeleteSelectionChoiceResponse)
  }
  // End of list of possible types for union field response.
}
欄位
聯集欄位 response。相應要求的回應。response 只能是下列其中一項:
updateLabel

object (UpdateLabelPropertiesResponse)

更新標籤的基本屬性。

createField

object (CreateFieldResponse)

建立新欄位。

updateField

object (UpdateFieldPropertiesResponse)

更新欄位的基本屬性。

updateFieldType

object (UpdateFieldTypeResponse)

更新欄位類型和/或類型選項。

enableField

object (EnableFieldResponse)

啟用欄位。

disableField

object (DisableFieldResponse)

停用欄位。

deleteField

object (DeleteFieldResponse)

從標籤中刪除欄位。

createSelectionChoice

object (CreateSelectionChoiceResponse)

建立一個新的選取清單選項,加到選取欄位。

updateSelectionChoiceProperties

object (UpdateSelectionChoicePropertiesResponse)

更新選取欄位內的選項。

enableSelectionChoice

object (EnableSelectionChoiceResponse)

啟用選取欄位內的選項。

disableSelectionChoice

object (DisableSelectionChoiceResponse)

停用選取欄位內的選項。

deleteSelectionChoice

object (DeleteSelectionChoiceResponse)

這個外掛程式能從選取欄位中刪除選項。

UpdateLabelPropertiesResponse

標籤屬性更新後的回應。

CreateFieldResponse

建立欄位後的回應。

JSON 表示法
{
  "id": string,
  "priority": integer
}
欄位
id

string

已建立欄位的欄位。如果建立要求中的欄位留空,系統會自動產生金鑰,並可以在這裡識別。

priority

integer

建立欄位的優先順序。優先順序可能會與指定值不同,以確保欄位 (1-n) 之間有一致的優先順序。

UpdateFieldPropertiesResponse

欄位屬性更新後的回應。

JSON 表示法
{
  "priority": integer
}
欄位
priority

integer

更新後欄位的優先順序。優先順序可能會與指定值不同,以確保欄位 (1-n) 之間有一致的優先順序。

UpdateFieldTypeResponse

「欄位」類型更新後的回應。

EnableFieldResponse

啟用欄位後的回應。

DisableFieldResponse

停用欄位後的回應。

DeleteFieldResponse

欄位刪除後的回應。

CreateSelectionChoiceResponse

選取「Selection Choice」建立後的回應。

JSON 表示法
{
  "fieldId": string,
  "id": string
}
欄位
fieldId

string

伺服器產生的欄位 ID。

id

string

所選選項在欄位內產生的 ID

UpdateSelectionChoicePropertiesResponse

回應「Selection Choice」屬性更新後的回應。

JSON 表示法
{
  "priority": integer
}
欄位
priority

integer

更新選項的優先順序。優先順序可能會與指定值不同,以確保選項之間能夠保持一致的優先順序 (1-n)。

EnableSelectionChoiceResponse

選擇啟用後的回應。

DisableSelectionChoiceResponse

以下回應已停用。

DeleteSelectionChoiceResponse

選擇刪除之後的回應。