POST | /business-entities/{BeeNumber}/documents |
---|
import 'package:servicestack/servicestack.dart';
class HateoasLink implements IConvertible
{
String? rel;
String? href;
String? type;
HateoasLink({this.rel,this.href,this.type});
HateoasLink.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
rel = json['rel'];
href = json['href'];
type = json['type'];
return this;
}
Map<String, dynamic> toJson() => {
'rel': rel,
'href': href,
'type': type
};
getTypeName() => "HateoasLink";
TypeContext? context = _ctx;
}
class HateoasLinks extends ListBase<HateoasLink> implements IConvertible
{
final List<HateoasLink> l = [];
set length(int newLength) { l.length = newLength; }
int get length => l.length;
HateoasLink operator [](int index) => l[index];
void operator []=(int index, HateoasLink value) { l[index] = value; }
HateoasLinks();
HateoasLinks.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "HateoasLinks";
TypeContext? context = _ctx;
}
class CreateResponse implements ICreateResponse, IConvertible
{
ResponseStatus? responseStatus;
HateoasLinks? links;
CreateResponse({this.responseStatus,this.links});
CreateResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
links = JsonConverters.fromJson(json['links'],'HateoasLinks',context!);
return this;
}
Map<String, dynamic> toJson() => {
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!),
'links': JsonConverters.toJson(links,'HateoasLinks',context!)
};
getTypeName() => "CreateResponse";
TypeContext? context = _ctx;
}
class BusinessEntityDocumentCreateResponse extends CreateResponse implements IConvertible
{
int? beeDocumentGuid;
BusinessEntityDocumentCreateResponse({this.beeDocumentGuid});
BusinessEntityDocumentCreateResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
beeDocumentGuid = json['beeDocumentGuid'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'beeDocumentGuid': beeDocumentGuid
});
getTypeName() => "BusinessEntityDocumentCreateResponse";
TypeContext? context = _ctx;
}
class BusinessEntityDocumentCreate implements IPost, IConvertible
{
// @ApiMember(IsRequired=true)
double? beeNumber;
// @ApiMember(IsRequired=true)
String? documentCategoryId;
// @ApiMember(IsRequired=true)
String? documentName;
String? userName;
// @ApiMember(IsRequired=true)
DateTime? createdDate;
// @apiMember()
String? documentDefinition;
// @apiMember()
bool? overwriteIfExists;
BusinessEntityDocumentCreate({this.beeNumber,this.documentCategoryId,this.documentName,this.userName,this.createdDate,this.documentDefinition,this.overwriteIfExists});
BusinessEntityDocumentCreate.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
beeNumber = JsonConverters.toDouble(json['beeNumber']);
documentCategoryId = json['documentCategoryId'];
documentName = json['documentName'];
userName = json['userName'];
createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
documentDefinition = json['documentDefinition'];
overwriteIfExists = json['overwriteIfExists'];
return this;
}
Map<String, dynamic> toJson() => {
'beeNumber': beeNumber,
'documentCategoryId': documentCategoryId,
'documentName': documentName,
'userName': userName,
'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!),
'documentDefinition': documentDefinition,
'overwriteIfExists': overwriteIfExists
};
getTypeName() => "BusinessEntityDocumentCreate";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'extensions.avon.ca', types: <String, TypeInfo> {
'HateoasLink': TypeInfo(TypeOf.Class, create:() => HateoasLink()),
'HateoasLinks': TypeInfo(TypeOf.Class, create:() => HateoasLinks()),
'CreateResponse': TypeInfo(TypeOf.Class, create:() => CreateResponse()),
'BusinessEntityDocumentCreateResponse': TypeInfo(TypeOf.Class, create:() => BusinessEntityDocumentCreateResponse()),
'BusinessEntityDocumentCreate': TypeInfo(TypeOf.Class, create:() => BusinessEntityDocumentCreate()),
});
Dart BusinessEntityDocumentCreate DTOs
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 /business-entities/{BeeNumber}/documents HTTP/1.1
Host: extensions.avon.ca
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<BusinessEntityDocumentCreate xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Nxnw.Adc.BusinessEntity.ServiceModel">
<BeeNumber>0</BeeNumber>
<CreatedDate>0001-01-01T00:00:00</CreatedDate>
<DocumentCategoryId>String</DocumentCategoryId>
<DocumentDefinition>String</DocumentDefinition>
<DocumentName>String</DocumentName>
<OverwriteIfExists>false</OverwriteIfExists>
<UserName>String</UserName>
</BusinessEntityDocumentCreate>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <BusinessEntityDocumentCreateResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Nxnw.Adc.BusinessEntity.ServiceModel"> <Links xmlns="http://schemas.datacontract.org/2004/07/Nxnw.Adc.Common.ServiceModel"> <HateoasLink> <Href>String</Href> <Rel>String</Rel> <Type>String</Type> </HateoasLink> </Links> <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types" xmlns="http://schemas.datacontract.org/2004/07/Nxnw.Adc.Common.ServiceModel"> <d2p1:ErrorCode>String</d2p1:ErrorCode> <d2p1:Message>String</d2p1:Message> <d2p1:StackTrace>String</d2p1:StackTrace> <d2p1:Errors> <d2p1:ResponseError> <d2p1:ErrorCode>String</d2p1:ErrorCode> <d2p1:FieldName>String</d2p1:FieldName> <d2p1:Message>String</d2p1:Message> <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:KeyValueOfstringstring> <d5p1:Key>String</d5p1:Key> <d5p1:Value>String</d5p1:Value> </d5p1:KeyValueOfstringstring> </d2p1:Meta> </d2p1:ResponseError> </d2p1:Errors> <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringstring> <d3p1:Key>String</d3p1:Key> <d3p1:Value>String</d3p1:Value> </d3p1:KeyValueOfstringstring> </d2p1:Meta> </ResponseStatus> <BeeDocumentGuid>0</BeeDocumentGuid> </BusinessEntityDocumentCreateResponse>