roboto.domain.custom_fields.record#
Module Contents#
- type roboto.domain.custom_fields.record.CustomFieldOptions = Annotated[EnumFieldOptions, pydantic.Field(discriminator='field_type')]#
Type-specific configuration carried alongside a custom field. Currently only
EnumFieldOptions.
- class roboto.domain.custom_fields.record.CustomFieldRecord(/, **data)#
Bases:
pydantic.BaseModelWire-transmissible representation of a
CustomField.Returned by the custom-fields API and wrapped by
CustomFieldfor ergonomic access. Callers normally interact with the wrapping class rather than this record directly.- Parameters:
data (Any)
- attempts: int = 0#
Number of attempts the platform has made for the field’s current lifecycle phase.
Diagnostic; not actionable for callers.
- created: datetime.datetime#
UTC timestamp when the field was defined.
- created_by: str#
User ID that defined the field.
- description: str | None = None#
Long-form description of the field’s meaning, or
Noneif unset.
- display_name: str | None = None#
Human-readable label for the field, ir
Noneif unset.
- entity_type: TargetEntityType#
Roboto entity type the field extends.
- field_id: str#
Opaque, globally unique identifier for the field.
- field_name: str#
Name of the field. Unique within
(org_id, entity_type)and fixed at creation time.
- field_type: CustomFieldType#
Value type of the field. Fixed at creation time.
- last_error: str | None = None#
Human-readable summary of the most recent failure, if any.
Populated when
statusisCustomFieldStatus.Failed, and may stay set after a retry until the next failure or success.
- metadata_path: str | None = None#
Source metadata key the field was promoted from, if any. Reserved for future use.
- modified: datetime.datetime#
Timestamp of the field’s most recent status or metadata change.
- modified_by: str#
User ID of the most recent modifier. May be a system identity for automatic status changes.
- options: CustomFieldOptions | None = None#
Type-specific configuration.
Present for
CustomFieldType.Enumfields;Nonefor types that take no options.
- org_id: str#
Organization that owns the field.
- status: CustomFieldStatus#
Current lifecycle status. See
CustomFieldStatus.
- class roboto.domain.custom_fields.record.CustomFieldStatus#
Bases:
roboto.compat.StrEnumLifecycle state of a
CustomField.The status tells a caller what they can do with the field right now. See the
CustomFieldclass docstring for the full lifecycle narrative.- 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.
- Deleting = 'deleting'#
The field is on its way out. Callers should treat it as already gone.
- 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.
- 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.
- class roboto.domain.custom_fields.record.CustomFieldType#
Bases:
roboto.compat.StrEnumValue 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.
- Boolean = 'boolean'#
A boolean value. Supports equality filtering.
- 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.
- Number = 'number'#
A numeric value. Supports equality, range filtering, and sort.
- String = 'string'#
A free-form string value. Supports equality, substring, and sort.
- Timestamp = 'timestamp'#
A point in time. Supports equality, range filtering, and sort.
- class roboto.domain.custom_fields.record.EnumFieldOptions(/, **data)#
Bases:
pydantic.BaseModelConfiguration for an
CustomFieldType.Enumcustom 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)
- enum_values: list[EnumValue] = None#
Allowed values for the field. Must contain at least one value.
- field_type: Literal[CustomFieldType]#
Discriminator that identifies this options payload as belonging to an enum field.
- type roboto.domain.custom_fields.record.EnumValue = Annotated[str, pydantic.StringConstraints(min_length=1, max_length=256)]#
One allowed value of an
CustomFieldType.Enumfield. Non-empty, up to 256 characters.
- class roboto.domain.custom_fields.record.TargetEntityType#
Bases:
roboto.compat.StrEnumRoboto entity type that a custom field extends.
Each custom field is scoped to exactly one entity type, and a given
field_nameis unique within an(org_id, entity_type)pair.- Collection = 'collection'#
Field applies to
Collectionentities.
- property url_safe_value: str#
URL-encoded form of this entity type’s value, suitable for embedding in a path segment.
- Return type:
str