/* Options: Date: 2024-12-22 21:07:24 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: QueryChinookEmployees.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: False //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/employees", "GET") // @Route("/employees/{EmployeeId}", "GET") public class QueryChinookEmployees : QueryDb, IReturn, IGet { public typealias Return = QueryResponse public var employeeId:Int? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case employeeId } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) employeeId = try container.decodeIfPresent(Int.self, forKey: .employeeId) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if employeeId != nil { try container.encode(employeeId, forKey: .employeeId) } } } public class Employees : Codable { public var employeeId:Int? // @Required() public var lastName:String? // @Required() public var firstName:String? public var title:String? public var reportsTo:Int? public var birthDate:Date? public var hireDate:Date? public var address:String? public var city:String? public var state:String? public var country:String? public var postalCode:String? public var phone:String? public var fax:String? public var email:String? required public init(){} }