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 .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<UploadFile xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DMS.Operations">
<Description>String</Description>
<DocumentID>00000000-0000-0000-0000-000000000000</DocumentID>
<DocumentUpload>false</DocumentUpload>
<FileName>String</FileName>
<HoofdDocumentID>00000000-0000-0000-0000-000000000000</HoofdDocumentID>
<MetaData xmlns:d2p1="http://schemas.datacontract.org/2004/07/IDB.API.DMS">
<d2p1:MetaDataField>
<d2p1:Datatype>String</d2p1:Datatype>
<d2p1:DocumentVeldID>00000000-0000-0000-0000-000000000000</d2p1:DocumentVeldID>
<d2p1:Entity>String</d2p1:Entity>
<d2p1:ID>00000000-0000-0000-0000-000000000000</d2p1:ID>
<d2p1:IsKeyField>false</d2p1:IsKeyField>
<d2p1:KopierenBijNieuweVersie>false</d2p1:KopierenBijNieuweVersie>
<d2p1:Label>String</d2p1:Label>
<d2p1:Name>String</d2p1:Name>
<d2p1:PrintLabel>String</d2p1:PrintLabel>
<d2p1:PrintValue>String</d2p1:PrintValue>
<d2p1:RegistrationValue>String</d2p1:RegistrationValue>
<d2p1:SPSiteColumnName>String</d2p1:SPSiteColumnName>
<d2p1:ShadowDatatype>String</d2p1:ShadowDatatype>
<d2p1:ShadowName>String</d2p1:ShadowName>
<d2p1:ShadowRegistrationValue>String</d2p1:ShadowRegistrationValue>
<d2p1:ShadowSPSiteColumnName>String</d2p1:ShadowSPSiteColumnName>
<d2p1:ShadowSPSiteColumnRegistrationValue>String</d2p1:ShadowSPSiteColumnRegistrationValue>
</d2p1:MetaDataField>
</MetaData>
<NavigationPath>String</NavigationPath>
<RegistrationProfileID>00000000-0000-0000-0000-000000000000</RegistrationProfileID>
<SubDocumentIDs xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:guid>00000000-0000-0000-0000-000000000000</d2p1:guid>
</SubDocumentIDs>
</UploadFile>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <UploadFileResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DMS.Operations"> <DocumentId>00000000-0000-0000-0000-000000000000</DocumentId> <DocumentNr>String</DocumentNr> <DocumentUploadId>0</DocumentUploadId> <Messages xmlns:d2p1="http://schemas.datacontract.org/2004/07/IDB.Core.Diagnostics.Interfaces"> <d2p1:InformationMessageBase i:nil="true" /> </Messages> </UploadFileResponse>