AccountService
public struct AccountService
Provides access to account operations
-
account(planId:AsynchronousaccountId: ) Retrieves a single account.
Declaration
Swift
public 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:AsynchronouslastKnowledgeOfServer: ) Retrieves all accounts for a single plan.
Declaration
Swift
public func accounts( planId: String, lastKnowledgeOfServer: ServerKnowledge? = nil ) async throws -> (accounts: [Account], lastKnowledgeOfServer: ServerKnowledge)Parameters
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 last server knowledge
-
newPlanAccount(planId:Asynchronousname: type: balance: ) Creates a new unlinked account in a plan.
Declaration
Swift
public 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