AccountPush

AccountPush: the browsers that show the signed-in person NoClick's notifications (Web Push).

class AccountPush

The browsers that show the signed-in person NoClick's notifications: a DM or @mention of them in a space, a question or approval that needs them, and work that finished while they weren't watching. Turned on in a browser from the person's own tap, and off there. The signed-in person's alone, in their own browser: any other caller raises noclick.PermissionDenied.

Attributes
configuredbool
public_keystr | None
deviceslist[PushDevice]
rawdict[str, Any]

The response JSON exactly as the API sent it.

getclassmethodasync

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

Read the browsers that show the person's notifications.

Parameters
clientClient | None

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

(default None)
Returns
AccountPush

The browsers (devices), whether this NoClick sends notifications to browsers (configured) and the key a new one subscribes with (public_key).

Usage
push = noclick.AccountPush.get()
print([d.device for d in push.devices])

addclassmethodasync

noclick.AccountPush.add(subscription, *, device=None, client=None) -> PushDevice

Turn notifications on in a browser, with its push subscription (endpoint and keys, as the browser's PushSubscription.toJSON() gives them): the same browser again is updated, never added twice.

Parameters
subscriptionMapping[str, Any]required
devicestr | Nonedefault None
clientClient | None

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

(default None)
Returns
PushDevice

The browser, as it's kept.

Usage
added = noclick.AccountPush.add(subscription, device="iPhone")

removeclassmethodasync

noclick.AccountPush.remove(device_id, *, client=None) -> None

Turn notifications off in one browser.

Parameters
device_idstrrequired
clientClient | None

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

(default None)
Returns

Nothing.

Usage
noclick.AccountPush.remove(added.id)

PushDevice

class PushDevice

One browser that shows the person's notifications, as its push service names it (endpoint).

Attributes
idstr
devicestr | None
endpointstr
created_atdatetime | None
last_sent_atdatetime | None