SudoDIRelayClient

public protocol SudoDIRelayClient : AnyObject

Client used to interface with the Sudo Relay Platform service.

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

Lifecycle

  • Clear all locally cached apppsync data

    Throws

    ClearCacheError

    Declaration

    Swift

    func reset() throws

Queries

  • Get a list of postboxes associated with the current user, ordered from oldest to newest.

    Declaration

    Swift

    func listPostboxes(limit: Int?, nextToken: String?) async throws -> ListOutput<Postbox>

    Parameters

    limit

    The maximum number of postboxes to return from this query; if not supplied the service will determine an appropriate limit.

    nextToken

    If more than limit postboxes are available, pass the value returned in a previous response to allow pagination.

    Return Value

  • Get all messages from all postboxes associated with the current user, ordered from oldest to newest.

    Declaration

    Swift

    func listMessages(limit: Int?, nextToken: String?) async throws -> ListOutput<Message>

    Parameters

    limit

    The maximum number of messages to return from this query; if not supplied the service will determine an appropriate limit.

    nextToken

    If more than limit messages are available, pass the value returned in a previous response to allow pagination.

    Return Value

Mutations

  • Creates a Postbox associated with the given connection identifier.

    Declaration

    Swift

    func createPostbox(withConnectionId connectionId: String, ownershipProofToken: String, isEnabled: Bool?) async throws -> Postbox

    Parameters

    connectionId

    The connection id, unique to the current sudo, with which to associate the postbox.

    ownershipProofToken

    A token identifying the current sudo and its authorization to create a postbox.

    isEnabled

    Whether the postbox should be created in an enabled state. If not supplied, the default is true.

    Return Value

  • Updates the Postbox associated with the given identifier.

    Declaration

    Swift

    func updatePostbox(withPostboxId postboxId: String, isEnabled: Bool?) async throws -> Postbox

    Parameters

    postboxId

    The postbox id of the postbox to be updated.

    isEnabled

    The new setting for the postbox isEnabled flag. If not supplied, no change will be made to the postbox setting.

    Return Value

  • Deletes the postbox associated with the given postbox identifier, including all messages stored inside that postbox.

    Declaration

    Swift

    func deletePostbox(withPostboxId postboxId: String) async throws -> String

    Parameters

    postboxId

    The identifier of the postbox to be deleted.

    Return Value

  • Deletes the message associated with the given message identifier

    Declaration

    Swift

    func deleteMessage(withMessageId messageId: String) async throws -> String

    Parameters

    messageId

    The identifier of the message to be deleted.

    Return Value

  • Deletes the messages associated with the given message identifiers

    Declaration

    Swift

    func bulkDeleteMessage(withMessageIds messageIds: [String]) async throws -> [String]

    Parameters

    messageIds

    The identifiers of the messages to be deleted.

    Return Value

Subscriptions