roboto.domain.custom_fields.operations#
Module Contents#
- class roboto.domain.custom_fields.operations.CreateCustomFieldRequest(/, **data)#
Bases:
pydantic.BaseModelRequest 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)
- check_options_match_field_type()#
- Return type:
- 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.
- 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.
- entity_type: roboto.domain.custom_fields.record.TargetEntityType#
Roboto entity type the field extends.
- 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).
- field_type: roboto.domain.custom_fields.record.CustomFieldType#
Value type of the field.
Determines which operators are supported in search and sort.
- 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.
- options: ValidatedCustomFieldOptions | None = None#
Type-specific configuration.
Required for
CustomFieldType.Enumfields (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.
- type roboto.domain.custom_fields.operations.FieldDescription = Annotated[str, pydantic.StringConstraints(max_length=256)]#
Long-form description of a custom field. Up to 256 characters.
- type roboto.domain.custom_fields.operations.FieldDisplayName = Annotated[str, pydantic.StringConstraints(max_length=128)]#
Human-readable label for a custom field. Up to 128 characters.
- class roboto.domain.custom_fields.operations.ListCustomFieldsRequest(/, **data)#
Bases:
pydantic.BaseModelRequest 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)
- entity_type: roboto.domain.custom_fields.record.TargetEntityType | None = None#
If provided, restrict results to fields targeting this entity type.
- page_token: str | None = None#
Opaque token returned by a prior page; omit on the first request.
- statuses: list[roboto.domain.custom_fields.record.CustomFieldStatus] = None#
Statuses to include in the results. Must contain at least one status.
- class roboto.domain.custom_fields.operations.UpdateCustomFieldRequest(/, **data)#
Bases:
pydantic.BaseModelRequest 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; passNoneexplicitly to clear an attribute.- Parameters:
data (Any)
- description: FieldDescription | None | roboto.sentinels.NotSetType#
New description for the field, or
Noneto clear it.Leave as
NotSetto leave unchanged. Surrounding whitespace is removed, and text that is empty once stripped clears the attribute.
- display_name: FieldDisplayName | None | roboto.sentinels.NotSetType#
New display name for the field, or
Noneto clear it.Leave as
NotSetto leave unchanged. Surrounding whitespace is removed, and text that is empty once stripped clears the attribute.
- model_config#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- type roboto.domain.custom_fields.operations.ValidatedCustomFieldOptions = Annotated[CustomFieldOptions, pydantic.AfterValidator(_validate_field_options)]#
Custom field options as supplied when a field is defined - tidied and checked.