AccountServiceType
public protocol AccountServiceType : Sendable
Provides access to account operations
-
account(planId:AsynchronousaccountId: ) Retrieves a single account.
Declaration
Swift
func account(planId: String, accountId: String) async throws -> AccountParameters
planIdId of the plan the account belongs to
accountIdId of the account to be retrieved
Return Value
A single account
-
accounts(planId:Default implementation, asynchronouslastKnowledgeOfServer: ) Retrieves all accounts for a single plan.
Default Implementation
Retrieves all accounts for a single plan, with optional parameters defaulted.
Declaration
Swift
func accounts( planId: String, lastKnowledgeOfServer: ServerKnowledge? ) async throws -> AccountsResponseParameters
planIdId of the plan the accounts belongs to
lastKnowledgeOfServerIf provided, only entities that have changed since
lastKnowledgeOfServerwill be included.Return Value
A list of accounts and the knowledge of the server
-
newPlanAccount(planId:Asynchronousname: type: balance: ) Creates a new unlinked account in a plan.
Declaration
Swift
func newPlanAccount( planId: String, name: String, type: SaveAccountType, balance: Int ) async throws -> AccountParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
nameThe name of the new account
typeThe type of the new account
balanceThe initial balance of the new account in milliunits format
Return Value
A single account
View on GitHub