roboto.domain.custom_fields.record
Module Contents
CUSTOM_FIELD_NAME_PATTERN
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-specific configuration carried alongside a custom field. Currently only EnumFieldOptions.
CustomFieldRecord
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 AnyAttributes
CustomFieldRecord.attempts
Number of attempts the platform has made for the field’s current lifecycle phase.
Diagnostic; not actionable for callers.
CustomFieldRecord.description
Long-form description of the field’s meaning, or None if unset.
CustomFieldRecord.display_name
Human-readable label for the field, or None if unset.
CustomFieldRecord.field_name
Name of the field. Unique within (org_id, entity_type) and fixed at creation time.
CustomFieldRecord.field_type
Value type of the field. Fixed at creation time.
CustomFieldRecord.last_error
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
Source metadata key the field was promoted from, if any. Reserved for future use.
CustomFieldRecord.modified
Timestamp of the field’s most recent status or metadata change.
CustomFieldRecord.modified_by
User ID of the most recent modifier. May be a system identity for automatic status changes.
CustomFieldRecord.options
Type-specific configuration.
Present for CustomFieldType.Enum fields; None for types that take no options.
CustomFieldStatus
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
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
The field is on its way out. Callers should treat it as already gone.
CustomFieldStatus.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
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
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.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
A numeric value. Supports equality, range filtering, and sort.
CustomFieldType.String
A free-form string value. Supports equality, substring, and sort.
CustomFieldType.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
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 AnyAttributes
EnumFieldOptions.enum_values
Allowed values for the field. Must contain at least one value.
EnumFieldOptions.field_type
Discriminator that identifies this options payload as belonging to an enum field.
TargetEntityType
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
Properties
TargetEntityType.url_safe_value
URL-encoded form of this entity type’s value, suitable for embedding in a path segment.