Notifications

Notifications: the email alerts NoClick sends your account's owner, one switch for each kind.

class Notifications

Which kinds of email alert NoClick sends your account's owner: categories maps each kind (run_failure, credits, spend_cap, digest, ...) to whether it's on. A kind never turned off is on. They're what Settings → Notifications in the NoClick app shows, and every alert email carries a one-click link that turns its own kind off.

Attributes
categoriesdict[str, bool]
rawdict[str, Any]

The response JSON exactly as the API sent it.

getclassmethodasync

noclick.Notifications.get(*, client=None) -> Notifications

Read which kinds of email alert your account's owner gets. Any of your account's own keys may, but one held to one of your users, which raises noclick.PermissionDenied: they're the owner's.

Parameters
clientClient | None

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

(default None)
Returns
Notifications

Every kind NoClick sends, each True (on) or False (off).

Usage
alerts = noclick.Notifications.get()
print(alerts.categories["digest"])   # True until it's turned off
off = [kind for kind, on in alerts.categories.items() if not on]

updateclassmethodasync

noclick.Notifications.update(categories, *, client=None) -> Notifications

Turn kinds of email alert to your account's owner on (True) or off (False), in one change; a kind you leave out stays as it is. A kind NoClick doesn't send, or a value that isn't True or False, raises noclick.InvalidRequest and changes nothing.

Parameters
categoriesMapping[str, bool]required
clientClient | None

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

(default None)
Returns
Notifications

Every kind, as it stands after the change.

Usage
noclick.Notifications.update({"digest": False, "run_failure": True})