---
sidebar:
  hidden: true
title: roboto.domain.topics.operations
---
## Module Contents

### AddMessagePathRepresentationRequest

```python
class roboto.domain.topics.operations.AddMessagePathRepresentationRequest(
    /,
    **data: Any,
)
```

`from roboto import AddMessagePathRepresentationRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/operations.py#L81-L95)

Bases: [`BaseAddRepresentationRequest`](/docs/reference/python-sdk/roboto/domain/topics/operations#roboto.domain.topics.operations.BaseAddRepresentationRequest)

Request body for [`add_message_path_representation()`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic.add_message_path_representation).

Registers the representation and links it to one of the topic's message paths.

**Parameters**

- **data** (`Any`)

**Attributes**

- **AddMessagePathRepresentationRequest.message_path_id** (`str`): ID of the message path the representation holds data for, beginning with `mp_`.

  A message path of another topic fails the request with `RobotoNotFoundException`.

- **AddMessagePathRepresentationRequest.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

### AddMessagePathRequest

```python
class roboto.domain.topics.operations.AddMessagePathRequest(/, **data: Any)
```

`from roboto import AddMessagePathRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/operations.py#L98-L138)

Bases: `pydantic.BaseModel`

Request body for [`add_message_path()`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic.add_message_path).

Also describes each message path a topic is created with (`CreateTopicRequest`) or gains in an update (`MessagePathChangeset`).

**Parameters**

- **data** (`Any`)

**Attributes**

- **AddMessagePathRequest.canonical_data_type** (`roboto.domain.topics.record.CanonicalDataType`): Roboto data type of the field, which determines how Roboto interprets and visualizes it.

  For example, it decides whether Roboto treats the field as a location on a map, an image, or a timestamp.

- **AddMessagePathRequest.data_type** (`str`): Data type of the field as the source data names it, such as `"float32"` or `"geometry_msgs/Pose"`.

- **AddMessagePathRequest.message_path** (`str`): Dot-delimited path to a field within the topic's messages, such as `"pose.position.x"`.

  Unique within the topic.

- **AddMessagePathRequest.metadata** (`dict[str, Any]`) = `None`: Key-value metadata to set on the message path, such as `{"min": 0.71, "max": 1.77}`.

- **AddMessagePathRequest.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

- **AddMessagePathRequest.path_in_schema** (`list[str]`) = `None`: Path components of the field in the source data's schema, outermost first.

  For example, `["position", "x"]` for `position.x`.

  Unlike `message_path`, which splits on dots, it keeps a field name that contains a dot as one component.

### BaseAddRepresentationRequest

```python
class roboto.domain.topics.operations.BaseAddRepresentationRequest(/, **data: Any)
```

`from roboto.domain.topics.operations import BaseAddRepresentationRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/operations.py#L33-L66)

Bases: `pydantic.BaseModel`

Fields shared by the requests that register a representation of a topic's data.

A representation is a stored copy of a topic's data in one format, such as an MCAP or Parquet file. Within a topic, `association`, `storage_format` and `version` together identify a representation, so registering a combination the topic already has updates that representation's `format` and `transformations` instead of adding another.

**Parameters**

- **data** (`Any`)

**Attributes**

- **BaseAddRepresentationRequest.association** (`roboto.association.Association`): File, or other resource, that holds the representation's data. It must exist.

- **BaseAddRepresentationRequest.format** (`str | None`) = `None`: Content format of the data, such as an image encoding or a ROS schema name.

  For example `"jpeg"` or `"sensor_msgs/Image"`. `None` keeps the stored format when the representation already exists.

- **BaseAddRepresentationRequest.storage_format** (`roboto.domain.topics.record.RepresentationStorageFormat`): Format the representation's data is stored in.

- **BaseAddRepresentationRequest.transformations** (`list[str] | None`) = `None`: Transformations applied to produce the representation, in order.

  Each is a `"<kind>:<param>"` string such as `"downsample:0.5"` (see [`TransformationKind`](/docs/reference/python-sdk/roboto/domain/topics/record#roboto.domain.topics.record.TransformationKind)).

  `None` keeps the stored list when the representation already exists, and records none otherwise. An empty list clears it.

- **BaseAddRepresentationRequest.version** (`int`): Version number of the representation.

### CreateTopicRequest

```python
class roboto.domain.topics.operations.CreateTopicRequest(/, **data: Any)
```

`from roboto import CreateTopicRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/operations.py#L264-L303)

Bases: `pydantic.BaseModel`

Request body for [`create()`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic.create), which registers a topic found in a file.

**Parameters**

- **data** (`Any`)

**Attributes**

- **CreateTopicRequest.association** (`roboto.association.Association`): File, or other resource, the topic belongs to. It must exist.

- **CreateTopicRequest.end_time** (`roboto.time._NanosecondsFromInteger | None`) = `None`: End of the topic's data, in nanoseconds since the Unix epoch. Must not be negative.

- **CreateTopicRequest.message_count** (`int | None`) = `None`: Number of messages in the topic. Must not be negative.

- **CreateTopicRequest.message_paths** (`collections.abc.Sequence[AddMessagePathRequest] | None`) = `None`: Message paths to create with the topic.

  No two may have the same `message_path`. When `schema_name` is also set, they define the topic's schema.

- **CreateTopicRequest.metadata** (`collections.abc.Mapping[str, Any] | None`) = `None`: Key-value metadata to set on the topic.

- **CreateTopicRequest.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

- **CreateTopicRequest.schema_checksum** (`str | None`) = `None`: Checksum of the topic's message schema.

- **CreateTopicRequest.schema_name** (`str | None`) = `None`: Name of the topic's message schema, such as `"sensor_msgs/Imu"`.

- **CreateTopicRequest.start_time** (`roboto.time._NanosecondsFromInteger | None`) = `None`: Start of the topic's data, in nanoseconds since the Unix epoch. Must not be negative.

- **CreateTopicRequest.topic_name** (`str`): Name of the topic, such as `"/imu/data"`.

  Must not be blank, and must be unique within `association`: a name already taken fails with `RobotoConflictException`.

### DeleteMessagePathRequest

```python
class roboto.domain.topics.operations.DeleteMessagePathRequest(/, **data: Any)
```

`from roboto import DeleteMessagePathRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/operations.py#L183-L193)

Bases: `pydantic.BaseModel`

One message path to delete from a topic.

Carried in `MessagePathChangeset.message_paths_to_delete`. Deleting a message path deletes its metadata, and also deletes any event that was linked to nothing but the deleted message paths. It cannot be undone.

**Parameters**

- **data** (`Any`)

**Attributes**

- **DeleteMessagePathRequest.message_path** (`str`): Dot-delimited path of the message path to delete. A path the topic does not have is skipped.
- **DeleteMessagePathRequest.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

### MessagePathChangeset

```python
class roboto.domain.topics.operations.MessagePathChangeset(/, **data: Any)
```

`from roboto import MessagePathChangeset`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/operations.py#L196-L261)

Bases: `pydantic.BaseModel`

Message paths to add, update, and delete on a topic, passed to [`update()`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic.update).

Roboto applies the changeset together with the rest of the topic update: all of it, or none of it if any part is refused. To replace every message path on a topic, build the changeset with `from_replacement_message_paths`. Building a changeset that breaks the requirements of `replace_all` raises `pydantic.ValidationError`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **MessagePathChangeset.message_paths_to_add** (`collections.abc.Sequence[AddMessagePathRequest] | None`) = `None`: Message paths to add.

  Adding a path the topic already has fails the update with `RobotoConflictException`, unless `replace_all` is set.

- **MessagePathChangeset.message_paths_to_delete** (`collections.abc.Sequence[DeleteMessagePathRequest] | None`) = `None`: Message paths to delete. A path the topic does not have is skipped.

- **MessagePathChangeset.message_paths_to_update** (`collections.abc.Sequence[UpdateMessagePathRequest] | None`) = `None`: Message paths to update. A path the topic does not have is skipped.

- **MessagePathChangeset.replace_all** (`bool`) = `False`: Whether `message_paths_to_add` replaces every message path on the topic.

  When set, Roboto deletes each existing message path the list leaves out, overwrites the data type, canonical data type, path in schema, and metadata of each one it repeats, and adds the rest. Requires `message_paths_to_add`, with `message_paths_to_update` and `message_paths_to_delete` left `None`.

#### MessagePathChangeset.check_replace_all_correctness()

```python
def check_replace_all_correctness() -> MessagePathChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/operations.py#L226-L234)

Reject a changeset that sets `replace_all` without `message_paths_to_add`, or with either other list.

**Returns**

- `MessagePathChangeset`

#### MessagePathChangeset.from_replacement_message_paths()

```python
@classmethod
def from_replacement_message_paths(
    message_paths: collections.abc.Sequence[AddMessagePathRequest],
) -> MessagePathChangeset
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/operations.py#L237-L248)

Build a changeset that replaces every message path on a topic with `message_paths`.

`MessagePathChangeset.from_replacement_message_paths(paths)` builds the same changeset as `MessagePathChangeset(message_paths_to_add=paths, replace_all=True)`.

**Parameters**

- **message_paths** (`collections.abc.Sequence[AddMessagePathRequest]`): Message paths the topic has after the update.

**Returns**

- `MessagePathChangeset`

#### MessagePathChangeset.has_changes()

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

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/operations.py#L250-L261)

Return whether applying the changeset would change the topic's message paths.

A changeset with `replace_all` set always counts, even with an empty list, because it deletes every message path the list leaves out.

**Returns**

- `bool`

### SetDefaultRepresentationRequest

```python
class roboto.domain.topics.operations.SetDefaultRepresentationRequest(/, **data: Any)
```

`from roboto import SetDefaultRepresentationRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/operations.py#L69-L78)

Bases: [`BaseAddRepresentationRequest`](/docs/reference/python-sdk/roboto/domain/topics/operations#roboto.domain.topics.operations.BaseAddRepresentationRequest)

Request body for [`set_default_representation()`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic.set_default_representation).

Registers the representation and makes it the topic's default, which Roboto reads for every message path that has no representation of its own. The topic's other representations stay registered and stop being the default.

**Parameters**

- **data** (`Any`)

**Attributes**

- **SetDefaultRepresentationRequest.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

### SetTimelineOffsetsRequest

```python
class roboto.domain.topics.operations.SetTimelineOffsetsRequest(/, **data: Any)
```

`from roboto.domain.topics import SetTimelineOffsetsRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/operations.py#L399-L414)

Bases: `pydantic.BaseModel`

Request body for `File.set_timeline_offsets`.

Roboto applies every entry, or none of them if any is refused. Building a request with no entries raises `pydantic.ValidationError`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **SetTimelineOffsetsRequest.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

- **SetTimelineOffsetsRequest.offsets** (`list[TimelineOffsetEntry]`) = `None`: Offsets to apply, at least one.

  An entry whose selectors match none of the file's timelines is skipped, as long as another entry matches one; a request whose entries together match none fails with `RobotoNotFoundException`. When two entries match the same timeline, the later entry's offset applies.

### TimelineOffsetEntry

```python
class roboto.domain.topics.operations.TimelineOffsetEntry(/, **data: Any)
```

`from roboto.domain.topics import TimelineOffsetEntry`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/operations.py#L345-L396)

Bases: `pydantic.BaseModel`

One offset to apply to a file's timelines.

Carried in `SetTimelineOffsetsRequest.offsets`. With no selector set, the offset applies to every timeline on the file. `topic_name` limits it to one topic, and `timeline_source_name` or `timeline_source_id` (at most one of them) limits it to some of the topic's timeline sources. Sent by `File.set_timeline_offsets`.

Building it raises `pydantic.ValidationError` when:

- it sets both `timeline_source_name` and `timeline_source_id`.
- `unix_epoch_offset_ns` is negative or greater than [`INT64_MAX`](/docs/reference/python-sdk/roboto/int64#roboto.int64.INT64_MAX).
- `unix_epoch_offset_ns` is not a time that [`to_epoch_nanoseconds()`](/docs/reference/python-sdk/roboto/time#roboto.time.to_epoch_nanoseconds) accepts.

**Parameters**

- **data** (`Any`)

**Attributes**

- **TimelineOffsetEntry.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

- **TimelineOffsetEntry.timeline_source_id** (`str | None`) = `None`: ID of the one timeline source to apply the offset to.

  Take it from the source's `TimelineSourceRecord`. Set at most one of this and `timeline_source_name`.

- **TimelineOffsetEntry.timeline_source_name** (`str | None`) = `None`: Name of the timeline sources to apply the offset to, such as `"header.stamp"`.

  Names are not unique, so the offset applies to every source of this name, within `topic_name` when it is set. `None` applies it to every source.

- **TimelineOffsetEntry.topic_name** (`str | None`) = `None`: Name of the topic to apply the offset to, such as `"/imu/raw"`.

  Topic names are unique within a file. `None` applies it to every topic.

- **TimelineOffsetEntry.unix_epoch_offset_ns** (`roboto.time._EpochNanosecondsFromTime`) = `None`: Nanoseconds to add to the file's stored timestamps to make them Unix-epoch time.

  That is, `unix_epoch_time_ns = stored_time_ns + unix_epoch_offset_ns`.

  Must be from 0 to `2**63 - 1`, the largest signed 64-bit integer ([`INT64_MAX`](/docs/reference/python-sdk/roboto/int64#roboto.int64.INT64_MAX)). Also accepts any [`Time`](/docs/reference/python-sdk/roboto/time#roboto.time.Time), converted by [`to_epoch_nanoseconds()`](/docs/reference/python-sdk/roboto/time#roboto.time.to_epoch_nanoseconds), so a `datetime` gives the instant at which stored time 0 occurred. A type checker accepts only an `int`; convert other values with that function first.

### TimelineSourceUpdate

```python
class roboto.domain.topics.operations.TimelineSourceUpdate(/, **data: Any)
```

`from roboto.domain.topics import TimelineSourceUpdate`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/operations.py#L417-L437)

Bases: `pydantic.BaseModel`

Request body for `PUT /v2/topics/schema/id/{schema_id}/timeline-sources/{timeline_source_id}`.

Renames a timeline source, changes whether it is its schema's default, or both. A field left unset (`NotSet`) leaves that property unchanged.

**Parameters**

- **data** (`Any`)

**Attributes**

- **TimelineSourceUpdate.is_default** (`bool | roboto.sentinels.NotSetType`): Whether the source is its schema's default.

  `True` moves the default to this source from the schema's current default. `False` on the default source leaves the schema with no default, so reads of its topics must name a source until another becomes the default.

- **TimelineSourceUpdate.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

- **TimelineSourceUpdate.name** (`str | roboto.sentinels.NotSetType`): Human-readable name of the timeline source. Names are not unique within a schema.

### UpdateMessagePathRequest

```python
class roboto.domain.topics.operations.UpdateMessagePathRequest(/, **data: Any)
```

`from roboto import UpdateMessagePathRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/operations.py#L141-L180)

Bases: `pydantic.BaseModel`

Request body for [`update_message_path()`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic.update_message_path).

Also describes each update in `MessagePathChangeset.message_paths_to_update`. A field left unset (`NotSet`) leaves that property of the message path unchanged.

**Parameters**

- **data** (`Any`)

**Attributes**

- **UpdateMessagePathRequest.canonical_data_type** (`roboto.domain.topics.record.CanonicalDataType | roboto.sentinels.NotSetType`): Roboto data type of the field. Changing it changes how Roboto interprets and visualizes the field's data.

- **UpdateMessagePathRequest.data_type** (`str | roboto.sentinels.NotSetType`): Data type of the field as the source data names it, such as `"float32"`.

- **UpdateMessagePathRequest.message_path** (`str`): Dot-delimited path of the message path to update, such as `"pose.position.x"`.

  When the topic has no message path at this path, [`update_message_path()`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic.update_message_path) fails with `RobotoNotFoundException`, and a changeset skips the update.

- **UpdateMessagePathRequest.metadata_changeset** (`roboto.updates.TaglessMetadataChangeset | roboto.sentinels.NotSetType`): Changes to the message path's metadata.

- **UpdateMessagePathRequest.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

- **UpdateMessagePathRequest.path_in_schema** (`list[str] | roboto.sentinels.NotSetType`): Path components of the field in the source data's schema, outermost first, such as `["position", "x"]`.

#### UpdateMessagePathRequest.has_updates()

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

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/operations.py#L169-L180)

Return whether the request changes anything about the message path.

A `metadata_changeset` with no changes in it does not count.

**Returns**

- `bool`

### UpdateTopicRequest

```python
class roboto.domain.topics.operations.UpdateTopicRequest(/, **data: Any)
```

`from roboto import UpdateTopicRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/topics/operations.py#L306-L342)

Bases: `pydantic.BaseModel`

Request body for [`update()`](/docs/reference/python-sdk/roboto/domain/topics/topic#roboto.domain.topics.topic.Topic.update).

A field left unset (`NotSet`) leaves that property of the topic unchanged.

**Parameters**

- **data** (`Any`)

**Attributes**

- **UpdateTopicRequest.end_time** (`roboto.time._NanosecondsFromInteger | None | roboto.sentinels.NotSetType`): End of the topic's data, in nanoseconds since the Unix epoch.

  Must not be negative, and must not be before `start_time` when the request sets both. `None` clears it.

- **UpdateTopicRequest.message_count** (`int | roboto.sentinels.NotSetType`): Number of messages in the topic. Must not be negative.

- **UpdateTopicRequest.message_path_changeset** (`MessagePathChangeset | roboto.sentinels.NotSetType`): Message paths to add, update, and delete.

- **UpdateTopicRequest.metadata_changeset** (`roboto.updates.MetadataChangeset | roboto.sentinels.NotSetType`): Changes to the topic's metadata. Topics have no tags, so the changeset's tag changes have no effect.

- **UpdateTopicRequest.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

- **UpdateTopicRequest.schema_checksum** (`str | None | roboto.sentinels.NotSetType`): Checksum of the topic's message schema.

  Setting it requires a schema name, already on the topic or set by this request. `None` clears it.

- **UpdateTopicRequest.schema_name** (`str | None | roboto.sentinels.NotSetType`): Name of the topic's message schema, such as `"sensor_msgs/Imu"`.

  `None` clears it; when the topic has a schema checksum, the request must clear that too.

- **UpdateTopicRequest.start_time** (`roboto.time._NanosecondsFromInteger | None | roboto.sentinels.NotSetType`): Start of the topic's data, in nanoseconds since the Unix epoch. Must not be negative. `None` clears it.
