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)

在選項欄位中啟用 Choice。

disableSelectionChoice

object (DisableSelectionChoiceRequest)

停用選取欄位中的選項。

deleteSelectionChoice

object (DeleteSelectionChoiceRequest)

刪除選取欄位內的選項。

UpdateLabelPropertiesRequest

更新 Label 的基本屬性。

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)

必要欄位。基本欄位屬性。

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)

將欄位更新為「Text」。

longTextOptions

object (LongTextOptions)

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

integerOptions

object (IntegerOptions)

將欄位更新為整數。

dateOptions

object (DateOptions)

將欄位更新為日期。

selectionOptions

object (SelectionOptions)

將欄位更新為「Selection」。

userOptions

object (UserOptions)

將欄位更新為 User。

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

要求建立 Selection Choice。

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

string

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

choice

object (Choice)

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

UpdateSelectionChoicePropertiesRequest

要求更新 Choice 屬性。

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

string (FieldMask format)

應更新的欄位。至少須指定一個欄位。根 properties 是隱含的,因此不應指定。單一 * 可用來簡略更新每個欄位。

fieldId

string

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

id

string

必要欄位。選擇更新。

properties

object (Properties)

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

EnableSelectionChoiceRequest

要求啟用 Choice。

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

string

必要欄位。要啟用選項的「選取」欄位。

id

string

必要欄位。啟用選項。

DisableSelectionChoiceRequest

要求停用某個選項。

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

string (FieldMask format)

應更新的欄位。至少須指定一個欄位。根層級 disabledPolicy 為默示值,因此不應指定。單一 * 可用來簡略更新每個欄位。

fieldId

string

必要欄位。選擇停用選項的選取欄位。

id

string

必要欄位。停用選項。

disabledPolicy

object (DisabledPolicy)

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

DeleteSelectionChoiceRequest

要求刪除選項。

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

string

必要欄位。要刪除選項的「選取項目」欄位。

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)

在「Selection Field」中啟用「Choice」。

disableSelectionChoice

object (DisableSelectionChoiceResponse)

停用選項欄位中的 Choice。

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

建立選項後的回應。

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

string

伺服器產生的欄位 ID。

id

string

伺服器針對欄位內所建立選項的伺服器產生的 ID

UpdateSelectionChoicePropertiesResponse

更新 Selection Choice 屬性後的回應。

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

integer

更新選項的優先順序。系統可能會變更指定的優先順序,確保選項之間的優先順序連續 (1-n)。

EnableSelectionChoiceResponse

這個類型沒有任何欄位。

回應選擇啟用。

DisableSelectionChoiceResponse

這個類型沒有任何欄位。

選擇停用後回應。

DeleteSelectionChoiceResponse

這個類型沒有任何欄位。

按下「刪除」後回覆的內容。