SudoPrivacyInteractionClient

Interface encapsulating a library for interacting with the Sudo Platform Privacy Interaction & Mitigation service.

Samples

import android.content.Context
import com.sudoplatform.sudoprivacyinteraction.BaseTests
import com.sudoplatform.sudoprivacyinteraction.SudoPrivacyInteractionClient
import com.sudoplatform.sudouser.SudoUserClient
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.kotlin.mock
import org.robolectric.RobolectricTestRunner

fun main() { 
   //sampleStart 
   val privacyInteractionClient =
    SudoPrivacyInteractionClient
        .builder()
        .setContext(context)
        .setSudoUserClient(sudoUserClient)
        .build() 
   //sampleEnd
}

Types

Link copied to clipboard

Defines the exceptions for the action based methods.

Link copied to clipboard

Defines the exceptions for the analysis result based methods.

Link copied to clipboard
class Builder

Builder used to construct the SudoPrivacyInteractionClient.

Link copied to clipboard
object Companion
Link copied to clipboard

Defines the exceptions for the data holder based methods.

Link copied to clipboard

Defines the exceptions for the virtual presence based methods.

Functions

Link copied to clipboard
abstract suspend fun archiveDataHolder(id: String): DataHolder

Archive a data holder, removing it from the user's active list.

Link copied to clipboard
abstract fun close()
Link copied to clipboard
abstract suspend fun confirmActionOutcome(id: String): Action

Confirm that an assisted or delegated action was completed, transitioning it to a verified completion state.

Link copied to clipboard

Connect a virtual presence using an authorization code obtained from an OAuth flow.

Link copied to clipboard

Connect a virtual presence using a pre-obtained refresh token credential.

Link copied to clipboard

Disconnect a virtual presence.

Link copied to clipboard
abstract suspend fun getAction(id: String): Action?

Read a single initiated action by ID. Resolves an in-flight delegated action on read: if the action is still in progress, its outcome is polled and, once terminal, the action is updated to its verified result before being returned.

Link copied to clipboard
abstract suspend fun getAnalysisResult(id: String): AnalysisResult?

Retrieve a full analysis result by ID.

Link copied to clipboard
abstract suspend fun getDataHolder(id: String, options: GetDataHolderOptions = GetDataHolderOptions()): DataHolder?

Retrieve a single data holder by ID.

Link copied to clipboard

Analyze (read-through) and return the shared, organization-generic analysis for a domain.

Link copied to clipboard

Retrieve the provider configurations required by consumers to support the provider OAuth flow.

Link copied to clipboard
abstract suspend fun initiateAction(input: InitiateActionInput): Action

Initiate an action against a data holder relationship. Delegated actions are performed on the user's behalf; assisted actions return structured materials for the client to complete.

Link copied to clipboard

List the persisted action history for a data holder. Returns every action that has been initiated against the data holder (all intents, all statuses, every attempt), ordered newest-first. This is the executed-action history, distinct from listAvailableActions, which returns the derived set of actions a user could take.

Link copied to clipboard

List analysis results associated with a virtual presence.

Link copied to clipboard

List the actions currently available for a data holder relationship.

Link copied to clipboard

List data holders associated with a virtual presence.

Link copied to clipboard

List scan summaries associated with a data holder, most recent first.

Link copied to clipboard
abstract suspend fun listVirtualPresences(input: ListVirtualPresencesInput = ListVirtualPresencesInput()): ListOutput<VirtualPresence>

List all virtual presences for the signed-in user.

Link copied to clipboard

Validate a virtual presence's provider grant on demand and return its reconciled state. If the provider confirms the grant has been revoked (e.g. the user removed access in their provider account), the presence transitions to VirtualPresenceState.NEEDS_REAUTH; otherwise its state is returned unchanged. Use before gating access on a current VirtualPresenceState.CONNECTED state.

Link copied to clipboard

Rescan a virtual presence.

Link copied to clipboard
abstract fun reset()

Reset any internal state and cached content.

Link copied to clipboard
abstract suspend fun setSignInCallback(callback: SudoPlatformSignInCallback?)

Set an optional callback to be invoked when an operation is attempted while the user is not signed in.

Link copied to clipboard
abstract suspend fun subscribeToActions(subscriptionId: String, subscriber: ActionSubscriber)

Subscribe to action status events. The subscriber is notified when an action's status changes.

Link copied to clipboard
abstract suspend fun subscribeToAnalysisResult(subscriptionId: String, subscriber: AnalysisResultSubscriber)

Subscribe to analysis result events. The subscriber is notified when an analysis result is created or updated.

Link copied to clipboard
abstract suspend fun subscribeToDataHolders(subscriptionId: String, subscriber: DataHolderSubscriber)

Subscribe to data holder events. The subscriber is notified with batches of data holders as they are discovered or updated during scanning.

Link copied to clipboard
abstract suspend fun subscribeToVirtualPresence(subscriptionId: String, subscriber: VirtualPresenceSubscriber)

Subscribe to virtual presence state events. The subscriber is notified when a virtual presence changes state (e.g. to NEEDS_REAUTH or SCANNING).

Link copied to clipboard
abstract suspend fun unarchiveDataHolder(id: String): DataHolder

Unarchive a previously archived data holder, returning it to the DataHolderProtectionState.MONITORED state. Only a data holder in the DataHolderProtectionState.ARCHIVED state may be unarchived.

Link copied to clipboard

Unsubscribe all subscribers from action status events.

Link copied to clipboard

Unsubscribe all subscribers from analysis result events.

Link copied to clipboard

Unsubscribe all subscribers from data holder events.

Link copied to clipboard

Unsubscribe all subscribers from virtual presence state events.

Link copied to clipboard
abstract fun unsubscribeFromActions(subscriptionId: String)

Unsubscribe the specified subscriber from action status events.

Link copied to clipboard
abstract fun unsubscribeFromAnalysisResult(subscriptionId: String)

Unsubscribe the specified subscriber from analysis result events.

Link copied to clipboard
abstract fun unsubscribeFromDataHolders(subscriptionId: String)

Unsubscribe the specified subscriber from data holder events.

Link copied to clipboard
abstract fun unsubscribeFromVirtualPresence(subscriptionId: String)

Unsubscribe the specified subscriber from virtual presence state events.