roboto.experimental.boards.operations#

Module Contents#

class roboto.experimental.boards.operations.CreateBoardRequest(/, **data)#

Bases: pydantic.BaseModel

Request body for POST /v1/boards/create.

The board is personal: the caller owns it. UpdateBoardAccessRequest shares it with the organization.

Parameters:

data (Any)

board_definition: Annotated[dict[str, Any], ValidatedAgainst(BoardDefinition)]#

The board definition as a JSON object, stored as board_definition describes. A top-level title that is a non-empty string must equal name, and a request in which they differ fails validation. A definition with no title is stored without one.

A definition whose top level BoardDefinition refuses fails validation: for example, one with an unknown top-level key, a missing time_range or panels, a panels that is not a list, a stages that is neither a list nor null, a title that is neither a string nor null, or a malformed section or selection. The panels and stages in it are not checked and are stored as given, so the web app can show a broken one beside the rest of the board.

name: str#

an empty name shows nothing in the board list, and the platform keeps a name equal to a definition title only while the title is a non-empty string.

Type:

The name the board list and board page show. Must not be empty

classmethod validate_definition_top_level(board_definition)#

Reject a definition whose top level BoardDefinition refuses.

Parameters:

board_definition (dict[str, Any])

Return type:

dict[str, Any]

validate_name_and_title_agree()#

Reject a name that differs from the definition’s non-empty title.

Return type:

CreateBoardRequest

class roboto.experimental.boards.operations.UpdateBoardAccessRequest(/, **data)#

Bases: pydantic.BaseModel

Request body for PUT /v1/boards/id/<board_id>/access.

Shares a board with the organization, permanently: ownership moves to the org principal. The definition and revision stay unchanged. No request makes a shared board personal again; to get a personal board, create a new board from a copy of this board’s definition.

Parameters:

data (Any)

accessibility: Literal[roboto.experimental.boards.record.BoardAccessibility.Organization]#

Must be organization, which moves ownership to the org principal. A request for user accessibility fails validation.

class roboto.experimental.boards.operations.UpdateBoardRequest(/, **data)#

Bases: pydantic.BaseModel

Request body for PUT /v1/boards/id/<board_id>.

Carries a new name, new definition content, or both. UpdateBoardAccessRequest changes who can open a board.

Parameters:

data (Any)

base_revision: Annotated[int, pydantic.Field(ge=0)] | roboto.sentinels.NotSetType#

The revision you loaded (revision), not the revision you want.

Required whenever the request writes definition content: a board_definition replacement, or a name for a board whose stored definition has a title that is a non-empty string, since keeping the two equal rewrites that title. The record you loaded shows which case applies.

The server compares a supplied base revision with the stored revision, on a rename that writes no definition content as well, and rejects a mismatch with RobotoBoardRevisionConflictException, so a save built on an outdated revision cannot erase someone else’s edit.

board_definition: Annotated[dict[str, Any], ValidatedAgainst(BoardDefinition)] | roboto.sentinels.NotSetType#

The board definition as a JSON object, replacing the stored one whole. A top-level title that is a non-empty string is kept equal to the board’s name: with no name in the request, the board takes the title as its name. A definition with no title leaves the name alone, and the platform never adds a title.

A definition whose top level BoardDefinition refuses fails validation: for example, one with an unknown top-level key, a missing time_range or panels, a panels that is not a list, a stages that is neither a list nor null, a title that is neither a string nor null, or a malformed section or selection. The panels and stages in it are not checked and are stored as given, so the web app can show a broken one beside the rest of the board.

model_config#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: Annotated[str, pydantic.StringConstraints(min_length=1, max_length=120)] | roboto.sentinels.NotSetType#

The name of the board. Rewrites a title the stored definition already has, and never adds one.

Must not be empty: the platform keeps the name equal to a definition title only while the title is a non-empty string, so an empty name written into the title would leave the two unequal, and no later rename could make them equal again. To keep the name, omit the field.

validate_at_least_one_change()#

Reject a request with neither name nor board_definition, which would change nothing.

Return type:

UpdateBoardRequest

validate_base_revision_with_definition()#

Require base_revision with a board_definition.

A rename of a board whose stored definition has a title needs one too. The server enforces that case, since only the stored board shows whether the title is there.

Return type:

UpdateBoardRequest

classmethod validate_definition_top_level(board_definition)#

Reject a definition whose top level BoardDefinition refuses.

Parameters:

board_definition (Union[dict[str, Any], roboto.sentinels.NotSetType])

Return type:

Union[dict[str, Any], roboto.sentinels.NotSetType]

validate_name_and_title_agree()#

Reject a request whose name differs from its definition’s non-empty title.

The platform keeps the two equal, and such a request gives it no basis for choosing between them.

Return type:

UpdateBoardRequest