/* Options: Date: 2025-01-08 03:05:05 SwiftVersion: 6.0 Version: 8.53 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://blazordiffusion.com //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True //MakePropertiesOptional: True IncludeTypes: QueryArtifactStats.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: False //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @ValidateRequest(Validator="HasRole(`Moderator`)") public class QueryArtifactStats : QueryDb, IReturn { public typealias Return = QueryResponse required public init(){ super.init() } required public init(from decoder: Decoder) throws { try super.init(from: decoder) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) } } public class ArtifactStat : StatBase { public var id:Int? public var type:StatType? public var artifactId:Int? public var source:String? public var version:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case id case type case artifactId case source case version } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) id = try container.decodeIfPresent(Int.self, forKey: .id) type = try container.decodeIfPresent(StatType.self, forKey: .type) artifactId = try container.decodeIfPresent(Int.self, forKey: .artifactId) source = try container.decodeIfPresent(String.self, forKey: .source) version = try container.decodeIfPresent(String.self, forKey: .version) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if id != nil { try container.encode(id, forKey: .id) } if type != nil { try container.encode(type, forKey: .type) } if artifactId != nil { try container.encode(artifactId, forKey: .artifactId) } if source != nil { try container.encode(source, forKey: .source) } if version != nil { try container.encode(version, forKey: .version) } } } public class StatBase : Codable { public var refId:String? public var appUserId:Int? public var rawUrl:String? public var remoteIp:String? public var createdDate:Date? required public init(){} } public enum StatType : String, Codable { case Download }