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

### CreateEventRequest

```python
class roboto.domain.events.operations.CreateEventRequest(/, **data: Any)
```

`from roboto.domain.events import CreateEventRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/events/operations.py#L79-L134)

Bases: `pydantic.BaseModel`

Request body for [`create()`](/docs/reference/python-sdk/roboto/domain/events/event#roboto.domain.events.event.Event.create).

Building it raises `pydantic.ValidationError` when `name` is longer than `MAX_EVENT_NAME_BYTES` in UTF-8.

**Parameters**

- **data** (`Any`)

**Attributes**

- **CreateEventRequest.associations** (`list[roboto.association.Association]`) = `None`: Datasets, files, topics and message paths the event is associated with.

  Must contain at least one, and each must belong to the organization the event is created in. Otherwise the request raises `RobotoInvalidRequestException`.

- **CreateEventRequest.custom_fields** (`dict[str, Any] | None`) = `None`: Initial values for the event's custom fields, keyed by field name. `None` sets none.

  Each name must be a [`CustomField`](/docs/reference/python-sdk/roboto/domain/custom_fields/custom_field#roboto.domain.custom_fields.custom_field.CustomField) defined for [`Event`](/docs/reference/python-sdk/roboto/domain/custom_fields/record#roboto.domain.custom_fields.record.TargetEntityType.Event) in the organization the event is created in, with status [`Ready`](/docs/reference/python-sdk/roboto/domain/custom_fields/record#roboto.domain.custom_fields.record.CustomFieldStatus.Ready), and each value must match that field's declared type. Otherwise the request raises `RobotoIllegalArgumentException`.

- **CreateEventRequest.description** (`str | None`) = `None`: Human-readable description of the event.

- **CreateEventRequest.display_options** (`EventDisplayOptions | None`) = `None`: How Roboto displays the event, such as its color. `None` lets Roboto choose.

- **CreateEventRequest.end_time** (`int`): End of the event, in nanoseconds since the Unix epoch.

  Equal to `start_time` for an event at a single instant, and never earlier than `start_time`.

- **CreateEventRequest.metadata** (`dict[str, Any]`) = `None`: Key-value metadata to set on the event.

- **CreateEventRequest.name** (`str`): Human-readable name of the event, such as `"Takeoff"` or `"CPU Spike"`.

  Must not be blank, and at most 2,600 bytes long in UTF-8 (`MAX_EVENT_NAME_BYTES`). Event names are not unique.

- **CreateEventRequest.start_time** (`int`): Start of the event, in nanoseconds since the Unix epoch.

- **CreateEventRequest.tags** (`list[str]`) = `None`: Tags to set on the event. Defaults to none.

### DeleteEventsRequest

```python
class roboto.domain.events.operations.DeleteEventsRequest(/, **data: Any)
```

`from roboto.domain.events import DeleteEventsRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/events/operations.py#L146-L154)

Bases: `pydantic.BaseModel`

Request body for [`delete_many()`](/docs/reference/python-sdk/roboto/domain/events/event#roboto.domain.events.event.Event.delete_many).

IDs that match no event are skipped, so a request can be retried safely. If the caller cannot delete one of the events, the request fails and deletes nothing.

**Parameters**

- **data** (`Any`)

**Attributes**

- **DeleteEventsRequest.event_ids** (`list[str]`): IDs of the events to delete, at most 1,000 (`MAX_EVENTS_PER_DELETE_BATCH`).

### EventDisplayOptions

```python
class roboto.domain.events.operations.EventDisplayOptions(/, **data: Any)
```

`from roboto import EventDisplayOptions`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/events/operations.py#L32-L48)

Bases: `pydantic.BaseModel`

Options for how Roboto displays an event, such as its color.

Carried in [`display_options`](/docs/reference/python-sdk/roboto/domain/events/record#roboto.domain.events.record.EventRecord.display_options) and `CreateEventRequest.display_options`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **EventDisplayOptions.color** (`str | None`) = `None`: Display color of the event, as any CSS color value, such as `"red"`, `"#ff0000"` or `"rgb(255 0 0)"`.

  The color distinguishes the event on a timeline, and can signal what the event means, such as red for a critical issue. `None` lets Roboto choose a color.

#### EventDisplayOptions.has_options()

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

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/events/operations.py#L45-L48)

Return whether any display option is set.

**Returns**

- `bool`

### EventDisplayOptionsChangeset

```python
class roboto.domain.events.operations.EventDisplayOptionsChangeset(/, **data: Any)
```

`from roboto import EventDisplayOptionsChangeset`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/events/operations.py#L51-L76)

Bases: `pydantic.BaseModel`

Changes to an event's display options.

A field left unset (`NotSet`) is unchanged. Carried in `UpdateEventRequest.display_options_changeset`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **EventDisplayOptionsChangeset.color** (`str | None | roboto.sentinels.NotSetType`): Display color to set on the event, as any CSS color value. `None` clears it, so Roboto chooses one.
- **EventDisplayOptionsChangeset.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

#### EventDisplayOptionsChangeset.apply_to()

```python
def apply_to(display_options: EventDisplayOptions) -> EventDisplayOptions
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/events/operations.py#L62-L71)

Return the display options that result from applying this changeset to `display_options`.

**Parameters**

- **display_options** (`EventDisplayOptions`): Display options to apply the changes to. They are not modified.

**Returns**

- `EventDisplayOptions`

#### EventDisplayOptionsChangeset.has_changes()

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

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/events/operations.py#L73-L76)

Return whether this changeset changes any display option.

**Returns**

- `bool`

### MAX_EVENTS_PER_DELETE_BATCH

```python
roboto.domain.events.operations.MAX_EVENTS_PER_DELETE_BATCH = 1000
```

`from roboto.domain.events import MAX_EVENTS_PER_DELETE_BATCH`

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

Maximum number of event IDs in one `DeleteEventsRequest`.

A request with more fails with [`RobotoInvalidRequestException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoInvalidRequestException). [`delete_many()`](/docs/reference/python-sdk/roboto/domain/events/event#roboto.domain.events.event.Event.delete_many) accepts any number of IDs and sends them in requests of at most this many.

### MAX_EVENT_NAME_BYTES

```python
roboto.domain.events.operations.MAX_EVENT_NAME_BYTES = 2600
```

`from roboto.domain.events import MAX_EVENT_NAME_BYTES`

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

Maximum length of an event name, in bytes of its UTF-8 encoding.

Roboto enforces the same limit when it stores an event.

### QueryEventsForAssociationsRequest

```python
class roboto.domain.events.operations.QueryEventsForAssociationsRequest(/, **data: Any)
```

`from roboto.domain.events import QueryEventsForAssociationsRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/events/operations.py#L157-L167)

Bases: `pydantic.BaseModel`

Request body for [`get_by_associations()`](/docs/reference/python-sdk/roboto/domain/events/event#roboto.domain.events.event.Event.get_by_associations).

**Parameters**

- **data** (`Any`)

**Attributes**

- **QueryEventsForAssociationsRequest.associations** (`list[roboto.association.Association]`): Datasets, files, topics and message paths to find events for.

  An event matches when it is associated with any of them. Must contain at least one.

- **QueryEventsForAssociationsRequest.page_token** (`str | None`) = `None`: Token from a previous page's response that resumes the listing after it. `None` starts at the first page.

### UpdateEventRequest

```python
class roboto.domain.events.operations.UpdateEventRequest(/, **data: Any)
```

`from roboto.domain.events import UpdateEventRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/events/operations.py#L170-L219)

Bases: `pydantic.BaseModel`

Request body for [`update()`](/docs/reference/python-sdk/roboto/domain/events/event#roboto.domain.events.event.Event.update).

A field left at its default (`NotSet` or `None`) is unchanged. Building it raises `pydantic.ValidationError` when `name` is longer than `MAX_EVENT_NAME_BYTES` in UTF-8.

**Parameters**

- **data** (`Any`)

**Attributes**

- **UpdateEventRequest.custom_fields_changeset** (`roboto.updates.CustomFieldChangeset | None`) = `None`: Changes to the event's custom-field values. `None` leaves them unchanged.

  Each field name the changeset references must be a custom field defined for [`Event`](/docs/reference/python-sdk/roboto/domain/custom_fields/record#roboto.domain.custom_fields.record.TargetEntityType.Event) in the event's organization, with status [`Ready`](/docs/reference/python-sdk/roboto/domain/custom_fields/record#roboto.domain.custom_fields.record.CustomFieldStatus.Ready), and each `set_fields` value must match that field's declared type. Otherwise the request raises `RobotoIllegalArgumentException`. See [`CustomFieldChangeset`](/docs/reference/python-sdk/roboto/updates#roboto.updates.CustomFieldChangeset).

- **UpdateEventRequest.description** (`str | None | roboto.sentinels.NotSetType`): Human-readable description of the event. `None` clears it.

- **UpdateEventRequest.display_options_changeset** (`EventDisplayOptionsChangeset | roboto.sentinels.NotSetType`): Changes to the event's display options.

- **UpdateEventRequest.end_time** (`int | roboto.sentinels.NotSetType`): End of the event, in nanoseconds since the Unix epoch.

  An update that would leave the event ending before it starts raises `RobotoIllegalArgumentException`.

- **UpdateEventRequest.metadata_changeset** (`roboto.updates.MetadataChangeset | roboto.sentinels.NotSetType`): Changes to the event's tags and metadata.

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

- **UpdateEventRequest.name** (`str | roboto.sentinels.NotSetType`): Human-readable name of the event, at most 2,600 bytes long in UTF-8 (`MAX_EVENT_NAME_BYTES`).

  Event names are not unique.

- **UpdateEventRequest.start_time** (`int | roboto.sentinels.NotSetType`): Start of the event, in nanoseconds since the Unix epoch.
