---
sidebar:
  hidden: true
title: roboto.domain.files.record
---
## Module Contents

### DirectoryRecord

```python
class roboto.domain.files.record.DirectoryRecord(/, **data: Any)
```

`from roboto.domain.files import DirectoryRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/files/record.py#L256-L316)

Bases: `pydantic.BaseModel`

Data record of a directory, as the Roboto API returns it.

A directory groups files and other directories by path within a dataset's, a device's, or an organization's files. Listing a directory's contents returns directory records alongside `FileRecord` objects; `is_directory` tells them apart.

**Parameters**

- **data** (`Any`)

**Attributes**

- **DirectoryRecord.association_id** (`str`): ID of the dataset, device, device type, or organization whose files include this directory.
- **DirectoryRecord.created** (`datetime.datetime`): Time the directory was created.
- **DirectoryRecord.created_by** (`str`): Principal that created the directory, as `<type>:<id>`, such as `user:<user_id>`.
- **DirectoryRecord.description** (`str | None`) = `None`: Human-readable description of the directory, or `None` if it has none.
- **DirectoryRecord.directory_id** (`str`): Unique ID of the directory.
- **DirectoryRecord.fs_type** (`FSType`): Kind of entry, always `FSType.Directory`.
- **DirectoryRecord.metadata** (`dict[str, Any]`) = `None`: Key-value metadata on the directory.
- **DirectoryRecord.modified** (`datetime.datetime`): Time the directory was last modified.
- **DirectoryRecord.modified_by** (`str`): Principal that last modified the directory, in the same `<type>:<id>` form as `created_by`.
- **DirectoryRecord.name** (`str`): Name of the directory, the final component of `relative_path`. Unique within its parent directory.
- **DirectoryRecord.org_id** (`str`): ID of the organization that owns the directory.
- **DirectoryRecord.origination** (`str`): Free-form description of what created the directory.
- **DirectoryRecord.parent_id** (`str | None`) = `None`: ID of the directory that contains this one, or `None` if this directory is at the root.
- **DirectoryRecord.relative_path** (`str`): Path of the directory from the root of its dataset's, device's, or organization's files.
- **DirectoryRecord.status** (`FileStatus`): Whether the directory is available or deleted.
- **DirectoryRecord.storage_type** (`FileStorageType`): Always `FileStorageType.S3Directory`.
- **DirectoryRecord.tags** (`list[str]`) = `None`: Tags on the directory.
- **DirectoryRecord.upload_id** (`str`): ID of the upload or other operation that created the directory.

### FSType

```python
class roboto.domain.files.record.FSType
```

`from roboto.domain.files import FSType`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/files/record.py#L78-L93)

Bases: `roboto.compat.StrEnum`

Kind of entry in a file tree: a file, a directory, or a link.

**Attributes**

- **FSType.Directory** = `'directory'`: Directory of files and other directories, which stores no object.

- **FSType.File** = `'file'`: File whose content is stored in an object of its own.

- **FSType.Link** = `'link'`: Pointer to one version of another file in the same organization, which can belong to another dataset or device.

  A link sits among a device's, a device type's, or an organization's files, never a dataset's, and stores no object of its own. Its record's `FileRecord.uri` names the target and its version; downloading the link fetches the target at that version.

### FileRecord

```python
class roboto.domain.files.record.FileRecord(/, **data: Any)
```

`from roboto import FileRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/files/record.py#L96-L221)

Bases: `pydantic.BaseModel`

Data record of one version of a file, as the Roboto API returns it.

A file is a data item uploaded or imported to a dataset, or added to a device's, a device type's, or an organization's files. [`File`](/docs/reference/python-sdk/roboto/domain/files/file#roboto.domain.files.file.File) wraps this record with methods that act on the file, and exposes it as [`record`](/docs/reference/python-sdk/roboto/domain/files/file#roboto.domain.files.file.File.record).

**Parameters**

- **data** (`Any`)

**Attributes**

- **FileRecord.association_id** (`str`): ID of the dataset, device, device type, or organization whose files include this file.

- **FileRecord.created** (`datetime.datetime`): Time the file was created.

- **FileRecord.created_by** (`str`) = `''`: Principal that created the file, as `<type>:<id>`, such as `user:<user_id>` or `invocation:iv_12345`.

- **FileRecord.description** (`str | None`) = `None`: Human-readable description of the file, or `None` if it has none.

- **FileRecord.device_id** (`str | None`) = `None`: ID of the device the file's data came from, or `None` if none was given.

- **FileRecord.file_id** (`str`): Unique ID of the file, beginning with `fl_`. Every version of the file has the same ID.

- **FileRecord.fs_type** (`FSType`): Whether this record is a file with content of its own or a link to another file.

- **FileRecord.ingestable** (`bool`) = `False`: Whether the file is meant to be ingested.

  `True` when the file's path matched one of its organization's ingestion rules when this version was created or when the file was last renamed or moved, or when the file has since been partly or fully ingested. A file that is ingestable and whose `ingestion_status` is `IngestionStatus.NotIngested` is awaiting ingestion.

- **FileRecord.ingestion_status** (`IngestionStatus`): How much of the file's data has been ingested into topics.

- **FileRecord.metadata** (`dict[str, Any]`) = `None`: Key-value metadata on the file.

- **FileRecord.modified** (`datetime.datetime`): Time the file was last modified.

- **FileRecord.modified_by** (`str`): Principal that last modified the file, in the same `<type>:<id>` form as `created_by`.

- **FileRecord.name** (`str`): Name of the file, the final component of `relative_path`. Unique within its directory.

- **FileRecord.org_id** (`str`): ID of the organization that owns the file.

- **FileRecord.origination** (`str`) = `''`: Free-form description of what added the file, such as the SDK version or the user that uploaded it.

- **FileRecord.parent_id** (`str | None`) = `None`: ID of the directory that contains the file, or `None` if the file is at the root.

- **FileRecord.relative_path** (`str`): Path of the file from the root of its dataset's, device's, or organization's files, with forward slashes.

  Unique among those files. Downloading the file writes it to this path under the destination directory.

- **FileRecord.size** (`int`): Size of the file's content in bytes. 0 for a link.

- **FileRecord.status** (`FileStatus`): Upload state of the file.

- **FileRecord.storage_type** (`FileStorageType`): Where the object that holds the file's content is stored.

- **FileRecord.tags** (`list[str]`) = `None`: Tags on the file.

- **FileRecord.upload_id** (`str`) = `'NO_ID'`: ID of the upload, import, or other operation that added the file. Files added together share it.

- **FileRecord.uri** (`str`): Location of the object that holds the file's content, such as `s3://<bucket>/<key>`.

  On a link, a `roboto://file/<target_file_id>?v=<version>` reference to the target instead.

- **FileRecord.version** (`int`): Version of the file, starting at 1.

  Each change to the file, such as updating its metadata, renaming it, or uploading new content to its path, adds a version with the next number.

**Properties**

- **FileRecord.bucket** (`str`): Name of the bucket holding this file's object.

  Reading it on a link raises `RobotoIllegalArgumentException`, since a link stores no object.

- **FileRecord.is_link** (`bool`): Whether this record is a link to another file rather than a file with an object of its own.

- **FileRecord.key** (`str`): Key of this file's object within `bucket`.

  Reading it on a link raises `RobotoIllegalArgumentException`, since a link stores no object.

### FileStatus

```python
class roboto.domain.files.record.FileStatus
```

`from roboto import FileStatus`

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

Bases: `roboto.compat.StrEnum`

Upload state of a file or directory.

A file is `Reserved` while its upload is in progress and `Available` once the upload completes.

**Attributes**

- **FileStatus.Available** = `'available'`: Upload is complete: the file appears in listings and search, and can be downloaded and used by actions.
- **FileStatus.Deleted** = `'deleted'`: The file or directory has been deleted and no longer appears in listings.
- **FileStatus.Reserved** = `'reserved'`: Upload has begun but not completed, so the file does not appear in listings yet.

### FileStorageType

```python
class roboto.domain.files.record.FileStorageType
```

`from roboto.domain.files import FileStorageType`

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

Bases: `roboto.compat.StrEnum`

Where the object that holds a file's content is stored.

**Attributes**

- **FileStorageType.S3Directory** = `'directory'`: The record is a directory, which has no object.

- **FileStorageType.S3Imported** = `'imported'`: The object is in a bucket the organization registered with Roboto, and was imported where it is.

  The object stays in the organization's bucket, and Roboto reads it with the access the organization granted. A link also has this storage type, although it stores no object.

- **FileStorageType.S3Uploaded** = `'uploaded'`: The object was uploaded through Roboto, to a Roboto-managed bucket or one the organization registered.

### FileTag

```python
class roboto.domain.files.record.FileTag(*args, **kwds)
```

`from roboto import FileTag`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/files/record.py#L224-L253)

Bases: `enum.Enum`

Keys of the tags on the stored objects that hold files' content.

Roboto uses this enum when it issues credentials for an upload, to limit the tags the upload may set, and when it copies files' objects, to tag the copies. These are tags on the objects in the bucket, separate from a file's `FileRecord.tags`. Roboto assigns their values: the credentials it issues for an upload let the uploader set each tag only to the value Roboto assigned for that upload.

**Attributes**

- **FileTag.AssociationId** = `'association_id'`: ID of the organization, device, or device type whose files include the object's file.

  The objects of a dataset's files carry `DatasetId` instead.

- **FileTag.CommonPrefix** = `'common_prefix'`: Key prefix under which Roboto stores the objects of the file's dataset, device, or organization.

- **FileTag.DatasetId** = `'dataset_id'`: ID of the dataset whose files include the object's file.

  The objects of a dataset's files carry this tag, not `AssociationId`, and an upload to a dataset must set it.

- **FileTag.OrgId** = `'org_id'`: ID of the organization that owns the object's file.

- **FileTag.TransactionId** = `'transaction_id'`: ID of the upload that wrote the object, which is also the file's `upload_id`.

### IngestionStatus

```python
class roboto.domain.files.record.IngestionStatus
```

`from roboto import IngestionStatus`

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

Bases: `roboto.compat.StrEnum`

How much of a file's data Roboto has ingested into topics.

Ingestion extracts a file's data into topics, which makes it available for visualization and search. Roboto ingests many common robotics log formats, such as ROS bags, MCAP and ULog files, and custom ingestion actions can ingest others. A custom ingestion action marks each file it finishes with [`mark_ingested()`](/docs/reference/python-sdk/roboto/domain/files/file#roboto.domain.files.file.File.mark_ingested), which sets `Ingested`.

**Attributes**

- **IngestionStatus.Ingested** = `'ingested'`: The file has been marked fully ingested.

  Triggers that run when a file finishes ingestion act only on files with this status.

- **IngestionStatus.NotIngested** = `'not_ingested'`: No topic has been recorded for the file.

- **IngestionStatus.PartlyIngested** = `'partly_ingested'`: At least one topic has been recorded for the file, but the file has not been marked ingested.

  Roboto sets this status when the first topic is recorded for a `NotIngested` file.

### is_directory()

```python
def roboto.domain.files.record.is_directory(
    record: Union[FileRecord, DirectoryRecord],
) -> TypeGuard[DirectoryRecord]
```

`from roboto.domain.files import is_directory`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/files/record.py#L319-L323)

Return whether `record` is a directory's record.

**Parameters**

- **record** (`Union[FileRecord, DirectoryRecord]`)

**Returns**

- `TypeGuard[DirectoryRecord]`

### is_file()

```python
def roboto.domain.files.record.is_file(
    record: Union[FileRecord, DirectoryRecord],
) -> TypeGuard[FileRecord]
```

`from roboto.domain.files import is_file`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/files/record.py#L326-L331)

Return whether `record` is the record of a file with content of its own.

A link's record is also a `FileRecord`, but this returns `False` for it.

**Parameters**

- **record** (`Union[FileRecord, DirectoryRecord]`)

**Returns**

- `TypeGuard[FileRecord]`
