Skip to content
Roboto
Esc
↑↓navigate↵open⌘Jpreview
On this page

roboto.domain.custom_fields.record

Module Contents

CUSTOM_FIELD_NAME_PATTERN

roboto.domain.custom_fields.record.CUSTOM_FIELD_NAME_PATTERN = '[a-z][a-z0-9_]{0,62}'#View Source

Regular expression describing the format of a valid custom-field name.

A custom-field name is at most 63 characters long, starts with a lowercase ASCII letter, and may otherwise contain lowercase ASCII letters, digits, and underscores.

Unanchored, for embedding in a larger pattern; wrap as ^{...}$ to match a whole field name.

CustomFieldOptions

type roboto.domain.custom_fields.record.CustomFieldOptions = Annotated[EnumFieldOptions, pydantic.Field(discriminator='field_type')]#View Source

Type-specific configuration carried alongside a custom field. Currently only EnumFieldOptions.

CustomFieldRecord

class roboto.domain.custom_fields.record.CustomFieldRecord(/, **data)#View Source

Bases: pydantic.BaseModel

Wire-transmissible representation of a CustomField.

Returned by the custom-fields API and wrapped by CustomField for ergonomic access. Callers normally interact with the wrapping class rather than this record directly.

Parameters

data Any

Attributes

CustomFieldRecord.attempts

attempts int = 0 #

Number of attempts the platform has made for the field’s current lifecycle phase.

Diagnostic; not actionable for callers.

CustomFieldRecord.created

created datetime.datetime #

UTC timestamp when the field was defined.

CustomFieldRecord.created_by

created_by str #

User ID that defined the field.

CustomFieldRecord.description

description str | None = None #

Long-form description of the field’s meaning, or None if unset.

CustomFieldRecord.display_name

display_name str | None = None #

Human-readable label for the field, or None if unset.

CustomFieldRecord.entity_type

entity_type TargetEntityType #

Roboto entity type the field extends.

CustomFieldRecord.field_id

field_id str #

Opaque, globally unique identifier for the field.

CustomFieldRecord.field_name

field_name str #

Name of the field. Unique within (org_id, entity_type) and fixed at creation time.

CustomFieldRecord.field_type

field_type CustomFieldType #

Value type of the field. Fixed at creation time.

CustomFieldRecord.last_error

last_error str | None = None #

Human-readable summary of the most recent failure, if any.

Populated when status is CustomFieldStatus.Failed, and may stay set after a retry until the next failure or success.

CustomFieldRecord.metadata_path

metadata_path str | None = None #

Source metadata key the field was promoted from, if any. Reserved for future use.

CustomFieldRecord.modified

modified datetime.datetime #

Timestamp of the field’s most recent status or metadata change.

CustomFieldRecord.modified_by

modified_by str #

User ID of the most recent modifier. May be a system identity for automatic status changes.

CustomFieldRecord.options

options CustomFieldOptions | None = None #

Type-specific configuration.

Present for CustomFieldType.Enum fields; None for types that take no options.

CustomFieldRecord.org_id

org_id str #

Organization that owns the field.

CustomFieldRecord.status

Current lifecycle status. See CustomFieldStatus.

CustomFieldStatus

class roboto.domain.custom_fields.record.CustomFieldStatus#View Source

Bases: roboto.compat.StrEnum

Lifecycle state of a CustomField.

The status tells a caller what they can do with the field right now. See the CustomField class docstring for the full lifecycle narrative.

Attributes

CustomFieldStatus.Creating

Creating = 'creating' #

The field is being set up.

Values cannot yet be assigned to entities, and the field cannot be referenced in search or sort.

CustomFieldStatus.Deleting

Deleting = 'deleting' #

The field is on its way out. Callers should treat it as already gone.

CustomFieldStatus.Failed

Failed = 'failed' #

The most recent create or delete attempt did not succeed.

The field stays in this state until an operator intervenes. A field that failed during creation can normally be deleted, however.

CustomFieldStatus.Ready

Ready = 'ready' #

The field is fully available.

Values can be set on entities and the field can be used in search filters and as a sort key.

CustomFieldType

class roboto.domain.custom_fields.record.CustomFieldType#View Source

Bases: roboto.compat.StrEnum

Value type of a custom field.

A field’s type is fixed at creation time and determines which operators are supported in search and sort, as well as which Python types can be assigned as values.

Attributes

CustomFieldType.Boolean

Boolean = 'boolean' #

A boolean value. Supports equality filtering.

CustomFieldType.Enum

Enum = 'enum' #

A string value drawn from a fixed set of allowed values.

The allowed values are declared at creation time via EnumFieldOptions. Supports equality and membership filtering, plus sort.

CustomFieldType.Number

Number = 'number' #

A numeric value. Supports equality, range filtering, and sort.

CustomFieldType.String

String = 'string' #

A free-form string value. Supports equality, substring, and sort.

CustomFieldType.Timestamp

Timestamp = 'timestamp' #

A point in time. Supports equality, range filtering, and sort.

Values may be given as a datetime, an ISO 8601 string, an int of nanoseconds since the Unix epoch, or a float, decimal.Decimal or numeric string of seconds since it. A string is read as seconds whenever it parses as a number, so the all-digit date 20260101 names a moment in 1970 rather than a day in 2026.

A value carrying no time zone, whether a naive datetime or an ISO 8601 string with no offset, is read as UTC; a date with no time, such as 2026-05-14, resolves to midnight UTC. Sub-microsecond precision is not retained.

Values are returned as ISO 8601 strings, which datetime.datetime.fromisoformat parses.

EnumFieldOptions

class roboto.domain.custom_fields.record.EnumFieldOptions(/, **data)#View Source

Bases: pydantic.BaseModel

Configuration for an CustomFieldType.Enum custom field.

Declares the set of values an enum field will accept. Required when creating an enum field; unused for other field types.

Parameters

data Any

Attributes

EnumFieldOptions.enum_values

enum_values list[str] = None #

Allowed values for the field. Must contain at least one value.

EnumFieldOptions.field_type

field_type Literal[CustomFieldType] #

Discriminator that identifies this options payload as belonging to an enum field.

TargetEntityType

class roboto.domain.custom_fields.record.TargetEntityType#View Source

Bases: roboto.compat.StrEnum

Roboto entity type that a custom field extends.

Each custom field is scoped to exactly one entity type, and a given field_name is unique within an (org_id, entity_type) pair.

Attributes

TargetEntityType.Collection

Collection = 'collection' #

Field applies to Collection entities.

TargetEntityType.Dataset

Dataset = 'dataset' #

Field applies to Dataset entities.

TargetEntityType.Device

Device = 'device' #

Field applies to Device entities.

TargetEntityType.Event

Event = 'event' #

Field applies to Event entities.

TargetEntityType.Session

Session = 'session' #

Field applies to Session entities.

Properties

TargetEntityType.url_safe_value

url_safe_value str #

URL-encoded form of this entity type’s value, suitable for embedding in a path segment.

Return type: str

Was this page helpful?