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

### CreateCollectionRequest

```python
class roboto.domain.collections.operations.CreateCollectionRequest(/, **data: Any)
```

`from roboto import CreateCollectionRequest`

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

Bases: `pydantic.BaseModel`

Request body for [`create()`](/docs/reference/python-sdk/roboto/domain/collections/collection#roboto.domain.collections.collection.Collection.create).

**Parameters**

- **data** (`Any`)

**Attributes**

- **CreateCollectionRequest.custom_fields** (`dict[str, Any] | None`) = `None`: Initial values for the collection'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 [`Collection`](/docs/reference/python-sdk/roboto/domain/custom_fields/record#roboto.domain.custom_fields.record.TargetEntityType.Collection) in the organization the collection 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`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoIllegalArgumentException).

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

- **CreateCollectionRequest.name** (`str | None`) = `None`: Human-readable name of the collection. Roboto does not require names to be unique.

- **CreateCollectionRequest.resource_type** (`roboto.domain.collections.record.CollectionResourceType`): Type of resource the collection holds. It cannot change after the collection is created.

- **CreateCollectionRequest.resources** (`list[roboto.domain.collections.record.CollectionResourceRef] | None`) = `None`: Resources the collection starts with. `None` creates an empty collection.

  Each resource must be of `resource_type`, or the request fails with [`RobotoInvalidRequestException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoInvalidRequestException), and must exist, or it fails with [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException).

- **CreateCollectionRequest.tags** (`list[str] | None`) = `None`: Tags to set on the collection.

### UpdateCollectionRequest

```python
class roboto.domain.collections.operations.UpdateCollectionRequest(/, **data: Any)
```

`from roboto import UpdateCollectionRequest`

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

Bases: `pydantic.BaseModel`

Request body for [`update()`](/docs/reference/python-sdk/roboto/domain/collections/collection#roboto.domain.collections.collection.Collection.update).

A field left at its default (`NotSet` or `None`) is unchanged. Every update creates a new version of the collection, which [`changes()`](/docs/reference/python-sdk/roboto/domain/collections/collection#roboto.domain.collections.collection.Collection.changes) lists.

**Parameters**

- **data** (`Any`)

**Attributes**

- **UpdateCollectionRequest.add_resources** (`list[roboto.domain.collections.record.CollectionResourceRef] | roboto.sentinels.NotSetType`): Resources to add to the collection.

  Each resource must be of the collection's resource type, or the request fails with [`RobotoInvalidRequestException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoInvalidRequestException), and must exist, or it fails with [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException). A resource also listed in `remove_resources` ends up in the collection.

- **UpdateCollectionRequest.add_tags** (`list[str] | roboto.sentinels.NotSetType`): Tags to add to the collection. A tag also listed in `remove_tags` ends up removed.

- **UpdateCollectionRequest.custom_fields_changeset** (`roboto.updates.CustomFieldChangeset | None`) = `None`: Changes to the collection's custom-field values. `None` leaves them unchanged.

  Each field name the changeset references must be a custom field defined for [`Collection`](/docs/reference/python-sdk/roboto/domain/custom_fields/record#roboto.domain.custom_fields.record.TargetEntityType.Collection) in the collection'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`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoIllegalArgumentException). See [`CustomFieldChangeset`](/docs/reference/python-sdk/roboto/updates#roboto.updates.CustomFieldChangeset).

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

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

- **UpdateCollectionRequest.name** (`roboto.sentinels.NotSetType | str | None`): Human-readable name of the collection. `None` clears it.

- **UpdateCollectionRequest.remove_resources** (`list[roboto.domain.collections.record.CollectionResourceRef] | roboto.sentinels.NotSetType`): Resources to remove from the collection.

- **UpdateCollectionRequest.remove_tags** (`list[str] | roboto.sentinels.NotSetType`): Tags to remove from the collection.
