CategoryService
public class CategoryService
Provides access to category operations
-
getCategories(budgetId:
AsynchronouslastKnowledgeOfServer: ) Returns a list of budget categories.
Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
Declaration
Swift
public func getCategories( budgetId: String, lastKnowledgeOfServer: Int? = nil ) async throws -> [CategoryGroupWithCategories]
Parameters
budgetId
The id of the budget (last_used can also be used to specify the last used budget)
lastKnowledgeOfServer
If provided, only entities that have changed since
lastKnowledgeOfServer
will be included.Return Value
A list of category groups
-
getCategory(budgetId:
AsynchronouscategoryId: ) Returns a single category.
Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC).
Declaration
Swift
public func getCategory(budgetId: String, categoryId: String) async throws -> Category
Parameters
budgetId
The id of the budget (last_used can also be used to specify the last used budget)
categoryId
The id of the category
Return Value
A single category
-
getCategory(budgetId:
Asynchronousmonth: categoryId: ) Returns a single category for a specific budget month.
Declaration
Swift
public func getCategory( budgetId: String, month: String, categoryId: String ) async throws -> Category
Parameters
budgetId
The id of the budget (last_used can also be used to specify the last used budget)
month
The budget month in ISO format (e.g. 2016-12-01) (“current” can also be used to specify the current calendar month (UTC))
categoryId
The id of the category
Return Value
A single category
-
updateCategory(budgetId:
Asynchronousmonth: categoryId: budgeted: ) Update a category for a specific month.
Declaration
Swift
public func updateCategory( budgetId: String, month: String, categoryId: String, budgeted: Int ) async throws -> Category
Parameters
budgetId
The id of the budget (last_used can also be used to specify the last used budget)
month
The budget month in ISO format (e.g. 2016-12-01) (“current” can also be used to specify the current calendar month (UTC))
categoryId
The id of the category
budgeted
Budgeted amount for the category
Return Value
A single category