AccountService
public struct AccountService
Provides access to account operations
-
account(budgetId:AsynchronousaccountId: ) Retrieves a single account.
Declaration
Swift
public func account(budgetId: String, accountId: String) async throws -> AccountParameters
budgetIdId of the budget the account belongs to
accountIdId of the account to be retrieved
Return Value
A single account
-
accounts(budgetId:AsynchronouslastKnowledgeOfServer: ) Retrieves all accounts for a single budget.
Declaration
Swift
public func accounts( budgetId: String, lastKnowledgeOfServer: ServerKnowledge? = nil ) async throws -> (accounts: [Account], lastKnowledgeOfServer: ServerKnowledge)Parameters
budgetIdId of the budget 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
-
newBudgetAccount(budgetId:Asynchronousname: type: balance: ) Creates a new unlinked account in a budget.
Declaration
Swift
public func newBudgetAccount( budgetId: String, name: String, type: AccountType, balance: Int ) async throws -> AccountParameters
budgetIdThe id of the budget (last_used can also be used to specify the last used budget)
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