CategoryServiceType
public protocol CategoryServiceType : Sendable
Provides access to category operations
-
categories(planId:Default implementation, asynchronouslastKnowledgeOfServer: ) Returns a list of plan categories.
Returns all categories grouped by category group. Amounts (budgeted, activity, balance, etc.) are specific to the current plan month (UTC).
Default Implementation
Returns a list of plan categories, with optional parameters defaulted.
Declaration
Swift
func categories( planId: String, lastKnowledgeOfServer: ServerKnowledge? ) async throws -> CategoriesResponseParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
lastKnowledgeOfServerIf provided, only entities that have changed since
lastKnowledgeOfServerwill be included.Return Value
A list of category groups and the knowledge of the server
-
category(planId:AsynchronouscategoryId: ) Returns a single category.
Amounts (budgeted, activity, balance, etc.) are specific to the current plan month (UTC).
Declaration
Swift
func category(planId: String, categoryId: String) async throws -> CategoryParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
categoryIdThe id of the category
Return Value
A single category
-
category(planId:Asynchronousmonth: categoryId: ) Returns a single category for a specific plan month.
Declaration
Swift
func category(planId: String, month: String, categoryId: String) async throws -> CategoryParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
monthThe plan month in ISO format (e.g. 2016-12-01) (“current” can also be used to specify the current calendar month (UTC))
categoryIdThe id of the category
Return Value
A single category
-
updateCategory(planId:AsynchronouscategoryId: category: ) Update a category
Declaration
Swift
func updateCategory( planId: String, categoryId: String, category: SaveCategory ) async throws -> CategoryResponseParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
categoryIdThe id of the category
categoryThe category details to be saved
Return Value
The updated category and the knowledge of the server
-
updateCategory(planId:Asynchronousmonth: categoryId: budgeted: ) Update a category for a specific month.
Declaration
Swift
func updateCategory( planId: String, month: String, categoryId: String, budgeted: Int ) async throws -> CategoryParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
monthThe plan month in ISO format (e.g. 2016-12-01) (“current” can also be used to specify the current calendar month (UTC))
categoryIdThe id of the category
budgetedBudgeted amount for the category
Return Value
A single category
-
createCategory(planId:Asynchronouscategory: ) Create a new category
Declaration
Swift
func createCategory( planId: String, category: NewCategory ) async throws -> CategoryResponseParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
categoryThe category to create
Return Value
The created category and the knowledge of the server
-
createCategoryGroup(planId:AsynchronouscategoryGroup: ) Create a new category group
Declaration
Swift
func createCategoryGroup( planId: String, categoryGroup: SaveCategoryGroup ) async throws -> CategoryGroupResponseParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
categoryGroupThe category group to create
Return Value
The created category group and the knowledge of the server
-
Update a category group
Declaration
Swift
func updateCategoryGroup( planId: String, categoryGroupId: String, categoryGroup: SaveCategoryGroup ) async throws -> CategoryGroupResponseParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
categoryGroupIdThe id of the category group
categoryGroupThe category group details to be saved
Return Value
The updated category group and the knowledge of the server
View on GitHub