ScannerVision Web Server

<back to all web services

JsonBrowseRequest

Requires Authentication
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

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

    Map<String, dynamic> toJson() => {};
    getTypeName() => "JsonDto";
    TypeContext? context = _ctx;
}

class JsonRequestDto extends JsonDto implements IConvertible
{
    String? ClientCode;
    String? ClientRegistrationCode;
    String? Token;

    JsonRequestDto({this.ClientCode,this.ClientRegistrationCode,this.Token});
    JsonRequestDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'ClientCode': ClientCode,
        'ClientRegistrationCode': ClientRegistrationCode,
        'Token': Token
    });

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

class JsonBrowseRequest extends JsonRequestDto implements IConvertible
{
    String? Path;

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

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

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

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

class JsonBrowseResponse implements IConvertible
{
    String? Path;
    List<String>? Folders;

    JsonBrowseResponse({this.Path,this.Folders});
    JsonBrowseResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

TypeContext _ctx = TypeContext(library: 'buildmax.org', types: <String, TypeInfo> {
    'JsonDto': TypeInfo(TypeOf.Class, create:() => JsonDto()),
    'JsonRequestDto': TypeInfo(TypeOf.Class, create:() => JsonRequestDto()),
    'JsonBrowseRequest': TypeInfo(TypeOf.Class, create:() => JsonBrowseRequest()),
    'JsonBrowseResponse': TypeInfo(TypeOf.Class, create:() => JsonBrowseResponse()),
});

Dart JsonBrowseRequest 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.

POST /jsonl/reply/JsonBrowseRequest HTTP/1.1 
Host: buildmax.org 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"Path":"String","ClientCode":"String","ClientRegistrationCode":"String","Token":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Path":"String","Folders":["String"]}