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 it

A 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 TrashItem

Something deleted, restorable until purge_after.

Attributes
idstr
kindstr
resource_idstr

Its id as it was, and will be again once restored.

namestr | None
user_idstr | None

The user it was deleted from (None for the account's).

trashed_atAny
purge_afterAny

When it's purged for good unless restored first.

operation_idstr | None

The deletion's operation (on the item a delete() returned): Operation.undo() on it restores it too.

from_idclassmethod

noclick.TrashItem.from_id(trash_id, *, user=..., client=None) -> TrashItem

A lazy reference to an item in the trash by its id.

Parameters
trash_idstrrequired
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
TrashItem

The item; it loads the first time it's used.

Usage
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").

Parameters
kindstr | Nonedefault None
limitint | None

Return at most this many.

(default None)
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
list[TrashItem]

Each item, with when it's purged unless restored first.

Usage
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
) -> Page

One page of the trash; pass next_cursor back as cursor.

Parameters
kindstr | Nonedefault None
cursorstr | None

The next_cursor of the page before; omit it for the first page.

(default None)
limitint | None

Return at most this many.

(default None)
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
Page

A page whose data holds the items and whose next_cursor is None on the last page.

Usage
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.

Returns
dict[str, Any]

The restored resource as its own API shows it, with restored: True.

Usage
item = noclick.Database.from_name("orders").delete()
restored = item.restore()
print(restored["name"], restored["status"])

purgeasync

trash_item.purge() -> None

Delete it for good now rather than when purge_after comes: the one deletion that can't be undone.

Usage
for item in noclick.TrashItem.list(kind="bucket"):
    item.purge()

DeletePreview

class DeletePreview

What 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.

Attributes
deletesstr
depends_on_itlist[str]
data_lostlist[str]
stops_billinglist[str]
reversiblebool
undostr | None
confirm_tokenstr | None
expires_in_sint | None
rawdict[str, Any]

The response JSON exactly as the API sent it.

preview_delete

noclick.preview_delete(
    method, path, *, body=None, user=..., client=None
) -> DeletionPreview

What 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.

Parameters
methodstrrequired
pathstrrequired
bodyAnydefault None
userAny

Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).

(defaults to the current user)
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
DeletionPreview

The preview.

Usage
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 DeletionPreview

A 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.

Attributes
operationstr
methodstr
pathstr
titlestr | None
impactDeletionImpact
confirm_tokenstr
expires_in_sint
rawdict[str, Any]

The response JSON exactly as the API sent it.

DeletionImpact

class DeletionImpact

What 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.

Attributes
deletesstr
depends_on_itlist[str]
data_lostlist[str]
stops_billinglist[str]
reversiblebool
undostr | None
effectslist[DeletionEffect]

DeletionEffect

class DeletionEffect

One 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.

Attributes
kindstr
idstr | None
namestr | None
outcomestr
todict[str, str] | None
linestr