---
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#L67-L126)

Bases: `pydantic.BaseModel`

Request payload for the Create Event operation.

**Parameters**

- **data** (`Any`)

**Attributes**

- **CreateEventRequest.associations** (`list[roboto.association.Association]`) = `None`: Datasets, files, topics and message paths which this event relates to. At least one must be provided. All referenced datasets, files, topics and message paths must be owned by the same organization.

- **CreateEventRequest.custom_fields** (`dict[str, Any] | None`) = `None`: Initial values for Ready custom fields on this event.

  Each key must be the name of a [`CustomField`](/reference/python-sdk/roboto/domain/custom_fields/custom_field#roboto.domain.custom_fields.custom_field.CustomField) that is [`Ready`](/reference/python-sdk/roboto/domain/custom_fields/record#roboto.domain.custom_fields.record.CustomFieldStatus.Ready) for the caller's org and the [`Event`](/reference/python-sdk/roboto/domain/custom_fields/record#roboto.domain.custom_fields.record.TargetEntityType.Event) entity type; each value must satisfy the field's declared type. Names that are undefined or not `Ready`, and values that don't match the field's type, are rejected with a structured error.

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

- **CreateEventRequest.display_options** (`EventDisplayOptions | None`) = `None`: Display options for this event, such as color.

- **CreateEventRequest.end_time** (`int`): The end time of the event, in nanoseconds since epoch (assumed Unix epoch). This can be equal to start_time if the event is discrete, but can never be less than start_time.

- **CreateEventRequest.metadata** (`dict[str, Any]`) = `None`: Initial key-value pairs to associate with this event for discovery and search.

- **CreateEventRequest.name** (`str`): A brief human-readable name for the event. Many events can have the same name. "Takeoff", "Crash", "CPU Spike", "Bad Image Quality", and "Unexpected Left" are a few potential examples.

- **CreateEventRequest.start_time** (`int`): The start time of the event, in nanoseconds since epoch (assumed Unix epoch).

- **CreateEventRequest.tags** (`list[str]`) = `None`: Initial tags to associate with this event for discovery and search.

### 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#L140-L155)

Bases: `pydantic.BaseModel`

Request payload for the Delete Events (bulk) operation.

Used to delete multiple events in a single request. Event IDs that don't exist are silently ignored so the operation is idempotent; an ID the caller isn't allowed to delete causes the whole request to be rejected.

A single request may contain at most [`MAX_EVENTS_PER_DELETE_BATCH`](/reference/python-sdk/roboto/domain/events/operations#roboto.domain.events.operations.MAX_EVENTS_PER_DELETE_BATCH) event IDs; larger requests are rejected. Use [`roboto.domain.events.Event.delete_many()`](/reference/python-sdk/roboto/domain/events/event#roboto.domain.events.event.Event.delete_many), which chunks input into batches of this size for you.

**Parameters**

- **data** (`Any`)

**Attributes**

- **DeleteEventsRequest.event_ids** (`list[str]`): IDs of the events to delete. At most [`MAX_EVENTS_PER_DELETE_BATCH`](/reference/python-sdk/roboto/domain/events/operations#roboto.domain.events.operations.MAX_EVENTS_PER_DELETE_BATCH) per request.

### 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#L21-L38)

Bases: `pydantic.BaseModel`

Display options for an event.

**Parameters**

- **data** (`Any`)

**Attributes**

- **EventDisplayOptions.color** (`str | None`) = `None`: Display color for the event.

  Used to visually distinguish events on a timeline, and optionally to signal semantic information about the event (e.g. "red" for events representing critical issues).

  Any value that is permissible in CSS to define a valid color can be used here, encoded as a string. For instance, the following are all valid: "red", "#ff0000", "rgb(255 0 0)".

#### 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#L35-L38)

Checks whether any display options have been specified.

**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#L41-L64)

Bases: `pydantic.BaseModel`

A set of changes to the display options of an event.

**Parameters**

- **data** (`Any`)

**Attributes**

- **EventDisplayOptionsChangeset.color** (`str | None | roboto.sentinels.NotSetType`): An update to an event's color.

  Use `None` to clear any previously set color value. On the Roboto website, the event will be displayed using an automatically selected color.

- **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#L54-L59)

Applies this changeset to some existing display options.

**Parameters**

- **display_options** (`EventDisplayOptions`)

**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#L61-L64)

Checks whether this changeset contains any changes.

**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#L129-L129)

Maximum number of event IDs the bulk Delete Events API accepts in a single request.

The cap keeps a single delete bounded to one reasonably sized DELETE statement and transaction, so an oversized request can't make the service or database go nuts. A request that exceeds it is rejected server-side with a 400. [`roboto.domain.events.Event.delete_many()`](/reference/python-sdk/roboto/domain/events/event#roboto.domain.events.event.Event.delete_many) splits larger inputs into chunks of this size automatically, so SDK callers don't need to batch by hand.

### 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#L158-L167)

Bases: `pydantic.BaseModel`

Request payload for the Query Events for Associations operation.

**Parameters**

- **data** (`Any`)

**Attributes**

- **QueryEventsForAssociationsRequest.associations** (`list[roboto.association.Association]`): Associations to query events for.
- **QueryEventsForAssociationsRequest.page_token** (`str | None`) = `None`: Token to use to fetch the next page of results, use None for 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-L220)

Bases: `pydantic.BaseModel`

Request payload for the Update Event operation. Allows any of the mutable fields of an event to be changed.

**Parameters**

- **data** (`Any`)

**Attributes**

- **UpdateEventRequest.custom_fields_changeset** (`roboto.updates.CustomFieldChangeset | None`) = `None`: Changes to apply to Ready custom-field values on this event.

  Each referenced field name must be a [`Ready`](/reference/python-sdk/roboto/domain/custom_fields/record#roboto.domain.custom_fields.record.CustomFieldStatus.Ready) custom field for this event's org and the [`Event`](/reference/python-sdk/roboto/domain/custom_fields/record#roboto.domain.custom_fields.record.TargetEntityType.Event) entity type; each `set_fields` value must satisfy the field's declared type. Names that are undefined or not `Ready` are rejected with a structured error. Field names not mentioned by the changeset are left unchanged.

- **UpdateEventRequest.description** (`str | None | roboto.sentinels.NotSetType`): An optional human-readable description of the event.

- **UpdateEventRequest.display_options_changeset** (`EventDisplayOptionsChangeset | roboto.sentinels.NotSetType`): Display options changes to apply to this event.

- **UpdateEventRequest.end_time** (`int | roboto.sentinels.NotSetType`): The end time of the event, in nanoseconds since epoch (assumed Unix epoch). This can be equal to start_time if the event is discrete, but can never be less than start_time.

- **UpdateEventRequest.metadata_changeset** (`roboto.updates.MetadataChangeset | roboto.sentinels.NotSetType`): Metadata and tag changes to make for this event

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

- **UpdateEventRequest.name** (`str | roboto.sentinels.NotSetType`): A brief human-readable name for the event. Many events can have the same name. "Takeoff", "Crash", "CPU Spike", "Bad Image Quality", and "Unexpected Left" are a few potential examples.

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