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

roboto.updates

Module Contents

CustomFieldChangeset

class roboto.updates.CustomFieldChangeset(/, **data)#View Source

Bases: pydantic.BaseModel

Describes 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 as None.

Parameters

data Any

CustomFieldChangeset.Builder

class Builder#View Source
CustomFieldChangeset.Builder.build()
build()#View Source
CustomFieldChangeset.Builder.clear_field()
clear_field(name)#View Source

Parameters

name str
CustomFieldChangeset.Builder.set_field()
set_field(name, value)#View Source

Parameters

name str
value Any

CustomFieldChangeset.apply_field_updates()

apply_field_updates(existing)#View Source

Apply this changeset to an existing custom-field map.

Parameters

existing dict[str, Any]

Current custom-field name-to-value map. Not mutated.

Returns

dict[str, Any]

A new map reflecting the changeset. set_fields entries overwrite existing values; clear_fields entries set their values to None. Field names not mentioned by the changeset are carried through unchanged.

Attributes

CustomFieldChangeset.clear_fields

clear_fields StrSequence | None = None #

Field names whose values should be cleared to None.

CustomFieldChangeset.combine()

combine(other)#View Source

Merge this changeset with other such that other wins on conflicts.

For any field name appearing in both set_fields maps, other’s value wins. A field appearing in one side’s set_fields and the other side’s clear_fields resolves to whichever side is other.

Parameters

CustomFieldChangeset.is_empty()

is_empty()#View Source

Return True when applying this changeset would not change any value.

Return type

bool

Attributes

CustomFieldChangeset.set_fields

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.

MetadataChangeset

class roboto.updates.MetadataChangeset(/, **data)#View Source

Bases: pydantic.BaseModel

Changeset for metadata

Parameters

data Any

MetadataChangeset.Builder

class Builder#View Source
MetadataChangeset.Builder.build()
build()#View Source
MetadataChangeset.Builder.put_field()
put_field(key, value)#View Source

Parameters

key str
value Any
MetadataChangeset.Builder.put_tag()
put_tag(tag)#View Source

Parameters

tag str
MetadataChangeset.Builder.remove_field()
remove_field(key)#View Source

Parameters

key str
MetadataChangeset.Builder.remove_tag()
remove_tag(tag)#View Source

Parameters

tag str

MetadataChangeset.apply_field_updates()

apply_field_updates(existing_metadata)#View Source

Parameters

existing_metadata dict[str, Any]

Return type

dict[str, Any]

MetadataChangeset.apply_tag_updates()

apply_tag_updates(existing_tags)#View Source

Parameters

existing_tags list[str]

Return type

MetadataChangeset.combine()

combine(other)#View Source

Parameters

MetadataChangeset.from_metadata()

classmethod from_metadata(metadata)#View Source

Creates a changeset that will replace any existing metadata with what’s provided.

Parameters

metadata Mapping[str, Any]

MetadataChangeset.is_empty()

is_empty()#View Source

Return type

bool

Attributes

MetadataChangeset.put_fields

put_fields dict[str, Any] | None = None #

MetadataChangeset.put_tags

put_tags StrSequence | None = None #

MetadataChangeset.remove_fields

remove_fields StrSequence | None = None #

MetadataChangeset.remove_tags

remove_tags StrSequence | None = None #

MetadataChangeset.replace_all

replace_all bool = False #

StrSequence

roboto.updates.StrSequence#View Source

TaglessMetadataChangeset

class roboto.updates.TaglessMetadataChangeset(/, **data)#View Source

Bases: pydantic.BaseModel

Changeset for tagless metadata

Parameters

data Any

TaglessMetadataChangeset.Builder

class Builder#View Source
TaglessMetadataChangeset.Builder.build()
build()#View Source
TaglessMetadataChangeset.Builder.put_field()
put_field(key, value)#View Source

Parameters

key str
value Any
TaglessMetadataChangeset.Builder.remove_field()
remove_field(key)#View Source

Parameters

key str

TaglessMetadataChangeset.apply_field_updates()

apply_field_updates(existing_metadata)#View Source

Parameters

existing_metadata dict[str, Any]

Return type

dict[str, Any]

TaglessMetadataChangeset.from_replacement_metadata()

classmethod from_replacement_metadata(metadata)#View Source

Creates a changeset to replace any existing metadata with the metadata provided.

Parameters

metadata dict[str, Any]

TaglessMetadataChangeset.has_changes()

has_changes()#View Source

Checks whether applying this changeset would result in any metadata changes.

Return type

bool

Attributes

TaglessMetadataChangeset.put_fields

put_fields dict[str, Any] | None = None #

TaglessMetadataChangeset.remove_fields

remove_fields StrSequence | None = None #

TaglessMetadataChangeset.replace_all

replace_all bool = False #

UpdateCondition

class roboto.updates.UpdateCondition(/, **data)#View Source

Bases: pydantic.BaseModel

A condition to be applied to an update operation, succeeding only if the condition evaluates to True at update-time.

value is compared to the resource’s current value of key using comparator.

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

Attributes

UpdateCondition.comparator

comparator Literal['eq', 'ne'] #

UpdateCondition.key

key str #

UpdateCondition.value

value Any = None #

Was this page helpful?