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

### CreateDirectoryRequest

```python
class roboto.domain.files.operations.CreateDirectoryRequest(/, **data: Any)
```

`from roboto.domain.datasets import CreateDirectoryRequest`

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

Bases: `pydantic.BaseModel`

Request body for [`create_directory()`](/docs/reference/python-sdk/roboto/domain/files/file_system#roboto.domain.files.file_system.FileSystem.create_directory).

**Parameters**

- **data** (`Any`)

**Attributes**

- **CreateDirectoryRequest.create_intermediate_dirs** (`bool`) = `False`: Whether to create the directories along `parent_path` that do not exist.

  When `False`, a missing parent directory fails the request with `RobotoInvalidRequestException`.

- **CreateDirectoryRequest.error_if_exists** (`bool`) = `False`: Whether to fail with `RobotoConflictException` when the directory already exists.

  When `False`, the response is the existing directory.

- **CreateDirectoryRequest.name** (`str`): Name of the directory to create.

- **CreateDirectoryRequest.origination** (`str | None`) = `None`: What created the directory, such as `roboto 0.30.0`. `None` records the caller's user ID.

- **CreateDirectoryRequest.parent_path** (`str | None`) = `None`: Path of the parent directory, relative to the root of the association's files.

  `None` creates the directory at the root.

### CreateLinkRequest

```python
class roboto.domain.files.operations.CreateLinkRequest(/, **data: Any)
```

`from roboto.domain.files import CreateLinkRequest`

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

Bases: `pydantic.BaseModel`

Request body for [`create_link()`](/docs/reference/python-sdk/roboto/domain/files/file_system#roboto.domain.files.file_system.FileSystem.create_link).

**Parameters**

- **data** (`Any`)

**Attributes**

- **CreateLinkRequest.relative_path** (`str`): Path of the link, relative to the root of the association's files. Missing parent directories are created.
- **CreateLinkRequest.target_file_id** (`str`): ID of the file the link points at: a file, not a link or a directory, in the association's organization.
- **CreateLinkRequest.target_version** (`int | None`) = `None`: Version of the target file the link pins. `None` pins the target's current version.

### DeleteDirectoriesRequest

```python
class roboto.domain.files.operations.DeleteDirectoriesRequest(/, **data: Any)
```

`from roboto.domain.datasets import DeleteDirectoriesRequest`

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

Bases: `pydantic.BaseModel`

Request body for [`delete_directories()`](/docs/reference/python-sdk/roboto/domain/files/file_system#roboto.domain.files.file_system.FileSystem.delete_directories).

**Parameters**

- **data** (`Any`)

**Attributes**

- **DeleteDirectoriesRequest.directory_paths** (`list[str]`): Paths of the directories to delete, relative to the root of the association's files.

### DeleteFileRequest

```python
class roboto.domain.files.operations.DeleteFileRequest(/, **data: Any)
```

`from roboto import DeleteFileRequest`

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

Bases: `pydantic.BaseModel`

Request body naming a file to delete by its storage URI.

No SDK method or Roboto route uses this model. To delete a file, call [`delete()`](/docs/reference/python-sdk/roboto/domain/files/file#roboto.domain.files.file.File.delete).

**Parameters**

- **data** (`Any`)

**Attributes**

- **DeleteFileRequest.uri** (`str`): Storage URI of the file to delete, such as `s3://bucket/path/to/file.bag`.

### DirectoryContentsPage

```python
class roboto.domain.files.operations.DirectoryContentsPage(/, **data: Any)
```

`from roboto.domain.files import DirectoryContentsPage`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/files/operations.py#L201-L215)

Bases: `pydantic.BaseModel`

Response body of `GET /v1/datasets/{dataset_id}/files/directory-contents`.

`GET /v1/files/association/id/{association_id}/directory-contents` returns it too. Each page holds files and directories directly inside one directory of an association's files.

**Parameters**

- **data** (`Any`)

**Attributes**

- **DirectoryContentsPage.directories** (`collections.abc.Sequence[roboto.domain.files.record.DirectoryRecord]`): Directories on this page.
- **DirectoryContentsPage.files** (`collections.abc.Sequence[roboto.domain.files.record.FileRecord]`): Files on this page.
- **DirectoryContentsPage.next_token** (`str | None`) = `None`: Token to pass as the `after` query parameter to fetch the next page, or `None` if this is the last page.

### FileRecordRequest

```python
class roboto.domain.files.operations.FileRecordRequest(/, **data: Any)
```

`from roboto import FileRecordRequest`

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

Bases: `pydantic.BaseModel`

Request body holding a file's ID, tags, and metadata.

No SDK method or Roboto route uses this model. To change a file's tags or metadata, call [`update()`](/docs/reference/python-sdk/roboto/domain/files/file#roboto.domain.files.file.File.update).

**Parameters**

- **data** (`Any`)

**Attributes**

- **FileRecordRequest.file_id** (`str`): ID of the file.
- **FileRecordRequest.metadata** (`dict[str, Any]`) = `None`: Key-value metadata to set on the file.
- **FileRecordRequest.tags** (`list[str]`) = `None`: Tags to set on the file.

### ImportFileRequest

```python
class roboto.domain.files.operations.ImportFileRequest(/, **data: Any)
```

`from roboto import ImportFileRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/files/operations.py#L95-L131)

Bases: `pydantic.BaseModel`

Request body for importing a file that is already in a bring-your-own bucket into a dataset.

Sent by [`import_one()`](/docs/reference/python-sdk/roboto/domain/files/file#roboto.domain.files.file.File.import_one), and by [`import_batch()`](/docs/reference/python-sdk/roboto/domain/files/file#roboto.domain.files.file.File.import_batch) once per file. The file's contents stay in that bucket; Roboto stores only the file's record.

**Parameters**

- **data** (`Any`)

**Attributes**

- **ImportFileRequest.dataset_id** (`str`): ID of the dataset to import the file into.

- **ImportFileRequest.description** (`str | None`) = `None`: Human-readable description of the file.

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

- **ImportFileRequest.metadata** (`dict[str, Any] | None`) = `None`: Key-value metadata to set on the file. `None` sets none.

- **ImportFileRequest.relative_path** (`str`): Path of the file within the dataset, such as `logs/session1.bag`.

- **ImportFileRequest.size** (`int | None`) = `None`: Size of the file in bytes.

  Required by [`import_batch()`](/docs/reference/python-sdk/roboto/domain/files/file#roboto.domain.files.file.File.import_batch), which fails with `RobotoInvalidRequestException` when it is `None`. [`import_one()`](/docs/reference/python-sdk/roboto/domain/files/file#roboto.domain.files.file.File.import_one) ignores it and reads the size from the bucket.

- **ImportFileRequest.tags** (`list[str] | None`) = `None`: Tags to set on the file. `None` sets none.

- **ImportFileRequest.uri** (`str`): Storage URI of the file, such as `s3://bucket/path/to/file.bag`.

  The bucket must be registered as a bring-your-own bucket of the caller's organization.

### QueryDatasetFilesRequest

```python
class roboto.domain.files.operations.QueryDatasetFilesRequest(/, **data: Any)
```

`from roboto import QueryDatasetFilesRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/files/operations.py#L218-L251)

Bases: `pydantic.BaseModel`

Request body for [`list_files()`](/docs/reference/python-sdk/roboto/domain/files/file_system#roboto.domain.files.file_system.FileSystem.list_files).

The same body lists the files of a dataset, a device, a device type, or an organization, despite its name.

**Parameters**

- **data** (`Any`)

**Attributes**

- **QueryDatasetFilesRequest.exclude_patterns** (`list[str] | None`) = `None`: Gitignore-style patterns for the files to leave out. `None` or an empty list leaves out none.

- **QueryDatasetFilesRequest.include_inherited** (`bool`) = `False`: Whether listing a device's configurations also lists those of its device type.

  Setting it for any other association fails the request with `RobotoInvalidRequestException`. Where the device and its type both have a file at the same path, only the device's is listed. Each listed file's `association_id` says whether it came from the device or from its type.

- **QueryDatasetFilesRequest.include_patterns** (`list[str] | None`) = `None`: Gitignore-style patterns for the files to list, matched against each file's path.

  `None` or an empty list lists every file.

- **QueryDatasetFilesRequest.limit** (`int | None`) = `None`: Maximum number of files per page. `None` returns up to 1000.

- **QueryDatasetFilesRequest.page_token** (`str | None`) = `None`: Token from a previous page's response that resumes the listing after it. `None` starts at the first page.

- **QueryDatasetFilesRequest.sort_by** (`str | None`) = `None`: Field of the file record to sort by. `None` sorts by `created`.

- **QueryDatasetFilesRequest.sort_direction** (`str | None`) = `None`: Sort direction, `"ASC"` or `"DESC"`. `None` sorts in descending order.

### QueryFilesRequest

```python
class roboto.domain.files.operations.QueryFilesRequest(/, **data: Any)
```

`from roboto import QueryFilesRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/files/operations.py#L134-L144)

Bases: `pydantic.BaseModel`

Request body holding filter criteria for files.

No SDK method or Roboto route uses this model. To search files, pass a [`QuerySpecification`](/docs/reference/python-sdk/roboto/query/specification#roboto.query.specification.QuerySpecification) to [`query()`](/docs/reference/python-sdk/roboto/domain/files/file#roboto.domain.files.file.File.query).

**Parameters**

- **data** (`Any`)

**Attributes**

- **QueryFilesRequest.filters** (`dict[str, Any]`) = `None`: Filter criteria for files.
- **QueryFilesRequest.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

### RenameDirectoryRequest

```python
class roboto.domain.files.operations.RenameDirectoryRequest(/, **data: Any)
```

`from roboto.domain.datasets import RenameDirectoryRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/files/operations.py#L254-L264)

Bases: `pydantic.BaseModel`

Request body for [`rename_directory()`](/docs/reference/python-sdk/roboto/domain/files/file_system#roboto.domain.files.file_system.FileSystem.rename_directory).

The directory's files and subdirectories move with it.

**Parameters**

- **data** (`Any`)

**Attributes**

- **RenameDirectoryRequest.new_path** (`str`): Path to move the directory to, relative to the root of the association's files.
- **RenameDirectoryRequest.old_path** (`str`): Current path of the directory, relative to the root of the association's files.

### RenameFileRequest

```python
class roboto.domain.files.operations.RenameFileRequest(/, **data: Any)
```

`from roboto.domain.files import RenameFileRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/files/operations.py#L147-L162)

Bases: `pydantic.BaseModel`

Request body for renaming or moving a file among its association's files.

Sent by [`rename_file()`](/docs/reference/python-sdk/roboto/domain/files/file#roboto.domain.files.file.File.rename_file) and [`rename_file()`](/docs/reference/python-sdk/roboto/domain/files/file_system#roboto.domain.files.file_system.FileSystem.rename_file). The file keeps its ID; only its path changes.

**Parameters**

- **data** (`Any`)

**Attributes**

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

  Must be the file's own association. Naming another fails the request with `RobotoInvalidRequestException`, so a rename cannot move a file between associations.

- **RenameFileRequest.new_path** (`str`): Path to move the file to, relative to the root of its association's files.

### SignedUrlResponse

```python
class roboto.domain.files.operations.SignedUrlResponse(/, **data: Any)
```

`from roboto.domain.files import SignedUrlResponse`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/files/operations.py#L165-L176)

Bases: `pydantic.BaseModel`

Response body of [`get_signed_url()`](/docs/reference/python-sdk/roboto/domain/files/file#roboto.domain.files.file.File.get_signed_url), which returns its `url`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **SignedUrlResponse.etag** (`str | None`) = `None`: ETag of the stored object that the URL reads, as storage reported it when Roboto signed the URL.

  Compare it with the `ETag` header of each range that you download through the URL: a different value means that the file was replaced after the URL was signed. `None` when Roboto reports no ETag for the object.

- **SignedUrlResponse.url** (`str`): Signed URL that downloads the file's contents without Roboto credentials, for one hour after it is issued.

### UpdateFileRecordRequest

```python
class roboto.domain.files.operations.UpdateFileRecordRequest(/, **data: Any)
```

`from roboto import UpdateFileRecordRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/files/operations.py#L179-L198)

Bases: `pydantic.BaseModel`

Request body for [`update()`](/docs/reference/python-sdk/roboto/domain/files/file#roboto.domain.files.file.File.update).

Each field left unset (`NotSet`) leaves that property of the file unchanged. Building it with `ingestion_complete=False` raises `pydantic.ValidationError`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **UpdateFileRecordRequest.description** (`str | roboto.sentinels.NotSetType | None`): Human-readable description of the file. `None` clears it.
- **UpdateFileRecordRequest.device_id** (`str | roboto.sentinels.NotSetType | None`): ID of the device the file's data came from. `None` clears it.
- **UpdateFileRecordRequest.ingestion_complete** (`Literal[True] | roboto.sentinels.NotSetType`): Whether to mark the file as fully ingested. Only `True` is accepted; no request marks a file not ingested.
- **UpdateFileRecordRequest.metadata_changeset** (`roboto.updates.MetadataChangeset | roboto.sentinels.NotSetType`): Changes to the file's tags and metadata.
- **UpdateFileRecordRequest.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
