Labels

An object containing a list of "key": value pairs where the values are a primitive data type.

Example: { "name": "bob", "age": 55, "isMember": true }. Label keys can be expressed as URI paths, which means you can represent one or more complex entities within a label object. Example: { "/user/name": "bob", "/user/age": 55, "/user/profile/isMember": true }.

Field

Data Type

Description

"key": string

string | number | boolean | null

Required

Key value.

Read-write

LabelDescriptor

Describes a "key": value pair within a Labels object. Label descriptors are used to validate and serialize data.

Field

Data Type

Description

key

string

Required

Label key name. It can represented as a URI path in which case you should add a leading slash e.g /user/name. For example: name or /user/name.

Read-only-after-creation

valueType

string (

"BOOL",

"INT64",

"FLOAT64", "MONEY", "STRING", "TIMESTAMP"

)

Required

Label value type.

Read-write

accessType

string (

"read-only",

"read-only-after-creation",

"read-write",

"write-only"

)

Required

Label data access type.

Read-write

displayName

string

Human readable label display name.

Read-write

description

string | null

Label description.

Read-write

required

boolean

Denotes whether label is required.

Defaults to true. If set to false then a default value should be set.

Read-write

default

string | number | boolean | null

Default label value. If the default value is set to null, then nullable must be set to true.

Read-write

nullable

boolean

Denotes whether label value is allowed be null.

Defaults to false.

Read-write

ref

string

A reference to the label value's source.

It must be a URI path or an object attribute path that exists within the current data context.

Note that the ref, when set, overrides the key path when reading the label value.

Read-write

valid[]

string | number | boolean | null

An array of allowed label values.

Read-write

invalid[]

string | number | boolean | null

An array of disallowed label values.

Read-write

format

string

A specific format for the label value. For example, "ISO", or "email".

Read-write