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

### CreateViewRequest

```python
class roboto.domain.views.operations.CreateViewRequest(/, **data: Any)
```

`from roboto.domain.views import CreateViewRequest`

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

Bases: `pydantic.BaseModel`

Request body for `POST /v1/views/create`.

Also the optional body of `POST /v1/views/id/{view_id}/duplicate`, which uses only `name` and `definition`: the copy keeps the source View's target and is private.

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

**Parameters**

- **data** (`Any`)

**Attributes**

- **CreateViewRequest.definition** (`roboto.domain.views.record.ViewDefinition`): Query and presentation state to save.

  Roboto rejects a definition written in RoboQL, with `RobotoInvalidRequestException`, when `target` is not in [`ROBOQL_VIEW_TARGETS`](/docs/reference/python-sdk/roboto/domain/views/record#roboto.domain.views.record.ROBOQL_VIEW_TARGETS).

- **CreateViewRequest.name** (`str`) = `None`: Human-readable name of the View.

  From 1 to 120 characters ([`MAX_VIEW_NAME_LENGTH`](/docs/reference/python-sdk/roboto/domain/views/operations#roboto.domain.views.operations.MAX_VIEW_NAME_LENGTH)). Names need not be unique.

- **CreateViewRequest.target** (`roboto.query.QueryTarget`): Resource type the View searches, such as datasets or files. It cannot be changed after the View is created.

- **CreateViewRequest.visibility** (`roboto.domain.views.record.ViewVisibility`): Who can see the View once it is created, [`Private`](/docs/reference/python-sdk/roboto/domain/views/record#roboto.domain.views.record.ViewVisibility.Private) by default.

  Afterwards, only the View's author or an admin or owner of its organization can change it, through `PUT /v1/views/id/{view_id}/access`. That endpoint also grants access to individual users, which this field cannot.

### MAX_VIEW_NAME_LENGTH

```python
roboto.domain.views.operations.MAX_VIEW_NAME_LENGTH: Final[int] = 120
```

`from roboto.domain.views import MAX_VIEW_NAME_LENGTH`

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

Maximum length of a View's name, in characters.

### UpdateViewRequest

```python
class roboto.domain.views.operations.UpdateViewRequest(/, **data: Any)
```

`from roboto.domain.views import UpdateViewRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/views/operations.py#L60-L86)

Bases: `pydantic.BaseModel`

Request body for `PUT /v1/views/id/{view_id}`.

A field left unset (`NotSet`) is unchanged, and fields this model does not declare are ignored. A View's target cannot be changed, because its filters are written against that target's fields; create a new View instead. Change who can see a View through `PUT /v1/views/id/{view_id}/access`.

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

**Parameters**

- **data** (`Any`)

**Attributes**

- **UpdateViewRequest.definition** (`roboto.domain.views.record.ViewDefinition | roboto.sentinels.NotSetType`): New query and presentation state, which replaces the stored definition whole.

  To change one filter, send the full definition with that filter changed. Roboto rejects a definition written in RoboQL, with `RobotoInvalidRequestException`, when the View's target is not in [`ROBOQL_VIEW_TARGETS`](/docs/reference/python-sdk/roboto/domain/views/record#roboto.domain.views.record.ROBOQL_VIEW_TARGETS).

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

- **UpdateViewRequest.name** (`str | roboto.sentinels.NotSetType`) = `None`: New human-readable name, from 1 to 120 characters ([`MAX_VIEW_NAME_LENGTH`](/docs/reference/python-sdk/roboto/domain/views/operations#roboto.domain.views.operations.MAX_VIEW_NAME_LENGTH)).
