- HTTP 要求
- 路徑參數
- 要求主體
- 回應主體
- 授權範圍
- 要求
- UpdateLabelPropertiesRequest
- CreateFieldRequest
- UpdateFieldPropertiesRequest
- UpdateFieldTypeRequest
- LongTextOptions
- EnableFieldRequest
- DisableFieldRequest
- DeleteFieldRequest
- CreateSelectionChoiceRequest
- UpdateSelectionChoicePropertiesRequest
- EnableSelectionChoiceRequest
- DisableSelectionChoiceRequest
- DeleteSelectionChoiceRequest
- 回應
- UpdateLabelPropertiesResponse
- CreateFieldResponse
- UpdateFieldPropertiesResponse
- UpdateFieldTypeResponse
- EnableFieldResponse
- DisableFieldResponse
- DeleteFieldResponse
- CreateSelectionChoiceResponse
- UpdateSelectionChoicePropertiesResponse
- EnableSelectionChoiceResponse
- DisableSelectionChoiceResponse
- DeleteSelectionChoiceResponse
- 試試看!
套用一組更新要求,產生新的草稿修訂版本,以便更新單一標籤。批次更新屬於全部或無效:如果有任何無效的更新要求,則不會套用任何變更。必須先發布產生的草稿修訂版本,才能與雲端硬碟項目搭配使用。
HTTP 要求
POST https://drivelabels.googleapis.com/v2/{name=labels/*}:delta
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 | |
---|---|
name |
必要欄位。要更新標籤的資源名稱。 |
要求主體
要求主體的資料會採用以下結構:
JSON 表示法 |
---|
{ "writeControl": { object ( |
欄位 | |
---|---|
writeControl |
可讓您控管寫入要求的執行方式。 |
requests[] |
要套用至標籤的更新清單。系統會按照指定的順序套用要求。 |
useAdminAccess |
如要使用使用者的管理員憑證,請設為 |
view |
如果有指定,系統只會傳回屬於指定檢視畫面的特定欄位。 |
languageCode |
當 |
回應主體
如果成功,回應主體即會包含具有以下結構的資料:
標籤更新的回應。
JSON 表示法 |
---|
{ "responses": [ { object ( |
欄位 | |
---|---|
responses[] |
更新的回覆。這會將 1:1 與更新內容對應,不過部分要求的回應可能為空白。 |
updatedLabel |
套用更新後的標籤。只有在 [BatchUpdateLabelResponse2.include_label_in_response] 是 |
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/drive.labels
https://www.googleapis.com/auth/drive.admin.labels
詳情請參閱授權指南。
要求
套用至單一標籤的一種更新。
JSON 表示法 |
---|
{ // Union field |
欄位 | |
---|---|
聯集欄位 kind 。更新的類型。只需要一個欄位。kind 只能是下列其中一項: |
|
updateLabel |
更新標籤屬性。 |
createField |
建立新欄位。 |
updateField |
更新欄位的基本屬性。 |
updateFieldType |
更新欄位類型和/或類型選項。 |
enableField |
啟用欄位。 |
disableField |
停用「欄位」 |
deleteField |
從標籤中刪除欄位。 |
createSelectionChoice |
在「選取」欄位中建立選擇。 |
updateSelectionChoiceProperties |
請更新選取欄位內的 Choice 屬性。 |
enableSelectionChoice |
啟用選取欄位內的選項。 |
disableSelectionChoice |
停用選取欄位內的選項。 |
deleteSelectionChoice |
可刪除選取欄位內的選項。 |
UpdateLabelPropertiesRequest
更新標籤的基本屬性。
JSON 表示法 |
---|
{
"updateMask": string,
"properties": {
object ( |
欄位 | |
---|---|
updateMask |
要更新的欄位。至少須指定一個欄位。根層級 |
properties |
必要欄位。為要更新的資源加上標籤。 |
CreateFieldRequest
要求在標籤中建立欄位。
JSON 表示法 |
---|
{
"field": {
object ( |
欄位 | |
---|---|
field |
必要欄位。要建立的欄位。 |
UpdateFieldPropertiesRequest
要求更新欄位屬性。
JSON 表示法 |
---|
{
"updateMask": string,
"id": string,
"properties": {
object ( |
欄位 | |
---|---|
updateMask |
要更新的欄位。至少須指定一個欄位。根層級 |
id |
必要欄位。要更新的欄位。 |
properties |
必要欄位。Basic Field 屬性。 |
UpdateFieldTypeRequest
要求變更欄位類型。
JSON 表示法 |
---|
{ "updateMask": string, "id": string, // Union field |
欄位 | |
---|---|
updateMask |
要更新的欄位。至少須指定一個欄位。 |
id |
必要欄位。要更新的欄位。 |
聯集欄位
|
|
textOptions |
將欄位更新為文字。 |
longTextOptions |
將欄位更新為「長文字」。 |
integerOptions |
將欄位更新為整數。 |
dateOptions |
將欄位更新為日期。 |
selectionOptions |
將欄位更新為「Selection」。 |
userOptions |
將欄位更新為「使用者」。 |
LongTextOptions
選擇「長文字」欄位類型。
JSON 表示法 |
---|
{ "minLength": integer, "maxLength": integer } |
欄位 | |
---|---|
minLength |
僅供輸出。文字欄位的值下限值。 |
maxLength |
僅供輸出。文字欄位的有效值長度上限。 |
EnableFieldRequest
要求啟用欄位。
JSON 表示法 |
---|
{ "id": string } |
欄位 | |
---|---|
id |
必要欄位。要啟用的欄位 ID。 |
DisableFieldRequest
要求停用欄位。
JSON 表示法 |
---|
{
"updateMask": string,
"id": string,
"disabledPolicy": {
object ( |
欄位 | |
---|---|
updateMask |
要更新的欄位。至少須指定一個欄位。根層級 |
id |
必要欄位。要停用的欄位鍵。 |
disabledPolicy |
必要欄位。欄位已停用政策。 |
DeleteFieldRequest
要求刪除欄位。
JSON 表示法 |
---|
{ "id": string } |
欄位 | |
---|---|
id |
必要欄位。要刪除的欄位 ID。 |
CreateSelectionChoiceRequest
要求建立選取項目。
JSON 表示法 |
---|
{
"fieldId": string,
"choice": {
object ( |
欄位 | |
---|---|
fieldId |
必要欄位。要在其建立選項的「Selection Field」(選取欄位)。 |
choice |
必要欄位。要建立的選擇。 |
UpdateSelectionChoicePropertiesRequest
要求更新 Choice 屬性。
JSON 表示法 |
---|
{
"updateMask": string,
"fieldId": string,
"id": string,
"properties": {
object ( |
欄位 | |
---|---|
updateMask |
要更新的欄位。至少須指定一個欄位。根層級 |
fieldId |
必要欄位。要更新的「Selection 」欄位。 |
id |
必要欄位。要更新的選項。 |
properties |
必要欄位。要更新的 Choice 屬性。 |
EnableSelectionChoiceRequest
要求啟用選項。
JSON 表示法 |
---|
{ "fieldId": string, "id": string } |
欄位 | |
---|---|
fieldId |
必要欄位。在何種情況下啟用選項的「選取欄位」。 |
id |
必要欄位。選擇啟用。 |
DisableSelectionChoiceRequest
要求停用 Choice。
JSON 表示法 |
---|
{
"updateMask": string,
"fieldId": string,
"id": string,
"disabledPolicy": {
object ( |
欄位 | |
---|---|
updateMask |
要更新的欄位。至少須指定一個欄位。根層級 |
fieldId |
必要欄位。要停用選項的「Selection Field」(選取欄位)。 |
id |
必要欄位。可選擇停用。 |
disabledPolicy |
必要欄位。要更新的停用政策。 |
DeleteSelectionChoiceRequest
要求刪除選項。
JSON 表示法 |
---|
{ "fieldId": string, "id": string } |
欄位 | |
---|---|
fieldId |
必要欄位。即將刪除選項的「Selection 欄位」。 |
id |
必要欄位。刪除選項。 |
回應
來自更新的個別回應。
JSON 表示法 |
---|
{ // Union field |
欄位 | |
---|---|
聯集欄位 response 。相應要求的回應。response 只能是下列其中一項: |
|
updateLabel |
更新標籤的基本屬性。 |
createField |
建立新欄位。 |
updateField |
更新欄位的基本屬性。 |
updateFieldType |
更新欄位類型和/或類型選項。 |
enableField |
啟用欄位。 |
disableField |
停用欄位。 |
deleteField |
從標籤中刪除欄位。 |
createSelectionChoice |
建立一個新的選取清單選項,加到選取欄位。 |
updateSelectionChoiceProperties |
更新選取欄位內的選項。 |
enableSelectionChoice |
啟用選取欄位內的選項。 |
disableSelectionChoice |
停用選取欄位內的選項。 |
deleteSelectionChoice |
這個外掛程式能從選取欄位中刪除選項。 |
UpdateLabelPropertiesResponse
標籤屬性更新後的回應。
CreateFieldResponse
建立欄位後的回應。
JSON 表示法 |
---|
{ "id": string, "priority": integer } |
欄位 | |
---|---|
id |
已建立欄位的欄位。如果建立要求中的欄位留空,系統會自動產生金鑰,並可以在這裡識別。 |
priority |
建立欄位的優先順序。優先順序可能會與指定值不同,以確保欄位 (1-n) 之間有一致的優先順序。 |
UpdateFieldPropertiesResponse
欄位屬性更新後的回應。
JSON 表示法 |
---|
{ "priority": integer } |
欄位 | |
---|---|
priority |
更新後欄位的優先順序。優先順序可能會與指定值不同,以確保欄位 (1-n) 之間有一致的優先順序。 |
UpdateFieldTypeResponse
「欄位」類型更新後的回應。
EnableFieldResponse
啟用欄位後的回應。
DisableFieldResponse
停用欄位後的回應。
DeleteFieldResponse
欄位刪除後的回應。
CreateSelectionChoiceResponse
選取「Selection Choice」建立後的回應。
JSON 表示法 |
---|
{ "fieldId": string, "id": string } |
欄位 | |
---|---|
fieldId |
伺服器產生的欄位 ID。 |
id |
所選選項在欄位內產生的 ID |
UpdateSelectionChoicePropertiesResponse
回應「Selection Choice」屬性更新後的回應。
JSON 表示法 |
---|
{ "priority": integer } |
欄位 | |
---|---|
priority |
更新選項的優先順序。優先順序可能會與指定值不同,以確保選項之間能夠保持一致的優先順序 (1-n)。 |
EnableSelectionChoiceResponse
選擇啟用後的回應。
DisableSelectionChoiceResponse
以下回應已停用。
DeleteSelectionChoiceResponse
選擇刪除之後的回應。