labels
Creates, updates, deletes, gets or lists a labels
resource.
Overview
Name | labels |
Type | Resource |
Id | googleworkspace.drivelabelsv2beta.labels |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Name | Datatype | Description |
---|---|---|
id | string | Output only. Globally unique identifier of this label. ID makes up part of the label name , but unlike name , ID is consistent between revisions. Matches the regex: ([a-zA-Z0-9])+ . |
name | string | Output only. Resource name of the label. Will be in the form of either: labels/{id} or labels/{id}@{revision_id} depending on the request. See id and revision_id below. |
appliedCapabilities | object | Output only. The capabilities related to this label on applied metadata. (id: GoogleAppsDriveLabelsV2betaLabelAppliedCapabilities) |
appliedLabelPolicy | object | Output only. Behavior of this label when it's applied to Drive items. (id: GoogleAppsDriveLabelsV2betaLabelAppliedLabelPolicy) |
createTime | string (google-datetime) | Output only. The time this label was created. |
creator | object | Output only. The user who created this label. (id: GoogleAppsDriveLabelsV2betaUserInfo) |
customer | string | Output only. The customer this label belongs to. For example: customers/123abc789 . |
disableTime | string (google-datetime) | Output only. The time this label was disabled. This value has no meaning when the label isn't disabled. |
disabler | object | Output only. The user who disabled this label. This value has no meaning when the label isn't disabled. (id: GoogleAppsDriveLabelsV2betaUserInfo) |
displayHints | object | Output only. UI display hints for rendering the label. (id: GoogleAppsDriveLabelsV2betaLabelDisplayHints) |
enabledAppSettings | object | Optional. The EnabledAppSettings for this Label. (id: GoogleAppsDriveLabelsV2betaLabelEnabledAppSettings) |
fields | array | List of fields in descending priority order. |
labelType | string | Required. The type of label. |
learnMoreUri | string | Custom URL to present to users to allow them to learn more about this label and how it should be used. |
lifecycle | object | Output only. The lifecycle state of the label including whether it's published, deprecated, and has draft changes. (id: GoogleAppsDriveLabelsV2betaLifecycle) |
lockStatus | object | Output only. The LockStatus of this label. (id: GoogleAppsDriveLabelsV2betaLockStatus) |
properties | object | Required. The basic properties of the label. (id: GoogleAppsDriveLabelsV2betaLabelProperties) |
publishTime | string (google-datetime) | Output only. The time this label was published. This value has no meaning when the label isn't published. |
publisher | object | Output only. The user who published this label. This value has no meaning when the label isn't published.>> (id: GoogleAppsDriveLabelsV2betaUserInfo) |
revisionCreateTime | string (google-datetime) | Output only. The time this label revision was created. |
revisionCreator | object | Output only. The user who created this label revision. (id: GoogleAppsDriveLabelsV2betaUserInfo) |
revisionId | string | Output only. Revision ID of the label. Revision ID might be part of the label name depending on the request issued. A new revision is created whenever revisioned properties of a label are changed. Matches the regex: ([a-zA-Z0-9])+ . |
schemaCapabilities | object | Output only. The capabilities the user has on this label. (id: GoogleAppsDriveLabelsV2betaLabelSchemaCapabilities) |
Name | Datatype | Description |
---|---|---|
id | string | Output only. Globally unique identifier of this label. ID makes up part of the label name , but unlike name , ID is consistent between revisions. Matches the regex: ([a-zA-Z0-9])+ . |
name | string | Output only. Resource name of the label. Will be in the form of either: labels/{id} or labels/{id}@{revision_id} depending on the request. See id and revision_id below. |
appliedCapabilities | object | Output only. The capabilities related to this label on applied metadata. (id: GoogleAppsDriveLabelsV2betaLabelAppliedCapabilities) |
appliedLabelPolicy | object | Output only. Behavior of this label when it's applied to Drive items. (id: GoogleAppsDriveLabelsV2betaLabelAppliedLabelPolicy) |
createTime | string (google-datetime) | Output only. The time this label was created. |
creator | object | Output only. The user who created this label. (id: GoogleAppsDriveLabelsV2betaUserInfo) |
customer | string | Output only. The customer this label belongs to. For example: customers/123abc789 . |
disableTime | string (google-datetime) | Output only. The time this label was disabled. This value has no meaning when the label isn't disabled. |
disabler | object | Output only. The user who disabled this label. This value has no meaning when the label isn't disabled. (id: GoogleAppsDriveLabelsV2betaUserInfo) |
displayHints | object | Output only. UI display hints for rendering the label. (id: GoogleAppsDriveLabelsV2betaLabelDisplayHints) |
enabledAppSettings | object | Optional. The EnabledAppSettings for this Label. (id: GoogleAppsDriveLabelsV2betaLabelEnabledAppSettings) |
fields | array | List of fields in descending priority order. |
labelType | string | Required. The type of label. |
learnMoreUri | string | Custom URL to present to users to allow them to learn more about this label and how it should be used. |
lifecycle | object | Output only. The lifecycle state of the label including whether it's published, deprecated, and has draft changes. (id: GoogleAppsDriveLabelsV2betaLifecycle) |
lockStatus | object | Output only. The LockStatus of this label. (id: GoogleAppsDriveLabelsV2betaLockStatus) |
properties | object | Required. The basic properties of the label. (id: GoogleAppsDriveLabelsV2betaLabelProperties) |
publishTime | string (google-datetime) | Output only. The time this label was published. This value has no meaning when the label isn't published. |
publisher | object | Output only. The user who published this label. This value has no meaning when the label isn't published.>> (id: GoogleAppsDriveLabelsV2betaUserInfo) |
revisionCreateTime | string (google-datetime) | Output only. The time this label revision was created. |
revisionCreator | object | Output only. The user who created this label revision. (id: GoogleAppsDriveLabelsV2betaUserInfo) |
revisionId | string | Output only. Revision ID of the label. Revision ID might be part of the label name depending on the request issued. A new revision is created whenever revisioned properties of a label are changed. Matches the regex: ([a-zA-Z0-9])+ . |
schemaCapabilities | object | Output only. The capabilities the user has on this label. (id: GoogleAppsDriveLabelsV2betaLabelSchemaCapabilities) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | labelsId | useAdminAccess , languageCode , view | Get a label by its resource name. For more information, see Search for labels. Resource name may be any of: * labels/{id} - See labels/{id}@latest * labels/{id}@latest - Gets the latest revision of the label. * labels/{id}@published - Gets the current published revision of the label. * labels/{id}@{revision_id} - Gets the label at the specified revision ID. |
list | select | useAdminAccess , minimumRole , publishedOnly , customer , languageCode , pageSize , pageToken , view | List labels. For more information, see Search for labels. | |
create | insert | useAdminAccess , languageCode | Creates a label. For more information, see Create and publish a label. | |
delete | delete | labelsId | useAdminAccess , writeControl.requiredRevisionId | Permanently deletes a label and related metadata on Drive items. For more information, see Disable, enable, and delete a label. Once deleted, the label and related Drive item metadata will be deleted. Only draft labels and disabled labels may be deleted. |
delta | exec | labelsId | Updates a single label by applying a set of update requests resulting in a new draft revision. For more information, see Update a label. The batch update is all-or-nothing: If any of the update requests are invalid, no changes are applied. The resulting draft revision must be published before the changes may be used with Drive items. | |
publish | exec | labelsId | Publish all draft changes to the label. Once published, the label may not return to its draft state. For more information, see Create and publish a label. Publishing a label will result in a new published revision. All previous draft revisions will be deleted. Previous published revisions will be kept but are subject to automated deletion as needed. For more information, see Label lifecycle. Once published, some changes are no longer permitted. Generally, any change that would invalidate or cause new restrictions on existing metadata related to the label will be rejected. For example, the following changes to a label will be rejected after the label is published: * The label cannot be directly deleted. It must be disabled first, then deleted. * Field.FieldType cannot be changed. * Changes to field validation options cannot reject something that was previously accepted. * Reducing the maximum entries. | |
disable | exec | labelsId | Disable a published label. For more information, see Disable, enable, and delete a label. Disabling a label will result in a new disabled published revision based on the current published revision. If there's a draft revision, a new disabled draft revision will be created based on the latest draft revision. Older draft revisions will be deleted. Once disabled, a label may be deleted with DeleteLabel . | |
enable | exec | labelsId | Enable a disabled label and restore it to its published state. For more information, see Disable, enable, and delete a label. This will result in a new published revision based on the current disabled published revision. If there's an existing disabled draft revision, a new revision will be created based on that draft and will be enabled. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
labelsId | string | |
customer | string | |
languageCode | string | |
minimumRole | string | |
pageSize | integer (int32) | |
pageToken | string | |
publishedOnly | boolean | |
useAdminAccess | boolean | |
view | string | |
writeControl.requiredRevisionId | string |
SELECT
examples
- get
- list
Get a label by its resource name. For more information, see Search for labels. Resource name may be any of: * labels/{id}
- See labels/{id}@latest
* labels/{id}@latest
- Gets the latest revision of the label. * labels/{id}@published
- Gets the current published revision of the label. * labels/{id}@{revision_id}
- Gets the label at the specified revision ID.
SELECT
id,
name,
appliedCapabilities,
appliedLabelPolicy,
createTime,
creator,
customer,
disableTime,
disabler,
displayHints,
enabledAppSettings,
fields,
labelType,
learnMoreUri,
lifecycle,
lockStatus,
properties,
publishTime,
publisher,
revisionCreateTime,
revisionCreator,
revisionId,
schemaCapabilities
FROM googleworkspace.drivelabelsv2beta.labels
WHERE labelsId = '{{ labelsId }}' -- required
AND useAdminAccess = '{{ useAdminAccess }}'
AND languageCode = '{{ languageCode }}'
AND view = '{{ view }}'
;
List labels. For more information, see Search for labels.
SELECT
id,
name,
appliedCapabilities,
appliedLabelPolicy,
createTime,
creator,
customer,
disableTime,
disabler,
displayHints,
enabledAppSettings,
fields,
labelType,
learnMoreUri,
lifecycle,
lockStatus,
properties,
publishTime,
publisher,
revisionCreateTime,
revisionCreator,
revisionId,
schemaCapabilities
FROM googleworkspace.drivelabelsv2beta.labels
WHERE useAdminAccess = '{{ useAdminAccess }}'
AND minimumRole = '{{ minimumRole }}'
AND publishedOnly = '{{ publishedOnly }}'
AND customer = '{{ customer }}'
AND languageCode = '{{ languageCode }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND view = '{{ view }}'
;
INSERT
examples
- create
- Manifest
Creates a label. For more information, see Create and publish a label.
INSERT INTO googleworkspace.drivelabelsv2beta.labels (
data__labelType,
data__properties,
data__fields,
data__learnMoreUri,
data__enabledAppSettings,
useAdminAccess,
languageCode
)
SELECT
'{{ labelType }}',
'{{ properties }}',
'{{ fields }}',
'{{ learnMoreUri }}',
'{{ enabledAppSettings }}',
'{{ useAdminAccess }}',
'{{ languageCode }}'
RETURNING
id,
name,
appliedCapabilities,
appliedLabelPolicy,
createTime,
creator,
customer,
disableTime,
disabler,
displayHints,
enabledAppSettings,
fields,
labelType,
learnMoreUri,
lifecycle,
lockStatus,
properties,
publishTime,
publisher,
revisionCreateTime,
revisionCreator,
revisionId,
schemaCapabilities
;
# Description fields are for documentation purposes
- name: labels
props:
- name: labelType
value: string
description: >
Required. The type of label.
valid_values: ['LABEL_TYPE_UNSPECIFIED', 'SHARED', 'ADMIN', 'GOOGLE_APP']
- name: properties
value: object
description: >
Required. The basic properties of the label.
- name: fields
value: array
description: >
List of fields in descending priority order.
- name: learnMoreUri
value: string
description: >
Custom URL to present to users to allow them to learn more about this label and how it should be used.
- name: enabledAppSettings
value: object
description: >
Optional. The `EnabledAppSettings` for this Label.
- name: useAdminAccess
value: boolean
- name: languageCode
value: string
DELETE
examples
- delete
Permanently deletes a label and related metadata on Drive items. For more information, see Disable, enable, and delete a label. Once deleted, the label and related Drive item metadata will be deleted. Only draft labels and disabled labels may be deleted.
DELETE FROM googleworkspace.drivelabelsv2beta.labels
WHERE labelsId = '{{ labelsId }}' --required
AND useAdminAccess = '{{ useAdminAccess }}'
AND writeControl.requiredRevisionId = '{{ writeControl.requiredRevisionId }}'
;
Lifecycle Methods
- delta
- publish
- disable
- enable
Updates a single label by applying a set of update requests resulting in a new draft revision. For more information, see Update a label. The batch update is all-or-nothing: If any of the update requests are invalid, no changes are applied. The resulting draft revision must be published before the changes may be used with Drive items.
EXEC googleworkspace.drivelabelsv2beta.labels.delta
@labelsId='{{ labelsId }}' --required
@@json=
'{
"writeControl": "{{ writeControl }}",
"requests": "{{ requests }}",
"useAdminAccess": {{ useAdminAccess }},
"view": "{{ view }}",
"languageCode": "{{ languageCode }}"
}'
;
Publish all draft changes to the label. Once published, the label may not return to its draft state. For more information, see Create and publish a label. Publishing a label will result in a new published revision. All previous draft revisions will be deleted. Previous published revisions will be kept but are subject to automated deletion as needed. For more information, see Label lifecycle. Once published, some changes are no longer permitted. Generally, any change that would invalidate or cause new restrictions on existing metadata related to the label will be rejected. For example, the following changes to a label will be rejected after the label is published: * The label cannot be directly deleted. It must be disabled first, then deleted. * Field.FieldType
cannot be changed. * Changes to field validation options cannot reject something that was previously accepted. * Reducing the maximum entries.
EXEC googleworkspace.drivelabelsv2beta.labels.publish
@labelsId='{{ labelsId }}' --required
@@json=
'{
"useAdminAccess": {{ useAdminAccess }},
"writeControl": "{{ writeControl }}",
"languageCode": "{{ languageCode }}"
}'
;
Disable a published label. For more information, see Disable, enable, and delete a label. Disabling a label will result in a new disabled published revision based on the current published revision. If there's a draft revision, a new disabled draft revision will be created based on the latest draft revision. Older draft revisions will be deleted. Once disabled, a label may be deleted with DeleteLabel
.
EXEC googleworkspace.drivelabelsv2beta.labels.disable
@labelsId='{{ labelsId }}' --required
@@json=
'{
"updateMask": "{{ updateMask }}",
"useAdminAccess": {{ useAdminAccess }},
"writeControl": "{{ writeControl }}",
"disabledPolicy": "{{ disabledPolicy }}",
"languageCode": "{{ languageCode }}"
}'
;
Enable a disabled label and restore it to its published state. For more information, see Disable, enable, and delete a label. This will result in a new published revision based on the current disabled published revision. If there's an existing disabled draft revision, a new revision will be created based on that draft and will be enabled.
EXEC googleworkspace.drivelabelsv2beta.labels.enable
@labelsId='{{ labelsId }}' --required
@@json=
'{
"useAdminAccess": {{ useAdminAccess }},
"writeControl": "{{ writeControl }}",
"languageCode": "{{ languageCode }}"
}'
;