/* Options: Date: 2025-12-06 06:48:12 SwiftVersion: 5.0 Version: 8.0 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://api.1fetch.co.za //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: PlaceOrderFromQuote.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/quote/order", "POST") public class PlaceOrderFromQuote : ApiServiceRequest, IReturn, ILogRequest { public typealias Return = PlaceOrderFromQuoteResponse /** * Optionally provide your own reference identifier */ // @ApiMember(Description="Optionally provide your own reference identifier") public var clientReference:String /** * The quote the order is for */ // @ApiMember(Description="The quote the order is for", IsRequired=true) public var quoteId:String /** * Set this to true to prevent creating an order and billing for it */ // @ApiMember(Description="Set this to true to prevent creating an order and billing for it", IsRequired=true) public var test:Bool /** * Is your account allows Urgent Orders, you can use this flag to indicate when an Order is urgent. */ // @ApiMember(Description="Is your account allows Urgent Orders, you can use this flag to indicate when an Order is urgent.") public var isUrgent:Bool required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case clientReference case quoteId case test case isUrgent } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) clientReference = try container.decodeIfPresent(String.self, forKey: .clientReference) quoteId = try container.decodeIfPresent(String.self, forKey: .quoteId) test = try container.decodeIfPresent(Bool.self, forKey: .test) isUrgent = try container.decodeIfPresent(Bool.self, forKey: .isUrgent) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if clientReference != nil { try container.encode(clientReference, forKey: .clientReference) } if quoteId != nil { try container.encode(quoteId, forKey: .quoteId) } if test != nil { try container.encode(test, forKey: .test) } if isUrgent != nil { try container.encode(isUrgent, forKey: .isUrgent) } } } public class PlaceOrderFromQuoteResponse : ApiServiceResponse { /** * The ID of the order. */ // @ApiMember(Description="The ID of the order.") public var orderId:String /** * User friendly waybill number */ // @ApiMember(Description="User friendly waybill number") public var wayBill:String required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case orderId case wayBill } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) orderId = try container.decodeIfPresent(String.self, forKey: .orderId) wayBill = try container.decodeIfPresent(String.self, forKey: .wayBill) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if orderId != nil { try container.encode(orderId, forKey: .orderId) } if wayBill != nil { try container.encode(wayBill, forKey: .wayBill) } } } public class ApiServiceRequest : IServiceRequest, IHasApiKey, Codable { /** * The API Key required for authentication */ // @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true) public var apiKey:String required public init(){} } public protocol IServiceRequest { } public protocol IHasApiKey { var apiKey:String { get set } } public protocol ILogRequest { } public class ApiServiceResponse : IServiceResponse, Codable { /** * Information about the response. */ // @ApiMember(Description="Information about the response.", IsRequired=true) public var Description:String /** * Heading or summary of the response. */ // @ApiMember(Description="Heading or summary of the response.", IsRequired=true) public var heading:String /** * Did the intended operation for this response complete successfully? */ // @ApiMember(DataType="boolean", Description="Did the intended operation for this response complete successfully?", IsRequired=true) public var wasSuccessful:Bool required public init(){} }