| GET | /{Brand}/nextoriginal/{FileNameGuid} |
|---|
import Foundation
import ServiceStack
public class GetNextOriginal : RequestBase
{
public var fileNameGuid:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case fileNameGuid
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
fileNameGuid = try container.decodeIfPresent(String.self, forKey: .fileNameGuid)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if fileNameGuid != nil { try container.encode(fileNameGuid, forKey: .fileNameGuid) }
}
}
public class RequestBase : DtoBase
{
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 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 .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /{Brand}/nextoriginal/{FileNameGuid} HTTP/1.1
Host: buildmax.org
Accept: application/xml