ScannerVision Web Server

<back to all web services

GetStillScanning

Requires Authentication
The following routes are available for this service:
GET/{Brand}/stillscanning/{FileNameGuid}
import Foundation
import ServiceStack

public class GetStillScanning : 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
}

public class GetStillScanningResponse : ResponseBase
{
    public var stillScanning:Bool

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case stillScanning
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        stillScanning = try container.decodeIfPresent(Bool.self, forKey: .stillScanning)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if stillScanning != nil { try container.encode(stillScanning, forKey: .stillScanning) }
    }
}

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) }
    }
}


Swift GetStillScanning DTOs

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

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /{Brand}/stillscanning/{FileNameGuid} HTTP/1.1 
Host: buildmax.org 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{Unable to show example output for type 'GetStillScanningResponse' using the custom 'csv' filter}No parameterless constructor defined for this object.