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

### SAMPLE_ACTION_DIGEST

```python
roboto.domain.platform_events.samples.SAMPLE_ACTION_DIGEST = 'sha256:9f1c2e7b4a0d8c6f3e5b1a7d2c4f8e6a0b3d5c7e9f1a2b4c6d8e0f2a4b6c8d0e'
```

`from roboto.domain.platform_events import SAMPLE_ACTION_DIGEST`

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

Digest of the version of the action the sample invocation runs.

### SAMPLE_ACTION_NAME

```python
roboto.domain.platform_events.samples.SAMPLE_ACTION_NAME = 'ros-ingest'
```

`from roboto.domain.platform_events import SAMPLE_ACTION_NAME`

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

Name of the action the sample invocation runs.

### SAMPLE_API_DOMAIN

```python
roboto.domain.platform_events.samples.SAMPLE_API_DOMAIN = 'api.roboto.ai'
```

`from roboto.domain.platform_events import SAMPLE_API_DOMAIN`

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

API domain in the `source` of every sample event.

### SAMPLE_CHANGESET

```python
roboto.domain.platform_events.samples.SAMPLE_CHANGESET
```

`from roboto.domain.platform_events import SAMPLE_CHANGESET`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/platform_events/samples.py#L69-L73)

Change in the sample `FileMetadataUpdated` and `DatasetMetadataUpdated` events.

It sets two metadata keys, adds the tags in `SAMPLE_TAGS_ADDED`, and removes the tag `needs-review`.

### SAMPLE_DATASET_ID

```python
roboto.domain.platform_events.samples.SAMPLE_DATASET_ID = 'ds_7h2k9m4qxp3w'
```

`from roboto.domain.platform_events import SAMPLE_DATASET_ID`

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

ID of the dataset the sample events name.

### SAMPLE_EVENT_ID

```python
roboto.domain.platform_events.samples.SAMPLE_EVENT_ID = 'ev_7g3n5kq2wxrd'
```

`from roboto.domain.platform_events import SAMPLE_EVENT_ID`

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

ID of the event created in the sample `EventCreated` event.

### SAMPLE_FILE_ID

```python
roboto.domain.platform_events.samples.SAMPLE_FILE_ID = 'fl_q8v2n6ty4mcs'
```

`from roboto.domain.platform_events import SAMPLE_FILE_ID`

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

ID of the file the sample events name.

### SAMPLE_FILE_VERSION

```python
roboto.domain.platform_events.samples.SAMPLE_FILE_VERSION = 2
```

`from roboto.domain.platform_events import SAMPLE_FILE_VERSION`

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

Version of the sample file that the sample file events name.

### SAMPLE_INVOCATION_ID

```python
roboto.domain.platform_events.samples.SAMPLE_INVOCATION_ID = 'iv_2x9pd7wk5rhf'
```

`from roboto.domain.platform_events import SAMPLE_INVOCATION_ID`

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

ID of the invocation in the sample `InvocationCompleted` and `InvocationFailed` events.

### SAMPLE_ORG_ID

```python
roboto.domain.platform_events.samples.SAMPLE_ORG_ID = 'og_k3m8w2rq7nxd'
```

`from roboto.domain.platform_events import SAMPLE_ORG_ID`

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

ID of the organization every sample event and sample record belongs to.

### SAMPLE_SESSION_EVENT_ID

```python
roboto.domain.platform_events.samples.SAMPLE_SESSION_EVENT_ID = 'evt_4p8m2xk7qw9tdr3n'
```

`from roboto.domain.platform_events import SAMPLE_SESSION_EVENT_ID`

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

ID of the event created on a session in the sample `SessionEventCreated` event, beginning with `evt_`.

### SAMPLE_SESSION_ID

```python
roboto.domain.platform_events.samples.SAMPLE_SESSION_ID = 'se_m4t7c1zq9bvn'
```

`from roboto.domain.platform_events import SAMPLE_SESSION_ID`

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

ID of the session in the sample `SessionIngested` and `SessionEventCreated` events.

### SAMPLE_TAGS_ADDED

```python
roboto.domain.platform_events.samples.SAMPLE_TAGS_ADDED = ['validated', 'nightly']
```

`from roboto.domain.platform_events import SAMPLE_TAGS_ADDED`

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

Tags added to the dataset in the sample `DatasetTagAdded` event.

`SAMPLE_CHANGESET` puts the same tags.

### SAMPLE_TIME

```python
roboto.domain.platform_events.samples.SAMPLE_TIME
```

`from roboto.domain.platform_events import SAMPLE_TIME`

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

Time every sample event and sample record is dated from, fixed so that samples are the same on every call.

### SAMPLE_TRANSACTION_ID

```python
roboto.domain.platform_events.samples.SAMPLE_TRANSACTION_ID = 'tx_5jw8r3ne2kpq'
```

`from roboto.domain.platform_events import SAMPLE_TRANSACTION_ID`

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

ID of the upload transaction the sample file arrived in.

### SAMPLE_TRIGGER_ID

```python
roboto.domain.platform_events.samples.SAMPLE_TRIGGER_ID = 'tr_3nq7wk2mx9pd'
```

`from roboto.domain.platform_events import SAMPLE_TRIGGER_ID`

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

ID of the sample trigger, and of the trigger whose schedule fires in the sample `ScheduleFired` event.

### SAMPLE_USER

```python
roboto.domain.platform_events.samples.SAMPLE_USER = 'maria.chen@acme-robotics.com'
```

`from roboto.domain.platform_events import SAMPLE_USER`

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

User in the `created_by` and `modified_by` fields of the sample records.

### sample_platform_event()

```python
def roboto.domain.platform_events.samples.sample_platform_event(
    event_type: roboto.domain.platform_events.events.PlatformEventType,
) -> roboto.domain.platform_events.events.PlatformEvent
```

`from roboto.domain.platform_events import sample_platform_event`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/platform_events/samples.py#L126-L166)

Build a sample platform event of `event_type`, with every optional payload field set.

Every sample takes its IDs and time from the `SAMPLE_*` constants in this module, so samples of different types describe one scenario: one organization, dataset, file, session, and action invocation. The values are made up and name nothing that exists in Roboto. [`platform_event_sample()`](/docs/reference/python-sdk/roboto/domain/triggers/samples#roboto.domain.triggers.samples.platform_event_sample) builds on these samples to show what a trigger's conditions and templates can read.

**Parameters**

- **event_type** (`roboto.domain.platform_events.events.PlatformEventType`): Type of the platform event to return.

**Raises**

- `ValueError`: This version of the SDK has no sample payload for `event_type`.

**Returns**

- `roboto.domain.platform_events.events.PlatformEvent`

**Usage**

```python
from roboto.domain.platform_events import PlatformEventType, sample_platform_event
event = sample_platform_event(PlatformEventType.FileUploaded)
event.id
# 'evt:fl_q8v2n6ty4mcs:file.uploaded'
```
