| POST | /api/DMS/UploadFile |
|---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class UploadFile implements IConvertible
{
String? RegistrationProfileID;
String? NavigationPath;
String? FileName;
DateTime? FileDate;
String? Description;
bool? DocumentUpload;
String? Source;
String? MetaData;
String? DocumentID;
String? HoofdDocumentID;
List<String>? SubDocumentIDs;
UploadFile({this.RegistrationProfileID,this.NavigationPath,this.FileName,this.FileDate,this.Description,this.DocumentUpload,this.Source,this.MetaData,this.DocumentID,this.HoofdDocumentID,this.SubDocumentIDs});
UploadFile.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
RegistrationProfileID = json['RegistrationProfileID'];
NavigationPath = json['NavigationPath'];
FileName = json['FileName'];
FileDate = JsonConverters.fromJson(json['FileDate'],'DateTime',context!);
Description = json['Description'];
DocumentUpload = json['DocumentUpload'];
Source = json['Source'];
MetaData = json['MetaData'];
DocumentID = json['DocumentID'];
HoofdDocumentID = json['HoofdDocumentID'];
SubDocumentIDs = JsonConverters.fromJson(json['SubDocumentIDs'],'List<String>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'RegistrationProfileID': RegistrationProfileID,
'NavigationPath': NavigationPath,
'FileName': FileName,
'FileDate': JsonConverters.toJson(FileDate,'DateTime',context!),
'Description': Description,
'DocumentUpload': DocumentUpload,
'Source': Source,
'MetaData': MetaData,
'DocumentID': DocumentID,
'HoofdDocumentID': HoofdDocumentID,
'SubDocumentIDs': JsonConverters.toJson(SubDocumentIDs,'List<String>',context!)
};
getTypeName() => "UploadFile";
TypeContext? context = _ctx;
}
enum MessageType
{
Information,
Warning,
Error,
Success,
}
abstract class InformationMessageBase implements IInformationMessage
{
MessageType? Type;
String? Summary;
String? FullMessage;
String? FieldName;
bool? KeepOpen;
InformationMessageBase({this.Type,this.Summary,this.FullMessage,this.FieldName,this.KeepOpen});
InformationMessageBase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Type = JsonConverters.fromJson(json['Type'],'MessageType',context!);
Summary = json['Summary'];
FullMessage = json['FullMessage'];
FieldName = json['FieldName'];
KeepOpen = json['KeepOpen'];
return this;
}
Map<String, dynamic> toJson() => {
'Type': JsonConverters.toJson(Type,'MessageType',context!),
'Summary': Summary,
'FullMessage': FullMessage,
'FieldName': FieldName,
'KeepOpen': KeepOpen
};
getTypeName() => "InformationMessageBase";
TypeContext? context = _ctx;
}
class InformationMessages extends ListBase<InformationMessageBase> implements IInformationMessages, IConvertible
{
final List<InformationMessageBase> l = [];
set length(int newLength) { l.length = newLength; }
int get length => l.length;
InformationMessageBase operator [](int index) => l[index];
void operator []=(int index, InformationMessageBase value) { l[index] = value; }
InformationMessages();
InformationMessages.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "InformationMessages";
TypeContext? context = _ctx;
}
// @DataContract
class UploadFileResponse implements IConvertible
{
// @DataMember
String? DocumentId;
// @DataMember
int? DocumentUploadId;
// @DataMember
String? DocumentNr;
// @DataMember
InformationMessages? Messages;
UploadFileResponse({this.DocumentId,this.DocumentUploadId,this.DocumentNr,this.Messages});
UploadFileResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
DocumentId = json['DocumentId'];
DocumentUploadId = json['DocumentUploadId'];
DocumentNr = json['DocumentNr'];
Messages = JsonConverters.fromJson(json['Messages'],'InformationMessages',context!);
return this;
}
Map<String, dynamic> toJson() => {
'DocumentId': DocumentId,
'DocumentUploadId': DocumentUploadId,
'DocumentNr': DocumentNr,
'Messages': JsonConverters.toJson(Messages,'InformationMessages',context!)
};
getTypeName() => "UploadFileResponse";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dogw.klokgroep.nl', types: <String, TypeInfo> {
'UploadFile': TypeInfo(TypeOf.Class, create:() => UploadFile()),
'MessageType': TypeInfo(TypeOf.Enum, enumValues:MessageType.values),
'InformationMessageBase': TypeInfo(TypeOf.AbstractClass),
'InformationMessages': TypeInfo(TypeOf.Class, create:() => InformationMessages()),
'UploadFileResponse': TypeInfo(TypeOf.Class, create:() => UploadFileResponse()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/DMS/UploadFile HTTP/1.1
Host: dogw.klokgroep.nl
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"RegistrationProfileID":"00000000-0000-0000-0000-000000000000","NavigationPath":"String","FileName":"String","FileDate":"0001-01-01T00:00:00.0000000","Description":"String","DocumentUpload":false,"Source":"String","MetaData":"String","DocumentID":"00000000-0000-0000-0000-000000000000","HoofdDocumentID":"00000000-0000-0000-0000-000000000000","SubDocumentIDs":["00000000-0000-0000-0000-000000000000"]}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"DocumentId":"00000000-0000-0000-0000-000000000000","DocumentUploadId":0,"DocumentNr":"String","Messages":[{}]}