Files

41 lines
1.3 KiB
Swift

//
// Rule.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
public struct Rule: Sendable, Codable, ParameterConvertible, Hashable {
/** Category is the COA expense account a matching bill books to. An upsert normalizes a slug (\"cloud\") to its account number. */
public var category: String?
/** Pattern is the merchant substring the rule matches on, case-insensitively. It is also the key an upsert writes by. */
public var pattern: String?
/** Priority breaks ties: when several patterns match, the highest wins. */
public var priority: Int64?
public init(category: String? = nil, pattern: String? = nil, priority: Int64? = nil) {
self.category = category
self.pattern = pattern
self.priority = priority
}
public enum CodingKeys: String, CodingKey, CaseIterable {
case category
case pattern
case priority
}
// Encodable protocol methods
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(category, forKey: .category)
try container.encodeIfPresent(pattern, forKey: .pattern)
try container.encodeIfPresent(priority, forKey: .priority)
}
}