ScannerVision Web Server

<back to all web services

GetNextOriginal

Requires Authentication
The following routes are available for this service:
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
}


Swift GetNextOriginal DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

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: text/jsonl