Sharing, leaving and bulk delete

Give another person access to a Space, see who owns a Space and who else has it, leave Spaces shared with you, and delete several at once.

Space.share gives a person access to a Space, Space.shares lists who has it, and Space.unshare takes it back. A Space on the relay carries SpaceInfo.sharing: its owner, your role (owner, editor, viewer), the team you reach it through and, for your own, who else has it. leave_many takes you off Spaces shared with you; delete_many deletes several of yours, three at a time, turning running ones off first. Both answer one BulkResult per id, in order.

Sharing#

Methods of Space.

Space.share#

Lets who (a verified email or an account id) watch (viewer, the default) or use (editor) this Space through the relay. A Space that is not a host is attached to the relay on its first share.

async def share(self, who: str, role: Optional[str]) -> SpaceShares
ParameterTypeDefault
whoStringrequired
roleOption<String>required

Returns SpaceShares · Async · Raises CuaError

Space.shares#

Who this Space is shared with, and who of them is connected now.

async def shares(self) -> SpaceShares

Returns SpaceShares · Async · Raises CuaError

Space.unshare#

Stops sharing this Space with who at once, or with everyone when who is None.

async def unshare(self, who: Optional[str]) -> SpaceShares
ParameterTypeDefault
whoOption<String>required

Returns SpaceShares · Async · Raises CuaError

Leave and bulk delete#

Methods of Spaces.

Spaces.leave_many#

Takes this account off Spaces shared with it (through the relay): a direct share ends, a team's Space leaves this account's list. Your own Spaces are refused (delete them). One result per id, in order; a relay that predates leaving answers "Couldn't leave <name>: the Cua relay needs an update."

async def leave_many(self, ids: List[str]) -> List[BulkResult]
ParameterTypeDefault
idsVec<String>required

Returns Vec<BulkResult> · Async · Raises CuaError

Spaces.delete_many#

Deletes several Spaces (Spaces.delete each), at most three at a time, turning running ones off first. One result per id, in order; one failure never stops the rest.

async def delete_many(self, ids: List[str]) -> List[BulkResult]
ParameterTypeDefault
idsVec<String>required

Returns Vec<BulkResult> · Async · Raises CuaError

SpaceShareEntry record#

One account a Space is shared with.

FieldTypeDefaultDescription
whoStringThe email or account id, as shared.
roleStringviewer or editor.
connectedboolConnected through the relay right now.

SpaceShares record#

Who a Space is shared with.

Returned by Space.share, Space.shares, Space.unshare.

FieldTypeDefaultDescription
spaceStringThe Space.
machineStringThe relay machine it is shared as (empty when not shared).
invitee_space / inviteeSpaceStringWhat the people it is shared with open (relay:<machine>).
urlStringThe relay URL of the machine.
onlineboolThe machine is on the relay now.
sharesVec<SpaceShareEntry>The accounts and their roles.

SpaceSharing record#

Who a Space belongs to and who else has it, as this account sees it (SpaceInfo.sharing).

FieldTypeDefaultDescription
owner_id / ownerIdStringThe owner's account id.
owner_email / ownerEmailString""The owner's email, when known.
owner_name / ownerNameString""The owner's display name, when known.
roleStringWhat this account may do: owner, editor or viewer.
teamString""The team this account reaches it through (its key), when it is a team's and not shared with this account directly.
team_name / teamNameString""That team's display name (its key when the name is not known).
editorsVec<String>[]Owner view: accounts (emails or ids) that may use it.
viewersVec<String>[]Owner view: accounts that may only watch.
teamsVec<SpaceTeamShare>[]Owner view: the teams it is a machine of.

SpaceTeamShare record#

A team a Space is shared with (SpaceSharing.teams).

FieldTypeDefaultDescription
keyStringThe team's key (org id).
nameStringIts display name.
roleStringeditor or viewer.

BulkResult record#

The outcome for one Space of Spaces.delete_many or Spaces.leave_many.

Returned by Spaces.delete_many, Spaces.leave_many.

FieldTypeDefaultDescription
idStringThe Space as asked.
okboolIt went through.
errorOption<String>Why not, in plain words.
messageStringWhat happened, for people.