---
sidebar:
  hidden: true
title: roboto.domain.platform_events.once_per
---
## Module Contents

### OncePer

```python
class roboto.domain.platform_events.once_per.OncePer
```

`from roboto.domain.platform_events import OncePer`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/platform_events/once_per.py#L10-L56)

Bases: `roboto.compat.StrEnum`

Value of a trigger's `once_per`: what it runs each target at most once for.

Either each platform event, or a resource the platform event names. With `once_per` set to `File`, for example, a trigger on the [`PlatformEventType`](/docs/reference/python-sdk/roboto/domain/platform_events/events#roboto.domain.platform_events.events.PlatformEventType) member `FileMetadataUpdated` runs its targets for the first metadata change to a file and not for later changes to that file. The limit applies to each event type separately, so a trigger on both `FileUploaded` and `FileIngested` with `once_per` set to `File` can run twice per file, once for each event type.

Each event type supports `Occurrence` and some of the resources its payload names; [`supported_once_per`](/docs/reference/python-sdk/roboto/domain/platform_events/catalog#roboto.domain.platform_events.catalog.PlatformEventDescriptor.supported_once_per) lists which. Roboto rejects a trigger whose `once_per` one of its subscribed event types does not support.

**Attributes**

- **OncePer.Dataset** = `'dataset'`: Datasets ([`Dataset`](/docs/reference/python-sdk/roboto/domain/datasets/dataset#roboto.domain.datasets.dataset.Dataset)) the platform event names.

  The dataset the platform event is about, or the dataset of the file it is about. Supported by every event type about a file or a dataset except [`DatasetTagAdded`](/docs/reference/python-sdk/roboto/domain/platform_events/events#roboto.domain.platform_events.events.PlatformEventType.DatasetTagAdded).

- **OncePer.Event** = `'event'`: Events ([`Event`](/docs/reference/python-sdk/roboto/domain/events/event#roboto.domain.events.event.Event)), annotations over a span of time, that the platform event names.

  Supported by [`EventCreated`](/docs/reference/python-sdk/roboto/domain/platform_events/events#roboto.domain.platform_events.events.PlatformEventType.EventCreated) and [`SessionEventCreated`](/docs/reference/python-sdk/roboto/domain/platform_events/events#roboto.domain.platform_events.events.PlatformEventType.SessionEventCreated).

- **OncePer.File** = `'file'`: Files ([`File`](/docs/reference/python-sdk/roboto/domain/files/file#roboto.domain.files.file.File)) the platform event names.

  Supported by the [`PlatformEventType`](/docs/reference/python-sdk/roboto/domain/platform_events/events#roboto.domain.platform_events.events.PlatformEventType) members `FileUploaded`, `FileIngested` and `FileMetadataUpdated`.

- **OncePer.Invocation** = `'invocation'`: Action invocations ([`Invocation`](/docs/reference/python-sdk/roboto/domain/actions/invocation#roboto.domain.actions.invocation.Invocation)) the platform event names.

  Supported by [`InvocationCompleted`](/docs/reference/python-sdk/roboto/domain/platform_events/events#roboto.domain.platform_events.events.PlatformEventType.InvocationCompleted) and [`InvocationFailed`](/docs/reference/python-sdk/roboto/domain/platform_events/events#roboto.domain.platform_events.events.PlatformEventType.InvocationFailed).

- **OncePer.Occurrence** = `'occurrence'`: Each platform event, so the trigger runs for every one and once for a platform event delivered twice.

  Every event type supports it.
