---
sidebar:
  label: roboto.updates
  order: 29
title: roboto.updates
---
## Module Contents

### CustomFieldChangeset

```python
class roboto.updates.CustomFieldChangeset(/, **data: Any)
```

`from roboto.updates import CustomFieldChangeset`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L365-L461)

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`](/reference/python-sdk/roboto/domain/custom_fields/record#roboto.domain.custom_fields.record.CustomFieldStatus.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`)

**Attributes**

- **CustomFieldChangeset.clear_fields** (`StrSequence | None`) = `None`: Field names whose values should be cleared to `None`.

- **CustomFieldChangeset.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`](/reference/python-sdk/roboto/domain/custom_fields/record#roboto.domain.custom_fields.record.CustomFieldType).

#### CustomFieldChangeset.Builder

```python
class Builder
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L394-L415)

##### CustomFieldChangeset.Builder.build()

```python
def build() -> CustomFieldChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L410-L415)

**Returns**

- `CustomFieldChangeset`

##### CustomFieldChangeset.Builder.clear_field()

```python
def clear_field(name: str) -> CustomFieldChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L406-L408)

**Parameters**

- **name** (`str`)

**Returns**

- `CustomFieldChangeset`

##### CustomFieldChangeset.Builder.set_field()

```python
def set_field(name: str, value: Any) -> CustomFieldChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L402-L404)

**Parameters**

- **name** (`str`)
- **value** (`Any`)

**Returns**

- `CustomFieldChangeset`

#### CustomFieldChangeset.apply_field_updates()

```python
def apply_field_updates(existing: dict[str, Any]) -> dict[str, Any]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L417-L434)

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.

#### CustomFieldChangeset.combine()

```python
def combine(other: CustomFieldChangeset) -> CustomFieldChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L436-L457)

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**

- **other** (`CustomFieldChangeset`)

**Returns**

- `CustomFieldChangeset`

#### CustomFieldChangeset.is_empty()

```python
def is_empty() -> bool
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L459-L461)

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

**Returns**

- `bool`

### MetadataChangeset

```python
class roboto.updates.MetadataChangeset(/, **data: Any)
```

`from roboto.updates import MetadataChangeset`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L162-L361)

Bases: `pydantic.BaseModel`

Changeset for metadata

**Parameters**

- **data** (`Any`)

**Attributes**

- **MetadataChangeset.put_fields** (`dict[str, Any] | None`) = `None`
- **MetadataChangeset.put_tags** (`StrSequence | None`) = `None`
- **MetadataChangeset.remove_fields** (`StrSequence | None`) = `None`
- **MetadataChangeset.remove_tags** (`StrSequence | None`) = `None`
- **MetadataChangeset.replace_all** (`bool`) = `False`

#### MetadataChangeset.Builder

```python
class Builder
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L180-L215)

##### MetadataChangeset.Builder.build()

```python
def build() -> MetadataChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L208-L215)

**Returns**

- `MetadataChangeset`

##### MetadataChangeset.Builder.put_field()

```python
def put_field(key: str, value: Any) -> MetadataChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L200-L202)

**Parameters**

- **key** (`str`)
- **value** (`Any`)

**Returns**

- `MetadataChangeset`

##### MetadataChangeset.Builder.put_tag()

```python
def put_tag(tag: str) -> MetadataChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L192-L194)

**Parameters**

- **tag** (`str`)

**Returns**

- `MetadataChangeset`

##### MetadataChangeset.Builder.remove_field()

```python
def remove_field(key: str) -> MetadataChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L204-L206)

**Parameters**

- **key** (`str`)

**Returns**

- `MetadataChangeset`

##### MetadataChangeset.Builder.remove_tag()

```python
def remove_tag(tag: str) -> MetadataChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L196-L198)

**Parameters**

- **tag** (`str`)

**Returns**

- `MetadataChangeset`

#### MetadataChangeset.apply_field_updates()

```python
def apply_field_updates(existing_metadata: dict[str, Any]) -> dict[str, Any]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L222-L233)

**Parameters**

- **existing_metadata** (`dict[str, Any]`)

**Returns**

- `dict[str, Any]`

#### MetadataChangeset.apply_tag_updates()

```python
def apply_tag_updates(existing_tags: list[str]) -> StrSequence
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L235-L247)

**Parameters**

- **existing_tags** (`list[str]`)

**Returns**

- `StrSequence`

#### MetadataChangeset.combine()

```python
def combine(other: MetadataChangeset) -> MetadataChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L266-L272)

**Parameters**

- **other** (`MetadataChangeset`)

**Returns**

- `MetadataChangeset`

#### MetadataChangeset.from_metadata()

```python
@classmethod
def from_metadata(metadata: Mapping[str, Any]) -> MetadataChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L218-L220)

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

**Parameters**

- **metadata** (`Mapping[str, Any]`)

**Returns**

- `MetadataChangeset`

#### MetadataChangeset.is_empty()

```python
def is_empty() -> bool
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L274-L282)

**Returns**

- `bool`

### StrSequence

```python
roboto.updates.StrSequence
```

`from roboto.updates import StrSequence`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L15-L15)

### TaglessMetadataChangeset

```python
class roboto.updates.TaglessMetadataChangeset(/, **data: Any)
```

`from roboto.updates import TaglessMetadataChangeset`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L19-L158)

Bases: `pydantic.BaseModel`

Changeset for tagless metadata

**Parameters**

- **data** (`Any`)

**Attributes**

- **TaglessMetadataChangeset.put_fields** (`dict[str, Any] | None`) = `None`
- **TaglessMetadataChangeset.remove_fields** (`StrSequence | None`) = `None`
- **TaglessMetadataChangeset.replace_all** (`bool`) = `False`

#### TaglessMetadataChangeset.Builder

```python
class Builder
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L34-L55)

##### TaglessMetadataChangeset.Builder.build()

```python
def build() -> TaglessMetadataChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L50-L55)

**Returns**

- `TaglessMetadataChangeset`

##### TaglessMetadataChangeset.Builder.put_field()

```python
def put_field(key: str, value: Any) -> TaglessMetadataChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L42-L44)

**Parameters**

- **key** (`str`)
- **value** (`Any`)

**Returns**

- `TaglessMetadataChangeset`

##### TaglessMetadataChangeset.Builder.remove_field()

```python
def remove_field(key: str) -> TaglessMetadataChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L46-L48)

**Parameters**

- **key** (`str`)

**Returns**

- `TaglessMetadataChangeset`

#### TaglessMetadataChangeset.apply_field_updates()

```python
def apply_field_updates(existing_metadata: dict[str, Any]) -> dict[str, Any]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L63-L74)

**Parameters**

- **existing_metadata** (`dict[str, Any]`)

**Returns**

- `dict[str, Any]`

#### TaglessMetadataChangeset.from_replacement_metadata()

```python
@classmethod
def from_replacement_metadata(metadata: dict[str, Any]) -> TaglessMetadataChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L58-L61)

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

**Parameters**

- **metadata** (`dict[str, Any]`)

**Returns**

- `TaglessMetadataChangeset`

#### TaglessMetadataChangeset.has_changes()

```python
def has_changes() -> bool
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L76-L79)

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

**Returns**

- `bool`

### UpdateCondition

```python
class roboto.updates.UpdateCondition(/, **data: Any)
```

`from roboto.updates import UpdateCondition`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/updates.py#L464-L478)

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](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html)

**Parameters**

- **data** (`Any`)

**Attributes**

- **UpdateCondition.comparator** (`Literal['eq', 'ne']`)
- **UpdateCondition.key** (`str`)
- **UpdateCondition.value** (`Any`) = `None`
