/* Options: Date: 2024-12-22 21:44:07 SwiftVersion: 6.0 Version: 8.51 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://blazor-gallery.servicestack.net //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True //MakePropertiesOptional: True IncludeTypes: QueryTracks.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: False //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/tracks", "GET") // @Route("/tracks/{TrackId}", "GET") public class QueryTracks : QueryDb, IReturn, IGet { public typealias Return = QueryResponse public var trackId:Int? public var nameContains:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case trackId case nameContains } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) trackId = try container.decodeIfPresent(Int.self, forKey: .trackId) nameContains = try container.decodeIfPresent(String.self, forKey: .nameContains) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if trackId != nil { try container.encode(trackId, forKey: .trackId) } if nameContains != nil { try container.encode(nameContains, forKey: .nameContains) } } } public class Tracks : Codable { public var trackId:Int? // @Required() public var name:String? public var albumId:Int? public var mediaTypeId:Int? public var genreId:Int? public var composer:String? public var milliseconds:Int? public var bytes:Int? public var unitPrice:Double? required public init(){} }