ConsentRepository

This repository give access to Consents for Rød/Blå account users.

Constructors

Link copied to clipboard
constructor(api: ConsentApi, cache: ConsentCache)

Functions

Link copied to clipboard
fun forceAcceptSubConsent(sessionToken: String, consentUpdateSource: String, consentId: Long): Completable

forceAcceptSubConsent, This method is used for updating a single subConsent and also accept all MainConsents if missing, this method should only be called when the user actively make a decision to accept the consent together with its main consent. After the update the cache is updated and the getConsents observable will emmit the updated ConsentGroups until the Completable is completed or failed.

Link copied to clipboard
fun getConsents(sessionToken: String, loadStrategy: ConsentLoadStrategy = ConsentLoadStrategy.CACHE): Observable<List<ConsentGroup>>

getConsents, This Observable will emmit the List of a users ConsentGroup every time changes have been made to the list locally. The application UI should update every time this observable emits a new value.

Link copied to clipboard
fun setConsent(sessionToken: String, consentUpdateSource: String, response: ConsentUserResponse): Completable

setConsent, This method is used for updating the single consent state, this method should only be called when the user actively make a decision to accept or decline a consent. After the update the cache is updated and the getConsents observable will emmit the updated ConsentGroups Some consent will affect others so the user should be blocked from making changes, until the Completable is completed or failed.