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 JsonBrowsePicklistRequest extends JsonBrowseRequest implements IConvertible
{
String? TemplateGuid;
String? PicklistGuid;
Map<String,String?>? Answers;
JsonBrowsePicklistRequest({this.TemplateGuid,this.PicklistGuid,this.Answers});
JsonBrowsePicklistRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
TemplateGuid = json['TemplateGuid'];
PicklistGuid = json['PicklistGuid'];
Answers = JsonConverters.fromJson(json['Answers'],'Map<String,String?>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'TemplateGuid': TemplateGuid,
'PicklistGuid': PicklistGuid,
'Answers': JsonConverters.toJson(Answers,'Map<String,String?>',context!)
});
getTypeName() => "JsonBrowsePicklistRequest";
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()),
'JsonBrowsePicklistRequest': TypeInfo(TypeOf.Class, create:() => JsonBrowsePicklistRequest()),
'Map<String,String?>': TypeInfo(TypeOf.Class, create:() => Map<String,String?>()),
'JsonBrowseResponse': TypeInfo(TypeOf.Class, create:() => JsonBrowseResponse()),
});
Dart JsonBrowsePicklistRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /jsonl/reply/JsonBrowsePicklistRequest HTTP/1.1
Host: buildmax.org
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"TemplateGuid":"String","PicklistGuid":"String","Path":"String","ClientCode":"String","ClientRegistrationCode":"String","Token":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"Path":"String","Folders":["String"]}