ScannerVision Web Server

<back to all web services

ScanSettingsRequest

Requires Authentication
The following routes are available for this service:
POST/{Brand}/scansettings/{TemplateGuid}
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

enum Brand
{
    Desktop,
    Hp,
    Kyocera,
    NeaScan,
    Samsung,
    FujiXerox,
    Ta,
    Utax,
    Epson,
    ScanFront400,
    Sharp,
    Ricoh,
    FujiFilm,
}

class DtoBase implements IConvertible
{
    Brand? Brand;

    DtoBase({this.Brand});
    DtoBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Brand = JsonConverters.fromJson(json['Brand'],'Brand',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Brand': JsonConverters.toJson(Brand,'Brand',context!)
    };

    getTypeName() => "DtoBase";
    TypeContext? context = _ctx;
}

class RequestBase extends DtoBase implements IConvertible
{
    RequestBase();
    RequestBase.fromJson(Map<String, dynamic> json) : super.fromJson(json);
    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson();
    getTypeName() => "RequestBase";
    TypeContext? context = _ctx;
}

enum ScanColour
{
    BlackAndWhite,
    Greyscale,
    Colour,
    Auto,
}

enum ScanOrientation
{
    Portrait,
    Landscape,
}

enum ScanResolution
{
    Dpi100,
    Dpi200,
    Dpi300,
    Dpi400,
    Dpi600,
}

enum ScanSide
{
    Simplex,
    Duplex,
}

enum ScanSize
{
    Auto,
    A3,
    A4,
    A5,
    B4,
    B5,
    Letter,
    Legal,
    Executive,
    Folio,
    AutoLong,
    A4R,
    A5R,
    A6R,
    B6R,
}

enum ScanSource
{
    Adf,
    Glass,
    Auto,
}

enum ScanType
{
    Text,
    Photo,
    TextAndPhoto,
}

enum BoolSetting
{
    True,
    False,
}

class ScanSettingsRequest extends RequestBase implements IConvertible
{
    String? TemplateGuid;
    ScanColour? SelectedColour;
    ScanOrientation? SelectedOrientation;
    ScanResolution? SelectedResolution;
    ScanSide? SelectedSides;
    ScanSize? SelectedSize;
    ScanSource? SelectedSource;
    ScanType? SelectedType;
    BoolSetting? SelectedScanContinuously;
    BoolSetting? SelectedMixedSizes;

    ScanSettingsRequest({this.TemplateGuid,this.SelectedColour,this.SelectedOrientation,this.SelectedResolution,this.SelectedSides,this.SelectedSize,this.SelectedSource,this.SelectedType,this.SelectedScanContinuously,this.SelectedMixedSizes});
    ScanSettingsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        TemplateGuid = json['TemplateGuid'];
        SelectedColour = JsonConverters.fromJson(json['SelectedColour'],'ScanColour',context!);
        SelectedOrientation = JsonConverters.fromJson(json['SelectedOrientation'],'ScanOrientation',context!);
        SelectedResolution = JsonConverters.fromJson(json['SelectedResolution'],'ScanResolution',context!);
        SelectedSides = JsonConverters.fromJson(json['SelectedSides'],'ScanSide',context!);
        SelectedSize = JsonConverters.fromJson(json['SelectedSize'],'ScanSize',context!);
        SelectedSource = JsonConverters.fromJson(json['SelectedSource'],'ScanSource',context!);
        SelectedType = JsonConverters.fromJson(json['SelectedType'],'ScanType',context!);
        SelectedScanContinuously = JsonConverters.fromJson(json['SelectedScanContinuously'],'BoolSetting',context!);
        SelectedMixedSizes = JsonConverters.fromJson(json['SelectedMixedSizes'],'BoolSetting',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'TemplateGuid': TemplateGuid,
        'SelectedColour': JsonConverters.toJson(SelectedColour,'ScanColour',context!),
        'SelectedOrientation': JsonConverters.toJson(SelectedOrientation,'ScanOrientation',context!),
        'SelectedResolution': JsonConverters.toJson(SelectedResolution,'ScanResolution',context!),
        'SelectedSides': JsonConverters.toJson(SelectedSides,'ScanSide',context!),
        'SelectedSize': JsonConverters.toJson(SelectedSize,'ScanSize',context!),
        'SelectedSource': JsonConverters.toJson(SelectedSource,'ScanSource',context!),
        'SelectedType': JsonConverters.toJson(SelectedType,'ScanType',context!),
        'SelectedScanContinuously': JsonConverters.toJson(SelectedScanContinuously,'BoolSetting',context!),
        'SelectedMixedSizes': JsonConverters.toJson(SelectedMixedSizes,'BoolSetting',context!)
    });

    getTypeName() => "ScanSettingsRequest";
    TypeContext? context = _ctx;
}

class ResponseBase extends DtoBase implements IConvertible
{
    String? SelectedUiLanguage;
    String? svSession;
    String? Title;
    String? PageTip;
    bool? NewBrowser;
    bool? ScanFront400TA;
    bool? ScanFront400UTAX;

    ResponseBase({this.SelectedUiLanguage,this.svSession,this.Title,this.PageTip,this.NewBrowser,this.ScanFront400TA,this.ScanFront400UTAX});
    ResponseBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        SelectedUiLanguage = json['SelectedUiLanguage'];
        svSession = json['svSession'];
        Title = json['Title'];
        PageTip = json['PageTip'];
        NewBrowser = json['NewBrowser'];
        ScanFront400TA = json['ScanFront400TA'];
        ScanFront400UTAX = json['ScanFront400UTAX'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'SelectedUiLanguage': SelectedUiLanguage,
        'svSession': svSession,
        'Title': Title,
        'PageTip': PageTip,
        'NewBrowser': NewBrowser,
        'ScanFront400TA': ScanFront400TA,
        'ScanFront400UTAX': ScanFront400UTAX
    });

    getTypeName() => "ResponseBase";
    TypeContext? context = _ctx;
}

abstract class ITemplateModificationInfo
{
    String? Guid;
    DateTime? TemplateModificationDateTime;
    DateTime? IconModificationDateTime;
}

abstract class IClientQuestion extends ITemplateQuestion
{
    String? QuestionGuid;
    String? ValueDisplayed;
    String? ValueReturned;
    bool? Answered;
    bool? RegexMatches;
    String? RegexHint;
}

enum TemplateType
{
    Workflow,
    FreeForm,
}

enum TemplateScheduleType
{
    Interval,
    Fixed,
}

abstract class ITemplateSchedule extends IInterface
{
    Duration? Time;
    Duration? EndTime;
    bool? NoEndTime;
    TemplateScheduleType? Type;
}

abstract class ICredentials extends IInterface
{
    String? Username;
    String? Password;
}

abstract class IRejection
{
    int? RejectAfter;
    String? RejectionPath;
    ICredentials? ShareCredentials;
}

abstract class IBadDocumentRejection extends IStatus
{
    String? RejectionPath;
    ICredentials? ShareCredentials;
}

enum PdfLoadResolution
{
    Default,
    Dpi100,
    Dpi150,
    Dpi200,
    Dpi300,
    Dpi400,
    Dpi500,
    Dpi600,
}

abstract class IGeneral extends IInterface
{
    String? Name;
    String? Description;
    String? Icon;
    ITemplateSchedule? Schedule;
    IRejection? Rejection;
    IBadDocumentRejection? BadDocumentRejection;
    PdfLoadResolution? PdfLoadResolution;
}

abstract class ICaptureSource extends IStatus
{
}

abstract class ICapture extends IInterface
{
    ReadOnlyCollection<ICaptureSource>? CaptureSources;
}

abstract class IStringMetadata extends IMetadata
{
    bool? IsSecure;
    String? SampleValue;
    String? Value;
}

abstract class IXmlMetadataImportTagMapping extends IInterface
{
    String? XPathExpression;
    IStringMetadata? Metadata;
}

abstract class IXmlMetadataImportNamespaceMapping extends IInterface
{
    String? Prefix;
    String? Name;
}

abstract class IXmlMetadataImport extends IStatus
{
    String? SampleDocumentName;
    ReadOnlyCollection<IXmlMetadataImportTagMapping>? TagMappings;
    ReadOnlyCollection<IXmlMetadataImportNamespaceMapping>? NamespaceMappings;
}

enum NotificationType
{
    FailureOnly,
    SuccessOnly,
    Always,
}

abstract class INotification extends IStatus
{
    String? Description;
    String? To;
    String? Subject;
    String? Body;
    String? Cc;
    String? Bcc;
    NotificationType? NotificationType;
}

abstract class INotifications extends IStatus
{
    ReadOnlyCollection<INotification>? Notifications;
}

abstract class IValidationError
{
    String? Property;
    String? ErrorMessage;
}

abstract class IValidationErrors
{
    ReadOnlyCollection<IValidationError>? Errors;
}

abstract class IValidator
{
    IValidationErrors? ValidationErrors;
    bool? IsValid;
}

abstract class ITemplate extends IStatus
{
    String? TemplateVersion;
    String? ScannerVisionVersion;
    String? Guid;
    String? BeginScript;
    String? EndScript;
    TemplateType? TemplateType;
    IGeneral? General;
    ICapture? Capture;
    IXmlMetadataImport? XmlMetadataImport;
    INotifications? Notifications;
    IValidator? Validator;
}

abstract class IClientTemplate
{
    String? Description;
    Uint8List? Icon;
    ITemplateModificationInfo? ModificationInfo;
    String? Name;
    List<IClientQuestion>? Questions;
    ITemplate? Template;
    String? TemplateGuid;
}

class ScanResponseBase extends ResponseBase implements IConvertible
{
    IClientTemplate? Template;
    List<IClientQuestion>? GlobalQuestions;
    bool? CanEnableScanButton;

    ScanResponseBase({this.Template,this.GlobalQuestions,this.CanEnableScanButton});
    ScanResponseBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Template = JsonConverters.fromJson(json['Template'],'IClientTemplate',context!);
        GlobalQuestions = JsonConverters.fromJson(json['GlobalQuestions'],'List<IClientQuestion>',context!);
        CanEnableScanButton = json['CanEnableScanButton'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Template': JsonConverters.toJson(Template,'IClientTemplate',context!),
        'GlobalQuestions': JsonConverters.toJson(GlobalQuestions,'List<IClientQuestion>',context!),
        'CanEnableScanButton': CanEnableScanButton
    });

    getTypeName() => "ScanResponseBase";
    TypeContext? context = _ctx;
}

class GetTemplateResponse extends ScanResponseBase implements IConvertible
{
    String? ServerAddress;
    int? ServerPort;

    GetTemplateResponse({this.ServerAddress,this.ServerPort});
    GetTemplateResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        ServerAddress = json['ServerAddress'];
        ServerPort = json['ServerPort'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'ServerAddress': ServerAddress,
        'ServerPort': ServerPort
    });

    getTypeName() => "GetTemplateResponse";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'buildmax.org', types: <String, TypeInfo> {
    'Brand': TypeInfo(TypeOf.Enum, enumValues:Brand.values),
    'DtoBase': TypeInfo(TypeOf.Class, create:() => DtoBase()),
    'RequestBase': TypeInfo(TypeOf.Class, create:() => RequestBase()),
    'ScanColour': TypeInfo(TypeOf.Enum, enumValues:ScanColour.values),
    'ScanOrientation': TypeInfo(TypeOf.Enum, enumValues:ScanOrientation.values),
    'ScanResolution': TypeInfo(TypeOf.Enum, enumValues:ScanResolution.values),
    'ScanSide': TypeInfo(TypeOf.Enum, enumValues:ScanSide.values),
    'ScanSize': TypeInfo(TypeOf.Enum, enumValues:ScanSize.values),
    'ScanSource': TypeInfo(TypeOf.Enum, enumValues:ScanSource.values),
    'ScanType': TypeInfo(TypeOf.Enum, enumValues:ScanType.values),
    'BoolSetting': TypeInfo(TypeOf.Enum, enumValues:BoolSetting.values),
    'ScanSettingsRequest': TypeInfo(TypeOf.Class, create:() => ScanSettingsRequest()),
    'ResponseBase': TypeInfo(TypeOf.Class, create:() => ResponseBase()),
    'ITemplateModificationInfo': TypeInfo(TypeOf.Interface),
    'IClientQuestion': TypeInfo(TypeOf.Interface),
    'TemplateType': TypeInfo(TypeOf.Enum, enumValues:TemplateType.values),
    'TemplateScheduleType': TypeInfo(TypeOf.Enum, enumValues:TemplateScheduleType.values),
    'ITemplateSchedule': TypeInfo(TypeOf.Interface),
    'ICredentials': TypeInfo(TypeOf.Interface),
    'IRejection': TypeInfo(TypeOf.Interface),
    'IBadDocumentRejection': TypeInfo(TypeOf.Interface),
    'PdfLoadResolution': TypeInfo(TypeOf.Enum, enumValues:PdfLoadResolution.values),
    'IGeneral': TypeInfo(TypeOf.Interface),
    'ICaptureSource': TypeInfo(TypeOf.Interface),
    'ICapture': TypeInfo(TypeOf.Interface),
    'IStringMetadata': TypeInfo(TypeOf.Interface),
    'IXmlMetadataImportTagMapping': TypeInfo(TypeOf.Interface),
    'IXmlMetadataImportNamespaceMapping': TypeInfo(TypeOf.Interface),
    'IXmlMetadataImport': TypeInfo(TypeOf.Interface),
    'NotificationType': TypeInfo(TypeOf.Enum, enumValues:NotificationType.values),
    'INotification': TypeInfo(TypeOf.Interface),
    'INotifications': TypeInfo(TypeOf.Interface),
    'IValidationError': TypeInfo(TypeOf.Interface),
    'IValidationErrors': TypeInfo(TypeOf.Interface),
    'IValidator': TypeInfo(TypeOf.Interface),
    'ITemplate': TypeInfo(TypeOf.Interface),
    'IClientTemplate': TypeInfo(TypeOf.Interface),
    'ScanResponseBase': TypeInfo(TypeOf.Class, create:() => ScanResponseBase()),
    'List<IClientQuestion>': TypeInfo(TypeOf.Class, create:() => <IClientQuestion>[]),
    'GetTemplateResponse': TypeInfo(TypeOf.Class, create:() => GetTemplateResponse()),
});

Dart ScanSettingsRequest DTOs

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

HTTP + JSON

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

POST /{Brand}/scansettings/{TemplateGuid} HTTP/1.1 
Host: buildmax.org 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"TemplateGuid":"String","SelectedColour":"BlackAndWhite","SelectedOrientation":"Portrait","SelectedResolution":"Dpi100","SelectedSides":"Simplex","SelectedSize":"Auto","SelectedSource":"Adf","SelectedType":"Text","SelectedScanContinuously":"True","SelectedMixedSizes":"True","Brand":"Desktop"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ServerAddress":"String","ServerPort":0,"CanEnableScanButton":true,"SelectedUiLanguage":"String","svSession":"String","Title":"String","PageTip":"String","NewBrowser":false,"ScanFront400TA":false,"ScanFront400UTAX":false,"Brand":"Desktop"}