/* Options: Date: 2025-04-09 02:29:58 SwiftVersion: 5.0 Version: 8.23 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://testapi.bokamera.se //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: LicensePlanQuery.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/licenses/plans/", "GET") // @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401) public class LicensePlanQuery : QueryDb2, 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 LicensePlan : BaseModel, IBaseModelUpdated, IBaseModelCreated { // @Ignore() public var vossPlan:VossPlanResponse // @Required() public var id:Int? public var vossPlanId:String // @Required() public var planLength:Int? // @Required() public var planLengthUnitId:Int? // @Required() public var name:String? // @Required() public var Description:String? public var updatedDate:Date public var createdDate:Date required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case vossPlan case id case vossPlanId case planLength case planLengthUnitId case name case Description case updatedDate case createdDate } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) vossPlan = try container.decodeIfPresent(VossPlanResponse.self, forKey: .vossPlan) id = try container.decodeIfPresent(Int.self, forKey: .id) vossPlanId = try container.decodeIfPresent(String.self, forKey: .vossPlanId) planLength = try container.decodeIfPresent(Int.self, forKey: .planLength) planLengthUnitId = try container.decodeIfPresent(Int.self, forKey: .planLengthUnitId) name = try container.decodeIfPresent(String.self, forKey: .name) Description = try container.decodeIfPresent(String.self, forKey: .Description) updatedDate = try container.decodeIfPresent(Date.self, forKey: .updatedDate) createdDate = try container.decodeIfPresent(Date.self, forKey: .createdDate) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if vossPlan != nil { try container.encode(vossPlan, forKey: .vossPlan) } if id != nil { try container.encode(id, forKey: .id) } if vossPlanId != nil { try container.encode(vossPlanId, forKey: .vossPlanId) } if planLength != nil { try container.encode(planLength, forKey: .planLength) } if planLengthUnitId != nil { try container.encode(planLengthUnitId, forKey: .planLengthUnitId) } if name != nil { try container.encode(name, forKey: .name) } if Description != nil { try container.encode(Description, forKey: .Description) } if updatedDate != nil { try container.encode(updatedDate, forKey: .updatedDate) } if createdDate != nil { try container.encode(createdDate, forKey: .createdDate) } } } public class LicensePlanQueryResponse : Codable { public var id:Int public var vossPlanId:String public var name:String public var Description:String public var vossPlan:VossPlanResponse public var planLength:Int public var planLengthUnit:LengthUnit public var updatedDate:Date public var createdDate:Date required public init(){} } public class VossPlanResponse : Codable { public var id:String public var name:String public var lengthUnit:String public var length:String required public init(){} } public class BaseModel : Codable { required public init(){} } public protocol IBaseModelCreated { var createdDate:Date { get set } } public protocol IBaseModelUpdated { var updatedDate:Date { get set } } public enum LengthUnit : Int, Codable { case Week = 1 case Month = 2 case Year = 3 }