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| Parameter | Type | Default |
|---|---|---|
who | String | required |
role | Option<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) -> SpaceSharesReturns 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| Parameter | Type | Default |
|---|---|---|
who | Option<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]| Parameter | Type | Default |
|---|---|---|
ids | Vec<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]| Parameter | Type | Default |
|---|---|---|
ids | Vec<String> | required |
Returns Vec<BulkResult> · Async · Raises CuaError
SpaceShareEntry record#
One account a Space is shared with.
| Field | Type | Default | Description |
|---|---|---|---|
who | String | The email or account id, as shared. | |
role | String | viewer or editor. | |
connected | bool | Connected through the relay right now. |
SpaceShares record#
Who a Space is shared with.
Returned by Space.share, Space.shares, Space.unshare.
| Field | Type | Default | Description |
|---|---|---|---|
space | String | The Space. | |
machine | String | The relay machine it is shared as (empty when not shared). | |
invitee_space / inviteeSpace | String | What the people it is shared with open (relay:<machine>). | |
url | String | The relay URL of the machine. | |
online | bool | The machine is on the relay now. | |
shares | Vec<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).
| Field | Type | Default | Description |
|---|---|---|---|
owner_id / ownerId | String | The owner's account id. | |
owner_email / ownerEmail | String | "" | The owner's email, when known. |
owner_name / ownerName | String | "" | The owner's display name, when known. |
role | String | What this account may do: owner, editor or viewer. | |
team | String | "" | The team this account reaches it through (its key), when it is a team's and not shared with this account directly. |
team_name / teamName | String | "" | That team's display name (its key when the name is not known). |
editors | Vec<String> | [] | Owner view: accounts (emails or ids) that may use it. |
viewers | Vec<String> | [] | Owner view: accounts that may only watch. |
teams | Vec<SpaceTeamShare> | [] | Owner view: the teams it is a machine of. |
SpaceTeamShare record#
A team a Space is shared with (SpaceSharing.teams).
| Field | Type | Default | Description |
|---|---|---|---|
key | String | The team's key (org id). | |
name | String | Its display name. | |
role | String | editor 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.
| Field | Type | Default | Description |
|---|---|---|---|
id | String | The Space as asked. | |
ok | bool | It went through. | |
error | Option<String> | Why not, in plain words. | |
message | String | What happened, for people. |