You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
PadelClubData/PadelClubData/Data/Gen/BaseMonthData.swift

131 lines
5.7 KiB

// Generated by LeStorageGenerator
// Do not modify this file manually
import Foundation
import LeStorage
import SwiftUI
@Observable
public class BaseMonthData: BaseModelObject, Storable {
public static func resourceName() -> String { return "month-data" }
public static func tokenExemptedMethods() -> [HTTPMethod] { return [] }
public static var copyServerResponse: Bool = false
public static func storeParent() -> Bool { return false }
public var id: String = Store.randomId()
public var monthKey: String = ""
public var creationDate: Date = Date()
public var maleUnrankedValue: Int? = nil
public var femaleUnrankedValue: Int? = nil
public var maleCount: Int? = nil
public var femaleCount: Int? = nil
public var anonymousCount: Int? = nil
public var incompleteMode: Bool = false
public var dataModelIdentifier: String? = nil
public var fileModelIdentifier: String? = nil
public init(
id: String = Store.randomId(),
monthKey: String = "",
creationDate: Date = Date(),
maleUnrankedValue: Int? = nil,
femaleUnrankedValue: Int? = nil,
maleCount: Int? = nil,
femaleCount: Int? = nil,
anonymousCount: Int? = nil,
incompleteMode: Bool = false,
dataModelIdentifier: String? = nil,
fileModelIdentifier: String? = nil
) {
super.init()
self.id = id
self.monthKey = monthKey
self.creationDate = creationDate
self.maleUnrankedValue = maleUnrankedValue
self.femaleUnrankedValue = femaleUnrankedValue
self.maleCount = maleCount
self.femaleCount = femaleCount
self.anonymousCount = anonymousCount
self.incompleteMode = incompleteMode
self.dataModelIdentifier = dataModelIdentifier
self.fileModelIdentifier = fileModelIdentifier
}
required public override init() {
super.init()
}
public enum CodingKeys: String, CodingKey {
case _id = "id"
case _monthKey = "monthKey"
case _creationDate = "creationDate"
case _maleUnrankedValue = "maleUnrankedValue"
case _femaleUnrankedValue = "femaleUnrankedValue"
case _maleCount = "maleCount"
case _femaleCount = "femaleCount"
case _anonymousCount = "anonymousCount"
case _incompleteMode = "incompleteMode"
case _dataModelIdentifier = "dataModelIdentifier"
case _fileModelIdentifier = "fileModelIdentifier"
}
required init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.id = try container.decodeIfPresent(String.self, forKey: ._id) ?? Store.randomId()
self.monthKey = try container.decodeIfPresent(String.self, forKey: ._monthKey) ?? ""
self.creationDate = try container.decodeIfPresent(Date.self, forKey: ._creationDate) ?? Date()
self.maleUnrankedValue = try container.decodeIfPresent(Int.self, forKey: ._maleUnrankedValue) ?? nil
self.femaleUnrankedValue = try container.decodeIfPresent(Int.self, forKey: ._femaleUnrankedValue) ?? nil
self.maleCount = try container.decodeIfPresent(Int.self, forKey: ._maleCount) ?? nil
self.femaleCount = try container.decodeIfPresent(Int.self, forKey: ._femaleCount) ?? nil
self.anonymousCount = try container.decodeIfPresent(Int.self, forKey: ._anonymousCount) ?? nil
self.incompleteMode = try container.decodeIfPresent(Bool.self, forKey: ._incompleteMode) ?? false
self.dataModelIdentifier = try container.decodeIfPresent(String.self, forKey: ._dataModelIdentifier) ?? nil
self.fileModelIdentifier = try container.decodeIfPresent(String.self, forKey: ._fileModelIdentifier) ?? nil
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(self.id, forKey: ._id)
try container.encode(self.monthKey, forKey: ._monthKey)
try container.encode(self.creationDate, forKey: ._creationDate)
try container.encode(self.maleUnrankedValue, forKey: ._maleUnrankedValue)
try container.encode(self.femaleUnrankedValue, forKey: ._femaleUnrankedValue)
try container.encode(self.maleCount, forKey: ._maleCount)
try container.encode(self.femaleCount, forKey: ._femaleCount)
try container.encode(self.anonymousCount, forKey: ._anonymousCount)
try container.encode(self.incompleteMode, forKey: ._incompleteMode)
try container.encode(self.dataModelIdentifier, forKey: ._dataModelIdentifier)
try container.encode(self.fileModelIdentifier, forKey: ._fileModelIdentifier)
try super.encode(to: encoder)
}
public func copy(from other: any Storable) {
guard let monthdata = other as? BaseMonthData else { return }
self.id = monthdata.id
self.monthKey = monthdata.monthKey
self.creationDate = monthdata.creationDate
self.maleUnrankedValue = monthdata.maleUnrankedValue
self.femaleUnrankedValue = monthdata.femaleUnrankedValue
self.maleCount = monthdata.maleCount
self.femaleCount = monthdata.femaleCount
self.anonymousCount = monthdata.anonymousCount
self.incompleteMode = monthdata.incompleteMode
self.dataModelIdentifier = monthdata.dataModelIdentifier
self.fileModelIdentifier = monthdata.fileModelIdentifier
}
public static func parentRelationships() -> [Relationship] {
return []
}
public static func childrenRelationships() -> [Relationship] {
return []
}
public static func relationships() -> [Relationship] {
return []
}
}