The filters both notification listings accept, as one value rather than as five parameters.
GET /notifications and GET /repos/{owner}/{repo}/notifications declare exactly the same filter set, so one type serves both. Built by starting from NotificationQuery.Empty and naming what should change:
NotificationQuery.Empty
.includingRead
.withSubjects(Vector(NotificationSubjectFilter.Pull))
.updatedSince(lastSync)
'''Only what is set is sent.''' An unset filter contributes no query parameter at all, which matters because Forgejo's defaults are not this library's to guess: the documented default is unread and pinned threads, and an empty status-types= is not the same request as no status-types at all.
The builder methods exist because .scalafix.conf bans default arguments, and a five-argument copy at every call site would be worse than either. Each returns a new query; the type is immutable and safe to share.
==all and status-types overlap, and nobody has measured how==
all=true is documented as "show notifications marked as read", which is also what status-types=read asks for. Which one wins when both are sent, and whether all=true widens or replaces status-types, is not stated by the spec and could not be probed — the endpoint needs a token, so golden/MANIFEST.md has no capture of it. This library sends whatever the caller set and does not reconcile the two; if that matters to a caller, set one of them and not both.
Value parameters
- before
-
only threads updated at or before this instant, Forgejo's
before - includeRead
-
whether to send
all=true.falsesends nothing, becauseall=falseis Forgejo's own default and sending it would assert a behaviour nobody verified; use includingRead rather than writing the flag at a call site - since
-
only threads updated at or after this instant, Forgejo's
since - statuses
-
which
status-typesto ask for; empty omits the parameter entirely - subjects
-
which
subject-typevalues to ask for; empty omits the parameter entirely. Note that no value here can select commit notifications — see NotificationSubjectFilter
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any