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

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

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

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

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

### BeginSingleFileUploadRequest

```python
class roboto.domain.datasets.operations.BeginSingleFileUploadRequest(/, **data: Any)
```

`from roboto.domain.datasets.operations import BeginSingleFileUploadRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/datasets/operations.py#L154-L175)

Bases: `pydantic.BaseModel`

Deprecated. Request body for `POST /v2/datasets/{dataset_id}/uploads`.

Upload a file with [`upload_file()`](/docs/reference/python-sdk/roboto/domain/datasets/dataset#roboto.domain.datasets.dataset.Dataset.upload_file) instead. The route starts uploading one file to a dataset.

**Parameters**

- **data** (`Any`)

**Attributes**

- **BeginSingleFileUploadRequest.file_path** (`str`) = `None`: Path within the dataset to upload the file to, such as `path/to/metadata.json`.
- **BeginSingleFileUploadRequest.file_size** (`int`) = `None`: Size of the file in bytes.
- **BeginSingleFileUploadRequest.origination** (`str | None`) = `None`: What uploaded the file, such as `roboto client v1.0.0`. `None` records the caller's user ID.

### BeginSingleFileUploadResponse

```python
class roboto.domain.datasets.operations.BeginSingleFileUploadResponse(/, **data: Any)
```

`from roboto.domain.datasets.operations import BeginSingleFileUploadResponse`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/datasets/operations.py#L178-L190)

Bases: `pydantic.BaseModel`

Deprecated. Response body of `POST /v2/datasets/{dataset_id}/uploads`.

Upload a file with [`upload_file()`](/docs/reference/python-sdk/roboto/domain/datasets/dataset#roboto.domain.datasets.dataset.Dataset.upload_file) instead. Send the file's bytes to `upload_url` with an HTTP PUT, then mark the upload complete with `PUT /v2/datasets/{dataset_id}/uploads/{upload_id}/complete`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **BeginSingleFileUploadResponse.upload_id** (`str`): Unique ID of the upload.
- **BeginSingleFileUploadResponse.upload_url** (`str`): Pre-signed URL that accepts the file's bytes in an HTTP PUT.

### CreateDatasetIfNotExistsRequest

```python
class roboto.domain.datasets.operations.CreateDatasetIfNotExistsRequest(/, **data: Any)
```

`from roboto import CreateDatasetIfNotExistsRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/datasets/operations.py#L137-L151)

Bases: `pydantic.BaseModel`

Request body for [`create_if_not_exists()`](/docs/reference/python-sdk/roboto/domain/datasets/dataset#roboto.domain.datasets.dataset.Dataset.create_if_not_exists).

Roboto creates the dataset only when no dataset matches a RoboQL query. That method describes how several matches and concurrent requests are resolved.

**Parameters**

- **data** (`Any`)

**Attributes**

- **CreateDatasetIfNotExistsRequest.create_request** (`CreateDatasetRequest`): Properties of the dataset to create when no dataset matches `match_roboql_query`.

- **CreateDatasetIfNotExistsRequest.match_roboql_query** (`str`): RoboQL query that looks for an existing dataset in the organization.

  When a dataset matches, the response is that dataset and nothing is created.

### CreateDatasetRequest

```python
class roboto.domain.datasets.operations.CreateDatasetRequest(**data)
```

`from roboto import CreateDatasetRequest`

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

Bases: `pydantic.BaseModel`

Request body for [`create()`](/docs/reference/python-sdk/roboto/domain/datasets/dataset#roboto.domain.datasets.dataset.Dataset.create).

Passing `None` for `metadata` or `tags` is the same as omitting it. A `name` longer than 120 characters raises `pydantic.ValidationError`.

**Attributes**

- **CreateDatasetRequest.custom_fields** (`dict[str, Any] | None`) = `None`: Initial values for the dataset's custom fields, keyed by field name. `None` sets none.

  Each name must be a [`CustomField`](/docs/reference/python-sdk/roboto/domain/custom_fields/custom_field#roboto.domain.custom_fields.custom_field.CustomField) defined for [`Dataset`](/docs/reference/python-sdk/roboto/domain/custom_fields/record#roboto.domain.custom_fields.record.TargetEntityType.Dataset) in the organization the dataset is created in, with status [`Ready`](/docs/reference/python-sdk/roboto/domain/custom_fields/record#roboto.domain.custom_fields.record.CustomFieldStatus.Ready), and each value must match that field's declared type. Otherwise the request fails with `RobotoIllegalArgumentException`.

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

- **CreateDatasetRequest.device_id** (`str | None`) = `None`: ID of the device that produced the dataset's data.

  Must name a device in the organization the dataset is created in. `None` records the calling device when a device makes the request, and no device otherwise.

- **CreateDatasetRequest.metadata** (`dict[str, Any]`) = `None`: Key-value metadata to set on the dataset.

- **CreateDatasetRequest.name** (`str | None`) = `None`: Human-readable name of the dataset, at most 120 characters.

- **CreateDatasetRequest.tags** (`list[str]`) = `None`: Tags to set on the dataset.

### QueryDatasetsRequest

```python
class roboto.domain.datasets.operations.QueryDatasetsRequest(/, **data: Any)
```

`from roboto import QueryDatasetsRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/datasets/operations.py#L87-L97)

Bases: `pydantic.BaseModel`

Request body holding filter criteria for datasets.

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

**Parameters**

- **data** (`Any`)

**Attributes**

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

### UpdateDatasetRequest

```python
class roboto.domain.datasets.operations.UpdateDatasetRequest(/, **data: Any)
```

`from roboto import UpdateDatasetRequest`

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

Bases: `pydantic.BaseModel`

Request body for [`update()`](/docs/reference/python-sdk/roboto/domain/datasets/dataset#roboto.domain.datasets.dataset.Dataset.update).

A field left at its default (`NotSet` or `None`) is unchanged. A `name` longer than 120 characters raises `pydantic.ValidationError`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **UpdateDatasetRequest.custom_fields_changeset** (`roboto.updates.CustomFieldChangeset | None`) = `None`: Changes to the dataset's custom-field values.

  Each field name the changeset references must be a custom field defined for [`Dataset`](/docs/reference/python-sdk/roboto/domain/custom_fields/record#roboto.domain.custom_fields.record.TargetEntityType.Dataset) in the dataset's organization, with status [`Ready`](/docs/reference/python-sdk/roboto/domain/custom_fields/record#roboto.domain.custom_fields.record.CustomFieldStatus.Ready), and each `set_fields` value must match that field's declared type. Otherwise the request fails with `RobotoIllegalArgumentException`. See [`CustomFieldChangeset`](/docs/reference/python-sdk/roboto/updates#roboto.updates.CustomFieldChangeset).

- **UpdateDatasetRequest.description** (`str | roboto.sentinels.NotSetType | None`): Human-readable description of the dataset. `None` clears it.

- **UpdateDatasetRequest.device_id** (`str | roboto.sentinels.NotSetType | None`): ID of the device that produced the dataset's data, which must be in the dataset's organization.

  `None` clears it.

- **UpdateDatasetRequest.metadata_changeset** (`roboto.updates.MetadataChangeset | roboto.sentinels.NotSetType`): Changes to the dataset's tags and metadata.

- **UpdateDatasetRequest.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

- **UpdateDatasetRequest.name** (`Annotated[str, pydantic.StringConstraints(max_length=120)] | roboto.sentinels.NotSetType | None`): Human-readable name of the dataset, at most 120 characters. `None` clears it.
