POST | /api/DMS/UploadFile |
---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
// @DataContract
class MetaDataField implements IConvertible
{
// @DataMember
String? ID;
// @DataMember
String? DocumentVeldID;
// @DataMember
String? Name;
// @DataMember
String? Label;
// @DataMember
String? Datatype;
// @DataMember
String? PrintLabel;
// @DataMember
String? Entity;
// @DataMember
String? PrintValue;
// @DataMember
String? RegistrationValue;
// @DataMember
String? SPSiteColumnName;
// @DataMember
String? ShadowName;
// @DataMember
String? ShadowDatatype;
// @DataMember
String? ShadowSPSiteColumnName;
// @DataMember
String? ShadowSPSiteColumnRegistrationValue;
// @DataMember
String? ShadowRegistrationValue;
// @DataMember
bool? IsKeyField;
// @DataMember
bool? KopierenBijNieuweVersie;
MetaDataField({this.ID,this.DocumentVeldID,this.Name,this.Label,this.Datatype,this.PrintLabel,this.Entity,this.PrintValue,this.RegistrationValue,this.SPSiteColumnName,this.ShadowName,this.ShadowDatatype,this.ShadowSPSiteColumnName,this.ShadowSPSiteColumnRegistrationValue,this.ShadowRegistrationValue,this.IsKeyField,this.KopierenBijNieuweVersie});
MetaDataField.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ID = json['ID'];
DocumentVeldID = json['DocumentVeldID'];
Name = json['Name'];
Label = json['Label'];
Datatype = json['Datatype'];
PrintLabel = json['PrintLabel'];
Entity = json['Entity'];
PrintValue = json['PrintValue'];
RegistrationValue = json['RegistrationValue'];
SPSiteColumnName = json['SPSiteColumnName'];
ShadowName = json['ShadowName'];
ShadowDatatype = json['ShadowDatatype'];
ShadowSPSiteColumnName = json['ShadowSPSiteColumnName'];
ShadowSPSiteColumnRegistrationValue = json['ShadowSPSiteColumnRegistrationValue'];
ShadowRegistrationValue = json['ShadowRegistrationValue'];
IsKeyField = json['IsKeyField'];
KopierenBijNieuweVersie = json['KopierenBijNieuweVersie'];
return this;
}
Map<String, dynamic> toJson() => {
'ID': ID,
'DocumentVeldID': DocumentVeldID,
'Name': Name,
'Label': Label,
'Datatype': Datatype,
'PrintLabel': PrintLabel,
'Entity': Entity,
'PrintValue': PrintValue,
'RegistrationValue': RegistrationValue,
'SPSiteColumnName': SPSiteColumnName,
'ShadowName': ShadowName,
'ShadowDatatype': ShadowDatatype,
'ShadowSPSiteColumnName': ShadowSPSiteColumnName,
'ShadowSPSiteColumnRegistrationValue': ShadowSPSiteColumnRegistrationValue,
'ShadowRegistrationValue': ShadowRegistrationValue,
'IsKeyField': IsKeyField,
'KopierenBijNieuweVersie': KopierenBijNieuweVersie
};
getTypeName() => "MetaDataField";
TypeContext? context = _ctx;
}
class UploadFile implements IConvertible
{
String? RegistrationProfileID;
String? NavigationPath;
String? FileName;
String? Description;
bool? DocumentUpload;
List<MetaDataField>? MetaData;
String? DocumentID;
String? HoofdDocumentID;
List<String>? SubDocumentIDs;
UploadFile({this.RegistrationProfileID,this.NavigationPath,this.FileName,this.Description,this.DocumentUpload,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'];
Description = json['Description'];
DocumentUpload = json['DocumentUpload'];
MetaData = JsonConverters.fromJson(json['MetaData'],'List<MetaDataField>',context!);
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,
'Description': Description,
'DocumentUpload': DocumentUpload,
'MetaData': JsonConverters.toJson(MetaData,'List<MetaDataField>',context!),
'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: 'digiofficeapigateway.deltares.nl', types: <String, TypeInfo> {
'MetaDataField': TypeInfo(TypeOf.Class, create:() => MetaDataField()),
'UploadFile': TypeInfo(TypeOf.Class, create:() => UploadFile()),
'List<MetaDataField>': TypeInfo(TypeOf.Class, create:() => <MetaDataField>[]),
'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: digiofficeapigateway.deltares.nl
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"RegistrationProfileID":"00000000-0000-0000-0000-000000000000","NavigationPath":"String","FileName":"String","Description":"String","DocumentUpload":false,"MetaData":[{"ID":"00000000-0000-0000-0000-000000000000","DocumentVeldID":"00000000-0000-0000-0000-000000000000","Name":"String","Label":"String","Datatype":"String","PrintLabel":"String","Entity":"String","PrintValue":"String","RegistrationValue":"String","SPSiteColumnName":"String","ShadowName":"String","ShadowDatatype":"String","ShadowSPSiteColumnName":"String","ShadowSPSiteColumnRegistrationValue":"String","ShadowRegistrationValue":"String","IsKeyField":false,"KopierenBijNieuweVersie":false}],"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":[{}]}