---
sidebar:
  hidden: true
title: roboto.experimental.ingestion_rules.record
---
## Module Contents

### DefaultIngestionRuleRecord

```python
class roboto.experimental.ingestion_rules.record.DefaultIngestionRuleRecord(
    /,
    **data: Any,
)
```

`from roboto.experimental.ingestion_rules import DefaultIngestionRuleRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/experimental/ingestion_rules/record.py#L47-L58)

Bases: `pydantic.BaseModel`

Wire format of one of the rules every new org starts with, and whether the caller's org already has it.

`POST /v1/ingestion-rules/defaults` creates the ones not [`already_present`](/reference/python-sdk/roboto/experimental/ingestion_rules/record#roboto.experimental.ingestion_rules.record.DefaultIngestionRuleRecord.already_present).

**Parameters**

- **data** (`Any`)

**Attributes**

- **DefaultIngestionRuleRecord.already_present** (`bool`): Whether the org has a rule with this name, or a rule with one of these include patterns.
- **DefaultIngestionRuleRecord.exclude_patterns** (`list[str]`) = `None`
- **DefaultIngestionRuleRecord.include_patterns** (`list[str]`)
- **DefaultIngestionRuleRecord.invocation** (`roboto.domain.triggers.ActionInvocationSpec`)
- **DefaultIngestionRuleRecord.name** (`str`)

### ExistingFilesPreview

```python
class roboto.experimental.ingestion_rules.record.ExistingFilesPreview(/, **data: Any)
```

`from roboto.experimental.ingestion_rules import ExistingFilesPreview`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/experimental/ingestion_rules/record.py#L93-L108)

Bases: `pydantic.BaseModel`

Files already uploaded that a rule matches, that are not ingested, and whose current upload no rule's trigger has run on: ones uploaded, or uploaded again, before the rule existed or while its auto-ingest was off. Editing a file's metadata or tags does not make it one of these.

Response of `GET /v1/ingestion-rules/<rule_id>/existing-files`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **ExistingFilesPreview.complete_session_count** (`int`) = `0`: Complete sessions holding any of these files. After a session's files are ingested, it is announced as fully ingested again, and the triggers on `session.ingested` start for it.
- **ExistingFilesPreview.count** (`int`)
- **ExistingFilesPreview.count_is_lower_bound** (`bool`) = `False`: Whether there may be more than [`count`](/reference/python-sdk/roboto/experimental/ingestion_rules/record#roboto.experimental.ingestion_rules.record.ExistingFilesPreview.count); counting stops after a fixed number of files.
- **ExistingFilesPreview.sample_paths** (`list[str]`) = `None`: Up to 10 of the files' paths. Empty for a caller who is not an org admin.

### IngestFileOutcome

```python
class roboto.experimental.ingestion_rules.record.IngestFileOutcome
```

`from roboto.experimental.ingestion_rules import IngestFileOutcome`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/experimental/ingestion_rules/record.py#L61-L81)

Bases: `roboto.compat.StrEnum`

What `POST /v1/ingestion-rules/ingest` did with one file.

**Attributes**

- **IngestFileOutcome.AlreadyRunning** = `'already_running'`: An ingestion run on the file is still queued or running, so no new one was started.
- **IngestFileOutcome.AutoIngestOff** = `'auto_ingest_off'`: Rules match the file, but none of them auto-ingests.
- **IngestFileOutcome.NoMatchingRule** = `'no_matching_rule'`: No rule in the file's org matches its path.
- **IngestFileOutcome.NotFound** = `'not_found'`: No such file in the caller's org, the caller may not edit it, or it is not in a dataset (rules apply only to dataset files).
- **IngestFileOutcome.NotStarted** = `'not_started'`: A matching rule's trigger declined the file (it is disabled, say).
- **IngestFileOutcome.Started** = `'started'`: A matching rule's trigger started ingesting the file.

### IngestFileResult

```python
class roboto.experimental.ingestion_rules.record.IngestFileResult(/, **data: Any)
```

`from roboto.experimental.ingestion_rules import IngestFileResult`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/experimental/ingestion_rules/record.py#L84-L90)

Bases: `pydantic.BaseModel`

**!!! abstract "Usage Documentation"**

\[Models\](../concepts/models.md)

A base class for creating Pydantic models.

**Parameters**

- **data** (`Any`)

**Attributes**

- **`IngestFileResult.__class_vars__`**: The names of the class variables defined on the model.
- **`IngestFileResult.__private_attributes__`**: Metadata about the private attributes of the model.
- **`IngestFileResult.__signature__`**: The synthesized \_\_init\_\_ [Signature][inspect.Signature] of the model.
- **`IngestFileResult.__pydantic_complete__`**: Whether model building is completed, or if there are still undefined fields.
- **`IngestFileResult.__pydantic_core_schema__`**: The core schema of the model.
- **`IngestFileResult.__pydantic_custom_init__`**: Whether the model has a custom \_\_init\_\_ function.
- **`IngestFileResult.__pydantic_decorators__`**: Metadata containing the decorators defined on the model. This replaces Model.\_\_validators\_\_ and Model.\_\_root_validators\_\_ from Pydantic V1.
- **`IngestFileResult.__pydantic_generic_metadata__`**: A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [\_\_origin\_\_][genericalias.\_\_origin\_\_] and [\_\_args\_\_][genericalias.\_\_args\_\_] attributes of [generic aliases][types-genericalias], and the parameter item maps to the \_\_parameter\_\_ attribute of generic classes.
- **`IngestFileResult.__pydantic_parent_namespace__`**: Parent namespace of the model, used for automatic rebuilding of models.
- **`IngestFileResult.__pydantic_post_init__`**: The name of the post-init method for the model, if defined.
- **`IngestFileResult.__pydantic_root_model__`**: Whether the model is a [RootModel][pydantic.root_model.RootModel].
- **`IngestFileResult.__pydantic_serializer__`**: The pydantic-core SchemaSerializer used to dump instances of the model.
- **`IngestFileResult.__pydantic_validator__`**: The pydantic-core SchemaValidator used to validate instances of the model.
- **`IngestFileResult.__pydantic_fields__`**: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
- **`IngestFileResult.__pydantic_computed_fields__`**: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
- **`IngestFileResult.__pydantic_extra__`**: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
- **`IngestFileResult.__pydantic_fields_set__`**: The names of fields explicitly set during instantiation.
- **`IngestFileResult.__pydantic_private__`**: Values of private attributes set on the model instance.
- **IngestFileResult.file_id** (`str`)
- **IngestFileResult.invocation_id** (`str | None`) = `None`: The invocation started, when [`outcome`](/reference/python-sdk/roboto/experimental/ingestion_rules/record#roboto.experimental.ingestion_rules.record.IngestFileResult.outcome) is `started`.
- **IngestFileResult.outcome** (`IngestFileOutcome`)
- **IngestFileResult.rule_id** (`str | None`) = `None`: The rule whose trigger ran, or would have.

### IngestionRuleRecord

```python
class roboto.experimental.ingestion_rules.record.IngestionRuleRecord(/, **data: Any)
```

`from roboto.experimental.ingestion_rules import IngestionRuleRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/experimental/ingestion_rules/record.py#L16-L44)

Bases: `pydantic.BaseModel`

Wire format of an ingestion rule: which file paths in an org are ingestable, and how they are ingested.

A file whose path matches any of [`include_patterns`](/reference/python-sdk/roboto/experimental/ingestion_rules/record#roboto.experimental.ingestion_rules.record.IngestionRuleRecord.include_patterns) and none of [`exclude_patterns`](/reference/python-sdk/roboto/experimental/ingestion_rules/record#roboto.experimental.ingestion_rules.record.IngestionRuleRecord.exclude_patterns) is marked ingestable when it is created. The rule owns one trigger ([`trigger_id`](/reference/python-sdk/roboto/experimental/ingestion_rules/record#roboto.experimental.ingestion_rules.record.IngestionRuleRecord.trigger_id)) that runs [`invocation`](/reference/python-sdk/roboto/experimental/ingestion_rules/record#roboto.experimental.ingestion_rules.record.IngestionRuleRecord.invocation) on each matching upload while [`auto_ingest`](/reference/python-sdk/roboto/experimental/ingestion_rules/record#roboto.experimental.ingestion_rules.record.IngestionRuleRecord.auto_ingest) is on.

**Parameters**

- **data** (`Any`)

**Attributes**

- **IngestionRuleRecord.auto_ingest** (`bool`): Whether matching uploads are ingested automatically: whether the rule's trigger is enabled. Turning this off disables the trigger and leaves matching files ingestable.
- **IngestionRuleRecord.created** (`datetime.datetime`)
- **IngestionRuleRecord.created_by** (`str`)
- **IngestionRuleRecord.description** (`str | None`) = `None`
- **IngestionRuleRecord.exclude_patterns** (`list[str]`) = `None`: Git wildmatch patterns. A file matching any of them is not ingestable by this rule.
- **IngestionRuleRecord.include_patterns** (`list[str]`): Git wildmatch patterns, e.g. `**/*.mcap`. A file matching any of them is ingestable.
- **IngestionRuleRecord.invocation** (`roboto.domain.triggers.ActionInvocationSpec | None`) = `None`: How each matching upload is ingested. The trigger passes the uploaded file as the first input, followed by whatever `invocation.invocation_input` selects. `None` only on a rule that does not auto-ingest.
- **IngestionRuleRecord.modified** (`datetime.datetime`)
- **IngestionRuleRecord.modified_by** (`str`)
- **IngestionRuleRecord.name** (`str`)
- **IngestionRuleRecord.org_id** (`str`)
- **IngestionRuleRecord.rule_id** (`str`)
- **IngestionRuleRecord.trigger_id** (`str | None`) = `None`: The trigger that runs [`invocation`](/reference/python-sdk/roboto/experimental/ingestion_rules/record#roboto.experimental.ingestion_rules.record.IngestionRuleRecord.invocation) on matching uploads, enabled while [`auto_ingest`](/reference/python-sdk/roboto/experimental/ingestion_rules/record#roboto.experimental.ingestion_rules.record.IngestionRuleRecord.auto_ingest) is on. Only the rule can enable, disable, edit or delete it. `None` while the rule has no invocation.
