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

roboto.domain.custom_fields.operations

Module Contents

CreateCustomFieldRequest

class roboto.domain.custom_fields.operations.CreateCustomFieldRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request body for POST /v1/custom-fields.

Defines a new custom field for an entity type in the caller’s organization. Normally constructed by create() rather than instantiated directly.

Parameters

data Any

CreateCustomFieldRequest.check_options_match_field_type()

check_options_match_field_type()#View Source

Attributes

CreateCustomFieldRequest.description

description FieldDescription | None = None #

Long-form description of the field’s meaning.

Surrounding whitespace is removed. Text that is empty once stripped counts as unset.

CreateCustomFieldRequest.display_name

display_name FieldDisplayName | None = None #

Human-readable label shown in the UI.

Surrounding whitespace is removed. Text that is empty once stripped counts as unset.

CreateCustomFieldRequest.entity_type

Roboto entity type the field extends.

CreateCustomFieldRequest.field_name

field_name Annotated[str, pydantic.StringConstraints(pattern=f'^{CUSTOM_FIELD_NAME_PATTERN}$')] #

Name of the field. Fixed at creation time.

Must match ^[a-z][a-z0-9_]{0,62}$ (lowercase ASCII, max 63 chars) and is unique within (org_id, entity_type).

CreateCustomFieldRequest.field_type

Value type of the field.

Determines which operators are supported in search and sort.

CreateCustomFieldRequest.metadata_path

metadata_path str | None = None #

Reserved for promoting an existing metadata key into a custom field.

Not yet supported; leave as None. Supplying a value is rejected.

CreateCustomFieldRequest.options

options ValidatedCustomFieldOptions | None = None #

Type-specific configuration.

Required for CustomFieldType.Enum fields (to declare the allowed values).

Enum values are tidied before they are stored: each is normalized to Unicode NFC, surrounding whitespace is removed, internal runs of whitespace become a single space, and values that repeat after that are deduplicated. A field may declare at most 250 distinct values, each at most 256 characters long as supplied, not counting surrounding whitespace.

A value is rejected if it is blank, or if it contains a control character, a double quote, or a backslash: a value carrying one of those cannot be relied on to work in search.

FieldDescription

type roboto.domain.custom_fields.operations.FieldDescription = Annotated[str, pydantic.StringConstraints(max_length=256)]#View Source

Long-form description of a custom field. Up to 256 characters.

FieldDisplayName

type roboto.domain.custom_fields.operations.FieldDisplayName = Annotated[str, pydantic.StringConstraints(max_length=128)]#View Source

Human-readable label for a custom field. Up to 128 characters.

ListCustomFieldsRequest

class roboto.domain.custom_fields.operations.ListCustomFieldsRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request body for POST /v1/custom-fields/query.

Pages through the custom fields visible to the caller, optionally filtered by entity type and status. Normally constructed by list() rather than directly.

Parameters

data Any

Attributes

ListCustomFieldsRequest.entity_type

If provided, restrict results to fields targeting this entity type.

ListCustomFieldsRequest.page_token

page_token str | None = None #

Opaque token returned by a prior page; omit on the first request.

ListCustomFieldsRequest.statuses

Statuses to include in the results. Must contain at least one status.

UpdateCustomFieldRequest

class roboto.domain.custom_fields.operations.UpdateCustomFieldRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request body for POST /v1/custom-fields/{field_id}.

Carries mutable metadata changes for an existing custom field. Each request attribute defaults to NotSet, which leaves the corresponding attribute unchanged; pass None explicitly to clear an attribute.

Parameters

data Any

Attributes

UpdateCustomFieldRequest.description

New description for the field, or None to clear it.

Leave as NotSet to leave unchanged. Surrounding whitespace is removed, and text that is empty once stripped clears the attribute.

UpdateCustomFieldRequest.display_name

New display name for the field, or None to clear it.

Leave as NotSet to leave unchanged. Surrounding whitespace is removed, and text that is empty once stripped clears the attribute.

UpdateCustomFieldRequest.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

UpdateCustomFieldRequest.options

Replacement type-specific configuration for the field.

Leave as NotSet to leave unchanged. Must be for the field’s field_type. For an enum field, the new enum_values must include every existing value: values can be added but not removed. Values are tidied and capped exactly as they are at creation. A value that repeats an earlier one in enum_values, once tidied, is discarded rather than rejected, so re-sending a value the field already has changes nothing and raises nothing.

ValidatedCustomFieldOptions

type roboto.domain.custom_fields.operations.ValidatedCustomFieldOptions = Annotated[CustomFieldOptions, pydantic.AfterValidator(_validate_field_options)]#View Source

Custom field options as supplied when a field is defined or updated - tidied and checked.

check_options_match_field_type()

roboto.domain.custom_fields.operations.check_options_match_field_type(field_type, options)#View Source

Raise ValueError if options are missing for, or don’t belong to, a field of field_type.

Was this page helpful?