roboto.updates#
Module Contents#
- class roboto.updates.CustomFieldChangeset(/, **data)#
Bases:
pydantic.BaseModelDescribes a set of changes to apply to an entity’s custom-field values.
Each referenced field name must be a custom field defined for the entity’s type in the caller’s organization, and that field must be
Ready. Any value supplied must satisfy that field’s declared type. Field names not mentioned by the changeset are left unchanged. A cleared field reads back asNone.- Parameters:
data (Any)
- class Builder#
- build()#
- Return type:
- clear_field(name)#
- Parameters:
name (str)
- Return type:
- set_field(name, value)#
- Parameters:
name (str)
value (Any)
- Return type:
- apply_field_updates(existing)#
Apply this changeset to an existing custom-field map.
- Parameters:
existing (dict[str, Any]) – Current custom-field name-to-value map. Not mutated.
- Returns:
A new map reflecting the changeset.
set_fieldsentries overwrite existing values;clear_fieldsentries set their values toNone. Field names not mentioned by the changeset are carried through unchanged.- Return type:
dict[str, Any]
- clear_fields: StrSequence | None = None#
Field names whose values should be cleared to
None.
- combine(other)#
Merge this changeset with
othersuch thatotherwins on conflicts.For any field name appearing in both
set_fieldsmaps,other’s value wins. A field appearing in one side’sset_fieldsand the other side’sclear_fieldsresolves to whichever side isother.- Parameters:
other (CustomFieldChangeset)
- Return type:
- is_empty()#
Return
Truewhen applying this changeset would not change any value.- Return type:
bool
- set_fields: dict[str, Any] | None = None#
Field names to set or overwrite, mapped to their new values.
Each value’s Python type must match the corresponding field’s declared
CustomFieldType.
- class roboto.updates.MetadataChangeset(/, **data)#
Bases:
pydantic.BaseModelChangeset for metadata
- Parameters:
data (Any)
- class Builder#
- build()#
- Return type:
- put_field(key, value)#
- Parameters:
key (str)
value (Any)
- Return type:
- put_tag(tag)#
- Parameters:
tag (str)
- Return type:
- remove_field(key)#
- Parameters:
key (str)
- Return type:
- remove_tag(tag)#
- Parameters:
tag (str)
- Return type:
- apply_field_updates(existing_metadata)#
- Parameters:
existing_metadata (dict[str, Any])
- Return type:
dict[str, Any]
- apply_tag_updates(existing_tags)#
- Parameters:
existing_tags (list[str])
- Return type:
StrSequence
- combine(other)#
- Parameters:
other (MetadataChangeset)
- Return type:
- classmethod from_metadata(metadata)#
Creates a changeset that will replace any existing metadata with what’s provided.
- Parameters:
metadata (Mapping[str, Any])
- Return type:
- is_empty()#
- Return type:
bool
- put_fields: dict[str, Any] | None = None#
- put_tags: StrSequence | None = None#
- remove_fields: StrSequence | None = None#
- remove_tags: StrSequence | None = None#
- replace_all: bool = False#
- roboto.updates.StrSequence#
- class roboto.updates.TaglessMetadataChangeset(/, **data)#
Bases:
pydantic.BaseModelChangeset for tagless metadata
- Parameters:
data (Any)
- class Builder#
- build()#
- Return type:
- put_field(key, value)#
- Parameters:
key (str)
value (Any)
- Return type:
- remove_field(key)#
- Parameters:
key (str)
- Return type:
- apply_field_updates(existing_metadata)#
- Parameters:
existing_metadata (dict[str, Any])
- Return type:
dict[str, Any]
- classmethod from_replacement_metadata(metadata)#
Creates a changeset to replace any existing metadata with the metadata provided.
- Parameters:
metadata (dict[str, Any])
- Return type:
- has_changes()#
Checks whether applying this changeset would result in any metadata changes.
- Return type:
bool
- put_fields: dict[str, Any] | None = None#
- remove_fields: StrSequence | None = None#
- replace_all: bool = False#
- class roboto.updates.UpdateCondition(/, **data)#
Bases:
pydantic.BaseModelA condition to be applied to an update operation, succeeding only if the condition evaluates to True at update-time.
valueis compared to the resource’s current value ofkeyusingcomparator.This is a severely constrainted subset of the conditions supported by DynamoDB. See: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html
- Parameters:
data (Any)
- comparator: Literal['eq', 'ne']#
- key: str#
- value: Any = None#