/* Options: Date: 2024-12-22 21:50:10 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: QueryChinookCustomers.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: False //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/customers", "GET") // @Route("/customers/{CustomerId}", "GET") public class QueryChinookCustomers : QueryDb, IReturn, IGet { public typealias Return = QueryResponse public var customerId:Int? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case customerId } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) customerId = try container.decodeIfPresent(Int.self, forKey: .customerId) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if customerId != nil { try container.encode(customerId, forKey: .customerId) } } } public class Customers : Codable { public var customerId:Int? // @Required() public var firstName:String? // @Required() public var lastName:String? public var company:String? 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? // @Required() public var email:String? public var supportRepId:Int? required public init(){} }