| GET | /Epson/NextPage |
|---|
import Foundation
import ServiceStack
public class GetEpsonNextPage : Codable
{
required public init(){}
}
public class EpsonResponse : ResponseBase
{
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 ResponseBase : DtoBase
{
public var selectedUiLanguage:String
public var svSession:String
public var title:String
public var pageTip:String
public var newBrowser:Bool
public var scanFront400TA:Bool
public var scanFront400UTAX:Bool
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case selectedUiLanguage
case svSession
case title
case pageTip
case newBrowser
case scanFront400TA
case scanFront400UTAX
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
selectedUiLanguage = try container.decodeIfPresent(String.self, forKey: .selectedUiLanguage)
svSession = try container.decodeIfPresent(String.self, forKey: .svSession)
title = try container.decodeIfPresent(String.self, forKey: .title)
pageTip = try container.decodeIfPresent(String.self, forKey: .pageTip)
newBrowser = try container.decodeIfPresent(Bool.self, forKey: .newBrowser)
scanFront400TA = try container.decodeIfPresent(Bool.self, forKey: .scanFront400TA)
scanFront400UTAX = try container.decodeIfPresent(Bool.self, forKey: .scanFront400UTAX)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if selectedUiLanguage != nil { try container.encode(selectedUiLanguage, forKey: .selectedUiLanguage) }
if svSession != nil { try container.encode(svSession, forKey: .svSession) }
if title != nil { try container.encode(title, forKey: .title) }
if pageTip != nil { try container.encode(pageTip, forKey: .pageTip) }
if newBrowser != nil { try container.encode(newBrowser, forKey: .newBrowser) }
if scanFront400TA != nil { try container.encode(scanFront400TA, forKey: .scanFront400TA) }
if scanFront400UTAX != nil { try container.encode(scanFront400UTAX, forKey: .scanFront400UTAX) }
}
}
public class DtoBase : Codable
{
public var brand:Brand
required public init(){}
}
public enum Brand : String, Codable
{
case Desktop
case Hp
case Kyocera
case NeaScan
case Samsung
case FujiXerox
case Ta
case Utax
case Epson
case ScanFront400
case Sharp
case Ricoh
case FujiFilm
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /Epson/NextPage HTTP/1.1 Host: buildmax.org Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"SelectedUiLanguage":"String","svSession":"String","Title":"String","PageTip":"String","NewBrowser":false,"ScanFront400TA":false,"ScanFront400UTAX":false,"Brand":"Desktop"}