/* Options: Date: 2024-12-22 21:17:13 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: QueryArtists.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: False //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/artists", "GET") // @Route("/artists/{ArtistId}", "GET") public class QueryArtists : QueryDb, IReturn, IGet { public typealias Return = QueryResponse public var artistId:Int? public var artistIdBetween:[Int]? public var nameStartsWith:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case artistId case artistIdBetween case nameStartsWith } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) artistId = try container.decodeIfPresent(Int.self, forKey: .artistId) artistIdBetween = try container.decodeIfPresent([Int].self, forKey: .artistIdBetween) ?? [] nameStartsWith = try container.decodeIfPresent(String.self, forKey: .nameStartsWith) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if artistId != nil { try container.encode(artistId, forKey: .artistId) } if artistIdBetween != nil { try container.encode(artistIdBetween, forKey: .artistIdBetween) } if nameStartsWith != nil { try container.encode(nameStartsWith, forKey: .nameStartsWith) } } } public class Artists : Codable { public var artistId:Int? public var name:String? required public init(){} }