SudoPrivacyInteractionClient

public protocol SudoPrivacyInteractionClient : AnyObject

Client used to interface with the Sudo Platform Privacy Interaction service.

It is recommended to code to this interface, rather than the implementation class (DefaultSudoPrivacyInteractionClient) as the implementation class is only meant to be used for initializing an instance of the client.

Lifecycle

  • reset() Asynchronous

    Removes all keys associated with this client, resets any cached data, cleans up subscriptions, and purges any pending operations.

    It is important to note that this will clear ALL cached data related to all Sudo services.

    Declaration

    Swift

    func reset() async throws

Virtual Presences

Data Holders

  • getDataHolder(withId:) Asynchronous

    Get a single data holder by its identifier.

    Throws

    SudoPrivacyInteractionError.

    Declaration

    Swift

    func getDataHolder(withId id: String) async throws -> DataHolder?

    Parameters

    id

    Unique identifier of the data holder.

    Return Value

    The matching DataHolder, or nil if no data holder exists with that identifier.

  • List the data holders discovered for a virtual presence.

    Throws

    SudoPrivacyInteractionError.

    Declaration

    Swift

    func listDataHolders(withInput input: ListDataHoldersInput) async throws -> ListOutput<DataHolder>

    Parameters

    input

    Parameters identifying the virtual presence and paging the results.

    Return Value

    A paginated list of DataHolder.

  • List the scan summaries captured for a data holder, most recent first.

    Throws

    SudoPrivacyInteractionError.

    Declaration

    Swift

    func listDataHolderScanSummaries(
        withInput input: ListDataHolderScanSummariesInput
    ) async throws -> ListOutput<DataHolderScanSummary>

    Parameters

    input

    Parameters identifying the data holder and paging the results.

    Return Value

    A paginated list of DataHolderScanSummary.

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

    Throws

    SudoPrivacyInteractionError.

    Declaration

    Swift

    func archiveDataHolder(withId id: String) async throws -> DataHolder

    Parameters

    id

    Unique identifier of the data holder to archive.

    Return Value

    The archived DataHolder.

  • Unarchive a previously archived data holder, returning it to the monitored state.

    Only a data holder in the archived state may be unarchived.

    Throws

    SudoPrivacyInteractionError.

    Declaration

    Swift

    func unarchiveDataHolder(withId id: String) async throws -> DataHolder

    Parameters

    id

    Unique identifier of the data holder to unarchive.

    Return Value

    The unarchived DataHolder.

Analysis Results

  • Get a single analysis result by its identifier, including its typed data.

    Throws

    SudoPrivacyInteractionError.

    Declaration

    Swift

    func getAnalysisResult(withId id: String) async throws -> AnalysisResult?

    Parameters

    id

    Unique identifier of the analysis result.

    Return Value

    The matching AnalysisResult, or nil if none exists with that identifier.

  • List the analysis results for a virtual presence.

    Throws

    SudoPrivacyInteractionError.

    Declaration

    Swift

    func listAnalysisResults(withInput input: ListAnalysisResultsInput) async throws -> ListOutput<AnalysisResult>

    Parameters

    input

    Parameters identifying the virtual presence and paging the results.

    Return Value

    A paginated list of AnalysisResult.

Organization Analysis

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

    Returns a result with .pending status when an asynchronous source is still resolving; re-query for the terminal result.

    Throws

    SudoPrivacyInteractionError.

    Declaration

    Swift

    func getOrganizationAnalysis(withInput input: GetOrganizationAnalysisInput) async throws -> OrganizationAnalysis?

    Parameters

    input

    The domain to analyze and options controlling analysis mode/resolution.

    Return Value

    The OrganizationAnalysis, or nil if none exists for the domain.

Provider Configuration

Actions

  • List the actions currently available for a data holder relationship.

    Throws

    SudoPrivacyInteractionError.

    Declaration

    Swift

    func listAvailableActions(
        forDataHolderId dataHolderId: String,
        includeCompleted: Bool?
    ) async throws -> ListOutput<AvailableAction>

    Parameters

    dataHolderId

    Identifier of the data holder whose available actions to list.

    includeCompleted

    When true, include actions whose most recent persisted instance is in a completed state; when false they are omitted. When nil, the service default applies.

    Return Value

    A paginated list of AvailableAction.

  • 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.

    Throws

    SudoPrivacyInteractionError.

    Declaration

    Swift

    func listActionsForDataHolder(withInput input: ListActionsForDataHolderInput) async throws -> ListOutput<Action>

    Parameters

    input

    Parameters identifying the data holder and paging the results.

    Return Value

    A paginated list of Action.

  • Initiate an action against a data holder relationship.

    Throws

    SudoPrivacyInteractionError.

    Declaration

    Swift

    func initiateAction(withInput input: InitiateActionInput) async throws -> Action

    Parameters

    input

    Parameters identifying the data holder, intent, and fulfilment method.

    Return Value

    The initiated Action.

  • Confirm that an assisted or delegated action was completed.

    Throws

    SudoPrivacyInteractionError.

    Declaration

    Swift

    func confirmActionOutcome(withId id: String) async throws -> Action

    Parameters

    id

    Identifier of the action to confirm.

    Return Value

    The updated Action.

  • getAction(withId:) Asynchronous

    Get a single action by its identifier.

    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.

    Throws

    SudoPrivacyInteractionError.

    Declaration

    Swift

    func getAction(withId id: String) async throws -> Action?

    Parameters

    id

    Unique identifier of the action.

    Return Value

    The matching Action, or nil if no action exists with that identifier.

Rescan

  • Rescan an existing virtual presence for new data holders.

    The rescan proceeds from the virtual presence’s last scan date forward.

    Throws

    SudoPrivacyInteractionError.

    Declaration

    Swift

    func rescanVirtualPresence(withInput input: RescanVirtualPresenceInput) async throws -> VirtualPresence

    Parameters

    input

    Parameters identifying the virtual presence and controlling the scan.

    Return Value

    The updated VirtualPresence.

Subscriptions

  • Subscribe to virtual presence state events, emitted when a virtual presence changes state (e.g. to .needsReauth or .scanning).

    Throws

    SudoPrivacyInteractionError.notSignedIn if there is no signed-in user.

    Declaration

    Swift

    func subscribeToVirtualPresence(subscriptionId: String, subscriber: VirtualPresenceSubscriber) async throws

    Parameters

    subscriptionId

    A unique identifier for this subscription, used to unsubscribe later.

    subscriber

    Callback implementation invoked when a virtual presence event occurs.

  • Unsubscribe from virtual presence state events.

    Declaration

    Swift

    func unsubscribeFromVirtualPresence(subscriptionId: String)

    Parameters

    subscriptionId

    The identifier of the subscription to cancel.

  • Subscribe to data holder events, emitted when data holders are discovered or updated during scanning.

    Throws

    SudoPrivacyInteractionError.notSignedIn if there is no signed-in user.

    Declaration

    Swift

    func subscribeToDataHolders(subscriptionId: String, subscriber: DataHolderSubscriber) async throws

    Parameters

    subscriptionId

    A unique identifier for this subscription, used to unsubscribe later.

    subscriber

    Callback implementation invoked when data holder events occur.

  • Unsubscribe from data holder events.

    Declaration

    Swift

    func unsubscribeFromDataHolders(subscriptionId: String)

    Parameters

    subscriptionId

    The identifier of the subscription to cancel.

  • Subscribe to analysis result events, emitted when an analysis result changes status or is updated. The delivered AnalysisResultUpdate is a lightweight notification; use getAnalysisResult to fetch the full typed data.

    Throws

    SudoPrivacyInteractionError.notSignedIn if there is no signed-in user.

    Declaration

    Swift

    func subscribeToAnalysisResult(subscriptionId: String, subscriber: AnalysisResultSubscriber) async throws

    Parameters

    subscriptionId

    A unique identifier for this subscription, used to unsubscribe later.

    subscriber

    Callback implementation invoked when an analysis result event occurs.

  • Unsubscribe from analysis result events.

    Declaration

    Swift

    func unsubscribeFromAnalysisResult(subscriptionId: String)

    Parameters

    subscriptionId

    The identifier of the subscription to cancel.

  • Subscribe to action events, emitted each time an action is updated.

    Throws

    SudoPrivacyInteractionError.notSignedIn if there is no signed-in user.

    Declaration

    Swift

    func subscribeToAction(subscriptionId: String, subscriber: ActionSubscriber) async throws

    Parameters

    subscriptionId

    A unique identifier for this subscription, used to unsubscribe later.

    subscriber

    Callback implementation invoked when an action event occurs.

  • Unsubscribe from action events.

    Declaration

    Swift

    func unsubscribeFromAction(subscriptionId: String)

    Parameters

    subscriptionId

    The identifier of the subscription to cancel.

  • listAvailableActions(forDataHolderId:) Extension method, asynchronous

    List the actions currently available for a data holder relationship, using the service default for whether completed actions are included.

    Throws

    SudoPrivacyInteractionError.

    Declaration

    Swift

    func listAvailableActions(forDataHolderId dataHolderId: String) async throws -> ListOutput<AvailableAction>

    Parameters

    dataHolderId

    Identifier of the data holder whose available actions to list.

    Return Value

    A paginated list of AvailableAction.