SaveCategory

public struct SaveCategory : Codable, Equatable, Sendable

A model representing a category to be saved or updated

  • The name of the category

    Declaration

    Swift

    public let name: String?
  • Optional note for the category

    Declaration

    Swift

    public let note: String?
  • The ID of the category group this category belongs to. An internal category group may not be specified.

    Declaration

    Swift

    public let categoryGroupId: String?
  • The goal target amount in milliunits format. This amount can only be changed if the category already has a configured goal. If value is specified and goal has not already been configured for category, a monthly goal will be created for the category with this target amount. If goalType is not specified, it will default to “NEED” or “MF” for credit card payment categories.

    Declaration

    Swift

    public var goalTarget: Int64? { get }
  • The change to apply to the goal target.

    Declaration

    Swift

    public let goalTargetUpdate: CategoryGoalTargetUpdate
  • The goal target date in ISO format (e.g. 2016-12-01)

    Declaration

    Swift

    public let goalTargetDate: String?
  • Whether the goal requires the full target amount each period.

    Declaration

    Swift

    public let goalNeedsWholeAmount: Bool?
  • The recurrence frequency for the goal target. Requires goalTarget, cannot be combined with goalTargetDate, and is not supported for Credit Card Payment categories. Omit this value to leave an existing target’s cadence unchanged.

    Declaration

    Swift

    public let goalFrequency: CategoryGoalFrequency?
  • Creates a new SaveCategory instance

    Declaration

    Swift

    public init(
        name: String? = nil,
        note: String? = nil,
        categoryGroupId: String? = nil,
        goalTarget: Int64? = nil,
        goalTargetDate: String? = nil,
        goalNeedsWholeAmount: Bool? = nil,
        goalFrequency: CategoryGoalFrequency? = nil
    )

    Parameters

    name

    The name of the category

    note

    Optional note for the category

    categoryGroupId

    The ID of the category group this category belongs to

    goalTarget

    The goal target amount in milliunits format (only for categories with existing goals)

    goalTargetDate

    The goal target date in ISO format (e.g. 2016-12-01)

    goalNeedsWholeAmount

    Whether the goal requires the full target amount each period

    goalFrequency

    The recurrence frequency for the goal target

  • Creates a new SaveCategory instance with an explicit goal target update.

    Declaration

    Swift

    public init(
        name: String? = nil,
        note: String? = nil,
        categoryGroupId: String? = nil,
        goalTargetUpdate: CategoryGoalTargetUpdate,
        goalTargetDate: String? = nil,
        goalNeedsWholeAmount: Bool? = nil,
        goalFrequency: CategoryGoalFrequency? = nil
    )

    Parameters

    name

    The name of the category

    note

    Optional note for the category

    categoryGroupId

    The ID of the category group this category belongs to

    goalTargetUpdate

    The change to apply to the goal target

    goalTargetDate

    The goal target date in ISO format (e.g. 2016-12-01)

    goalNeedsWholeAmount

    Whether the goal requires the full target amount each period

    goalFrequency

    The recurrence frequency for the goal target

  • Declaration

    Swift

    init(from decoder: Decoder) throws
  • Declaration

    Swift

    func encode(to encoder: Encoder) throws