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.
-
reset()AsynchronousRemoves 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
-
connectVirtualPresenceWithAuthCode(withInput:Asynchronous) Connect a new virtual presence using an OAuth authorization code obtained from the provider consent flow.
Throws
SudoPrivacyInteractionError.Declaration
Swift
func connectVirtualPresenceWithAuthCode( withInput input: ConnectVirtualPresenceWithAuthCodeInput ) async throws -> VirtualPresenceParameters
inputParameters used to connect the virtual presence.
Return Value
The newly connected
VirtualPresence. -
connectVirtualPresenceWithRefreshToken(withInput:Asynchronous) Connect a new virtual presence using a pre-obtained OAuth refresh token.
Throws
SudoPrivacyInteractionError.Declaration
Swift
func connectVirtualPresenceWithRefreshToken( withInput input: ConnectVirtualPresenceWithRefreshTokenInput ) async throws -> VirtualPresenceParameters
inputParameters used to connect the virtual presence.
Return Value
The newly connected
VirtualPresence. -
disconnectVirtualPresence(withId:Asynchronous) Disconnect an existing virtual presence.
Throws
SudoPrivacyInteractionError.Declaration
Swift
func disconnectVirtualPresence(withId id: String) async throws -> VirtualPresenceParameters
idUnique identifier of the virtual presence to disconnect.
Return Value
The disconnected
VirtualPresence. -
refreshVirtualPresenceState(withId:Asynchronous) Validate a virtual presence’s provider grant on demand and return its reconciled state.
If the provider confirms the grant has been revoked (for example, the user removed access in their provider account), the presence transitions to
.needsReauth; otherwise its state is returned unchanged. Use before gating access on a current.connectedstate.Throws
SudoPrivacyInteractionError.Declaration
Swift
func refreshVirtualPresenceState(withId id: String) async throws -> VirtualPresenceParameters
idUnique identifier of the virtual presence to refresh.
Return Value
The reconciled
VirtualPresence. -
listVirtualPresences(withInput:Asynchronous) List the virtual presences owned by the signed-in user.
Throws
SudoPrivacyInteractionError.Declaration
Swift
func listVirtualPresences(withInput input: ListVirtualPresencesInput) async throws -> ListOutput<VirtualPresence>Parameters
inputParameters used to page the results.
Return Value
A paginated list of
VirtualPresence.
-
getDataHolder(withId:Asynchronous) Get a single data holder by its identifier.
Throws
SudoPrivacyInteractionError.Declaration
Swift
func getDataHolder(withId id: String) async throws -> DataHolder?Parameters
idUnique identifier of the data holder.
Return Value
The matching
DataHolder, ornilif no data holder exists with that identifier. -
listDataHolders(withInput:Asynchronous) List the data holders discovered for a virtual presence.
Throws
SudoPrivacyInteractionError.Declaration
Swift
func listDataHolders(withInput input: ListDataHoldersInput) async throws -> ListOutput<DataHolder>Parameters
inputParameters identifying the virtual presence and paging the results.
Return Value
A paginated list of
DataHolder. -
listDataHolderScanSummaries(withInput:Asynchronous) 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
inputParameters identifying the data holder and paging the results.
Return Value
A paginated list of
DataHolderScanSummary. -
archiveDataHolder(withId:Asynchronous) Archive a data holder, removing it from the user’s active list.
Throws
SudoPrivacyInteractionError.Declaration
Swift
func archiveDataHolder(withId id: String) async throws -> DataHolderParameters
idUnique identifier of the data holder to archive.
Return Value
The archived
DataHolder. -
unarchiveDataHolder(withId:Asynchronous) 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 -> DataHolderParameters
idUnique identifier of the data holder to unarchive.
Return Value
The unarchived
DataHolder.
-
getAnalysisResult(withId:Asynchronous) 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
idUnique identifier of the analysis result.
Return Value
The matching
AnalysisResult, ornilif none exists with that identifier. -
listAnalysisResults(withInput:Asynchronous) List the analysis results for a virtual presence.
Throws
SudoPrivacyInteractionError.Declaration
Swift
func listAnalysisResults(withInput input: ListAnalysisResultsInput) async throws -> ListOutput<AnalysisResult>Parameters
inputParameters identifying the virtual presence and paging the results.
Return Value
A paginated list of
AnalysisResult.
-
getOrganizationAnalysis(withInput:Asynchronous) Analyze (read-through) and return the shared, organization-generic analysis for a domain.
Returns a result with
.pendingstatus 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
inputThe domain to analyze and options controlling analysis mode/resolution.
Return Value
The
OrganizationAnalysis, ornilif none exists for the domain.
-
getProviderConfiguration()AsynchronousGet the provider configurations required to support the provider OAuth flow.
Throws
SudoPrivacyInteractionError.Declaration
Swift
func getProviderConfiguration() async throws -> [ProviderConfiguration]Return Value
The list of
ProviderConfiguration, one per supported provider.
-
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
dataHolderIdIdentifier of the data holder whose available actions to list.
includeCompletedWhen
true, include actions whose most recent persisted instance is in a completed state; whenfalsethey are omitted. Whennil, the service default applies.Return Value
A paginated list of
AvailableAction. -
listActionsForDataHolder(withInput:Asynchronous) 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
inputParameters identifying the data holder and paging the results.
Return Value
A paginated list of
Action. -
initiateAction(withInput:Asynchronous) Initiate an action against a data holder relationship.
Throws
SudoPrivacyInteractionError.Declaration
Swift
func initiateAction(withInput input: InitiateActionInput) async throws -> ActionParameters
inputParameters identifying the data holder, intent, and fulfilment method.
Return Value
The initiated
Action. -
confirmActionOutcome(withId:Asynchronous) -
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
idUnique identifier of the action.
Return Value
The matching
Action, ornilif no action exists with that identifier.
-
rescanVirtualPresence(withInput:Asynchronous) 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 -> VirtualPresenceParameters
inputParameters identifying the virtual presence and controlling the scan.
Return Value
The updated
VirtualPresence.
-
Subscribe to virtual presence state events, emitted when a virtual presence changes state (e.g. to
.needsReauthor.scanning).Throws
SudoPrivacyInteractionError.notSignedInif there is no signed-in user.Declaration
Swift
func subscribeToVirtualPresence(subscriptionId: String, subscriber: VirtualPresenceSubscriber) async throwsParameters
subscriptionIdA unique identifier for this subscription, used to unsubscribe later.
subscriberCallback implementation invoked when a virtual presence event occurs.
-
Unsubscribe from virtual presence state events.
Declaration
Swift
func unsubscribeFromVirtualPresence(subscriptionId: String)Parameters
subscriptionIdThe identifier of the subscription to cancel.
-
subscribeToDataHolders(subscriptionId:Asynchronoussubscriber: ) Subscribe to data holder events, emitted when data holders are discovered or updated during scanning.
Throws
SudoPrivacyInteractionError.notSignedInif there is no signed-in user.Declaration
Swift
func subscribeToDataHolders(subscriptionId: String, subscriber: DataHolderSubscriber) async throwsParameters
subscriptionIdA unique identifier for this subscription, used to unsubscribe later.
subscriberCallback implementation invoked when data holder events occur.
-
Unsubscribe from data holder events.
Declaration
Swift
func unsubscribeFromDataHolders(subscriptionId: String)Parameters
subscriptionIdThe identifier of the subscription to cancel.
-
Subscribe to analysis result events, emitted when an analysis result changes status or is updated. The delivered
AnalysisResultUpdateis a lightweight notification; usegetAnalysisResultto fetch the full typed data.Throws
SudoPrivacyInteractionError.notSignedInif there is no signed-in user.Declaration
Swift
func subscribeToAnalysisResult(subscriptionId: String, subscriber: AnalysisResultSubscriber) async throwsParameters
subscriptionIdA unique identifier for this subscription, used to unsubscribe later.
subscriberCallback implementation invoked when an analysis result event occurs.
-
Unsubscribe from analysis result events.
Declaration
Swift
func unsubscribeFromAnalysisResult(subscriptionId: String)Parameters
subscriptionIdThe identifier of the subscription to cancel.
-
subscribeToAction(subscriptionId:Asynchronoussubscriber: ) Subscribe to action events, emitted each time an action is updated.
Throws
SudoPrivacyInteractionError.notSignedInif there is no signed-in user.Declaration
Swift
func subscribeToAction(subscriptionId: String, subscriber: ActionSubscriber) async throwsParameters
subscriptionIdA unique identifier for this subscription, used to unsubscribe later.
subscriberCallback implementation invoked when an action event occurs.
-
Unsubscribe from action events.
Declaration
Swift
func unsubscribeFromAction(subscriptionId: String)Parameters
subscriptionIdThe 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
dataHolderIdIdentifier of the data holder whose available actions to list.
Return Value
A paginated list of
AvailableAction.
SudoPrivacyInteractionClient Protocol Reference