TrashItem
The trash: what was deleted and can still be put back.
Deleting an app, database, bucket, dict, queue, repo, volume, inbox or agent
moves it here, restorable for 30 days, then purged for good. delete() on each of
them returns its TrashItem:
item = noclick.Dict.from_name("rates-cache").delete()
item.restore() # back under its name, every key with itA database's restore lands what it rewound here too, as a database_copy:
restoring that puts it back into its database. While it's in the trash its
name is free and its storage is billed as before; restoring is free.
purge() deletes it for good now: the one deletion that can't be undone, so
through MCP it waits for a person.
class TrashItemSomething deleted, restorable until purge_after.
- Like every live object, it also has hydrate(), refresh() and raw.
| id | str | |
| kind | str | |
| resource_id | str | Its id as it was, and will be again once restored. |
| name | str | None | |
| user_id | str | None | The user it was deleted from (None for the account's). |
| trashed_at | Any | |
| purge_after | Any | When it's purged for good unless restored first. |
| operation_id | str | None | The deletion's operation (on the item a |
from_idclassmethod
noclick.TrashItem.from_id(trash_id, *, user=..., client=None) -> TrashItemA lazy reference to an item in the trash by its id.
Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)The item; it loads the first time it's used.
item = noclick.TrashItem.from_id("4b1e2c7d-0a9f-4e6b-8c3d-5f2a1b7e9d60")
print(item.kind, item.name, item.purge_after)listclassmethodasync
noclick.TrashItem.list(
*, kind=None, limit=None, user=..., client=None
) -> list[TrashItem]What's in the trash, newest first: every kind, or one (kind="dict").
NoneReturn at most this many.
None)Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)Each item, with when it's purged unless restored first.
for item in noclick.TrashItem.list(kind="database"):
print(item.name, item.trashed_at, item.purge_after)list_pageclassmethodasync
noclick.TrashItem.list_page(
*, kind=None, cursor=None, limit=None, user=..., client=None
) -> PageOne page of the trash; pass next_cursor back as cursor.
NoneThe next_cursor of the page before; omit it for the first page.
None)Return at most this many.
None)Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)A page whose data holds the items and whose next_cursor is None on the last page.
page = noclick.TrashItem.list_page(limit=20)
print([item.name for item in page.data])restoreasync
trash_item.restore() -> dict[str, Any]Put it back where it was, under its name, with everything in it. Refused with noclick.Conflict
when something new has taken its name since (rename or delete that first). A database_copy goes back
into its database: a restore of its own (its operation), which keeps what the database holds now as a
copy the same way.
The restored resource as its own API shows it, with restored: True.
item = noclick.Database.from_name("orders").delete()
restored = item.restore()
print(restored["name"], restored["status"])purgeasync
trash_item.purge() -> NoneDelete it for good now rather than when purge_after comes: the one deletion that can't be undone.
for item in noclick.TrashItem.list(kind="bucket"):
item.purge()DeletePreview
class DeletePreviewWhat a deletion would do, in words a person reads before agreeing: what it deletes, what stops working
(depends_on_it), the data that goes (data_lost), what stops being billed (stops_billing), and whether
it's reversible and how (undo). Nothing is deleted by asking. confirm_token is what a call through
MCP sends to confirm it, within expires_in_s.
| deletes | str | |
| depends_on_it | list[str] | |
| data_lost | list[str] | |
| stops_billing | list[str] | |
| reversible | bool | |
| undo | str | None | |
| confirm_token | str | None | |
| expires_in_s | int | None | |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
preview_delete
noclick.preview_delete(
method, path, *, body=None, user=..., client=None
) -> DeletionPreviewWhat method path would delete (DELETE, or POST for a cancel, close or clear), as the account sees it
(user: as one of its users does): what goes, what depends on it, what data is lost and whether it can be taken
back. body is the call's own, for a deletion judged by it (a workflow's edits that remove steps). Nothing is
deleted.
NoneWho the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)The preview.
preview = noclick.preview_delete("DELETE", f"/v1/agents/{agent.id}")
print(preview.impact.deletes, preview.impact.undo if preview.impact.reversible else "for good")DeletionPreview
class DeletionPreviewA deletion previewed: its operation, method and path, what it's called (title), its impact,
and the confirm_token (good for expires_in_s seconds) the call takes.
| operation | str | |
| method | str | |
| path | str | |
| title | str | None | |
| impact | DeletionImpact | |
| confirm_token | str | |
| expires_in_s | int | |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
DeletionImpact
class DeletionImpactWhat a deletion does, in words a person reads before agreeing: what it deletes, what has to go first or
stops working with it (depends_on_it), the data it loses, what stops billing, and whether it can be taken back
(reversible; undo says how). effects says some of depends_on_it as data too.
| deletes | str | |
| depends_on_it | list[str] | |
| data_lost | list[str] | |
| stops_billing | list[str] | |
| reversible | bool | |
| undo | str | None | |
| effects | list[DeletionEffect] |
DeletionEffect
class DeletionEffectOne line of a deletion's depends_on_it said as data, for a page that groups what happens: what it's about
(kind, id and name, None where you can't see it), what happens to it (outcome, the area's own
word: a listener moves, stops or waits), where it goes (to: {"kind", "id", "name"}) and the
line that says it, word for word. Several may share a line.
| kind | str | |
| id | str | None | |
| name | str | None | |
| outcome | str | |
| to | dict[str, str] | None | |
| line | str |