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 .jsv suffix or ?format=jsv
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: text/jsv
Content-Type: text/jsv
Content-Length: length
{
beeNumber: 0,
documentCategoryId: String,
documentName: String,
userName: String,
createdDate: 0001-01-01T00:00:00,
documentDefinition: String,
overwriteIfExists: False
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { beeDocumentGuid: 0, responseStatus: { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } }, links: [ { rel: String, href: String, type: String } ] }