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

### CreateLayoutRequest

```python
class roboto.domain.layouts.operations.CreateLayoutRequest(/, **data: Any)
```

`from roboto.domain.layouts import CreateLayoutRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/layouts/operations.py#L17-L50)

Bases: `pydantic.BaseModel`

Request body for `POST /v1/layouts/create`, which saves a reusable arrangement of visualizer panels.

Building the request raises `pydantic.ValidationError` for a `name` or `folder` longer than 120 characters.

**Parameters**

- **data** (`Any`)

**Attributes**

- **CreateLayoutRequest.accessibility** (`roboto.domain.layouts.record.LayoutAccessibility`) = `None`: Who can view the layout. Defaults to [`User`](/docs/reference/python-sdk/roboto/domain/layouts/record#roboto.domain.layouts.record.LayoutAccessibility.User).

- **CreateLayoutRequest.folder** (`str | None`) = `None`: Folder to group the layout under, at most 120 characters. `None` leaves it ungrouped, at the root.

- **CreateLayoutRequest.layout_definition** (`dict[str, Any]`) = `None`: Definition of the layout's panels and their arrangement, as a JSON object.

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

  The name must differ from that of every organization-wide layout in the organization and of the creator's other personal layouts.

- **CreateLayoutRequest.schema_version** (`int`) = `None`: Version of the format `layout_definition` follows.

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

### UpdateLayoutRequest

```python
class roboto.domain.layouts.operations.UpdateLayoutRequest(/, **data: Any)
```

`from roboto.domain.layouts import UpdateLayoutRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/layouts/operations.py#L53-L121)

Bases: `pydantic.BaseModel`

Request body for `PUT /v1/layouts/id/{layout_id}`, which updates a layout.

A field left unset (`NotSet`) is unchanged. Building it raises `pydantic.ValidationError` when:

- `name` or `folder` is longer than 120 characters.
- `base_revision` is negative.
- `layout_definition` is set without `schema_version`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **UpdateLayoutRequest.accessibility** (`roboto.domain.layouts.record.LayoutAccessibility | roboto.sentinels.NotSetType`) = `None`: Who can view the layout.

- **UpdateLayoutRequest.base_revision** (`int | roboto.sentinels.NotSetType`) = `None`: Revision of the layout when you loaded it, from [`revision`](/docs/reference/python-sdk/roboto/domain/layouts/record#roboto.domain.layouts.record.LayoutRecord.revision).

  When set, Roboto refuses the update with `RobotoConflictException`, and changes nothing, if the layout's revision has changed since: someone else updated it after you loaded it. `NotSet` applies the update whatever the layout's revision.

- **UpdateLayoutRequest.folder** (`str | None | roboto.sentinels.NotSetType`) = `None`: Folder to move the layout into, at most 120 characters. `None` moves it out of any folder, to the root.

- **UpdateLayoutRequest.layout_definition** (`dict[str, Any] | roboto.sentinels.NotSetType`) = `None`: Definition of the layout's panels and their arrangement, as a JSON object. Requires `schema_version`.

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

- **UpdateLayoutRequest.name** (`str | roboto.sentinels.NotSetType`) = `None`: Human-readable name of the layout, at most 120 characters.

  Only the layout's creator can rename it. The name must differ from that of every organization-wide layout in the organization and of the creator's other personal layouts.

- **UpdateLayoutRequest.schema_version** (`int | roboto.sentinels.NotSetType`) = `None`: Version of the format `layout_definition` follows.

  It must be the layout's own version, since an update cannot change it; another value raises `RobotoInvalidRequestException`.

- **UpdateLayoutRequest.tags** (`list[str] | roboto.sentinels.NotSetType`) = `None`: Tags to set on the layout, replacing its current tags.

#### UpdateLayoutRequest.validate_schema_version_with_definition()

```python
def validate_schema_version_with_definition() -> UpdateLayoutRequest
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/layouts/operations.py#L117-L121)

Reject a request that sets `layout_definition` without `schema_version`.

**Returns**

- `UpdateLayoutRequest`
