| GET | /eaccounting/articles |
|---|
import 'package:servicestack/servicestack.dart';
// @DataContract
abstract class QueryBase
{
// @DataMember(Order=1)
int? Skip;
// @DataMember(Order=2)
int? Take;
// @DataMember(Order=3)
String? OrderBy;
// @DataMember(Order=4)
String? OrderByDesc;
// @DataMember(Order=5)
String? Include;
// @DataMember(Order=6)
String? Fields;
// @DataMember(Order=7)
Map<String,String?>? Meta;
QueryBase({this.Skip,this.Take,this.OrderBy,this.OrderByDesc,this.Include,this.Fields,this.Meta});
QueryBase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Skip = json['Skip'];
Take = json['Take'];
OrderBy = json['OrderBy'];
OrderByDesc = json['OrderByDesc'];
Include = json['Include'];
Fields = json['Fields'];
Meta = JsonConverters.toStringMap(json['Meta']);
return this;
}
Map<String, dynamic> toJson() => {
'Skip': Skip,
'Take': Take,
'OrderBy': OrderBy,
'OrderByDesc': OrderByDesc,
'Include': Include,
'Fields': Fields,
'Meta': Meta
};
getTypeName() => "QueryBase";
TypeContext? context = _ctx;
}
abstract class QueryData<T> extends QueryBase
{
QueryData();
QueryData.fromJson(Map<String, dynamic> json) : super.fromJson(json);
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
return this;
}
Map<String, dynamic> toJson() => super.toJson();
getTypeName() => "QueryData<$T>";
TypeContext? context = _ctx;
}
class BaseArticleDto implements IConvertible
{
String ArticleId = "";
double ArticlePrice = 0;
String ArticleName = "";
DateTime CreatedDate = DateTime(0);
BaseArticleDto({this.ArticleId,this.ArticlePrice,this.ArticleName,this.CreatedDate});
BaseArticleDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ArticleId = json['ArticleId'];
ArticlePrice = JsonConverters.toDouble(json['ArticlePrice']);
ArticleName = json['ArticleName'];
CreatedDate = JsonConverters.fromJson(json['CreatedDate'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ArticleId': ArticleId,
'ArticlePrice': ArticlePrice,
'ArticleName': ArticleName,
'CreatedDate': JsonConverters.toJson(CreatedDate,'DateTime',context!)
};
getTypeName() => "BaseArticleDto";
TypeContext? context = _ctx;
}
class EAccountingArticleQueryResponse extends BaseArticleDto implements IConvertible
{
String UnitId = "";
String CodingId = "";
String VatRate = "";
String VatRatePercent = "";
String CurrencySign = "";
EAccountingArticleQueryResponse({this.UnitId,this.CodingId,this.VatRate,this.VatRatePercent,this.CurrencySign});
EAccountingArticleQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
UnitId = json['UnitId'];
CodingId = json['CodingId'];
VatRate = json['VatRate'];
VatRatePercent = json['VatRatePercent'];
CurrencySign = json['CurrencySign'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'UnitId': UnitId,
'CodingId': CodingId,
'VatRate': VatRate,
'VatRatePercent': VatRatePercent,
'CurrencySign': CurrencySign
});
getTypeName() => "EAccountingArticleQueryResponse";
TypeContext? context = _ctx;
}
class EAccountingArticleQuery extends QueryData<EAccountingArticleQueryResponse> implements ICompany, IConvertible
{
String? CompanyId;
EAccountingArticleQuery({this.CompanyId});
EAccountingArticleQuery.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
CompanyId = json['CompanyId'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'CompanyId': CompanyId
});
getTypeName() => "EAccountingArticleQuery";
TypeContext? context = _ctx;
}
class AccessKeyTypeResponse implements IConvertible
{
int Id = 0;
String KeyType = "";
String Description = "";
AccessKeyTypeResponse({this.Id,this.KeyType,this.Description});
AccessKeyTypeResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
KeyType = json['KeyType'];
Description = json['Description'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'KeyType': KeyType,
'Description': Description
};
getTypeName() => "AccessKeyTypeResponse";
TypeContext? context = _ctx;
}
// @DataContract
class QueryResponse<T> implements IConvertible
{
// @DataMember(Order=1)
int Offset = 0;
// @DataMember(Order=2)
int Total = 0;
// @DataMember(Order=3)
List<AccessKeyTypeResponse> Results = [];
// @DataMember(Order=4)
Map<String,String?>? Meta;
// @DataMember(Order=5)
ResponseStatus? ResponseStatus;
QueryResponse({this.Offset,this.Total,this.Results,this.Meta,this.ResponseStatus});
QueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Offset = json['Offset'];
Total = json['Total'];
Results = JsonConverters.fromJson(json['Results'],'List<AccessKeyTypeResponse>',context!);
Meta = JsonConverters.toStringMap(json['Meta']);
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Offset': Offset,
'Total': Total,
'Results': JsonConverters.toJson(Results,'List<AccessKeyTypeResponse>',context!),
'Meta': Meta,
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "QueryResponse<$T>";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.bookmore.com', types: <String, TypeInfo> {
'BaseArticleDto': TypeInfo(TypeOf.Class, create:() => BaseArticleDto()),
'EAccountingArticleQueryResponse': TypeInfo(TypeOf.Class, create:() => EAccountingArticleQueryResponse()),
'EAccountingArticleQuery': TypeInfo(TypeOf.Class, create:() => EAccountingArticleQuery()),
'List<EAccountingArticleQueryResponse>': TypeInfo(TypeOf.Class, create:() => <EAccountingArticleQueryResponse>[]),
'AccessKeyTypeResponse': TypeInfo(TypeOf.Class, create:() => AccessKeyTypeResponse()),
'List<AccessKeyTypeResponse>': TypeInfo(TypeOf.Class, create:() => <AccessKeyTypeResponse>[]),
});
Dart EAccountingArticleQuery 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.
GET /eaccounting/articles HTTP/1.1 Host: api.bookmore.com Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<QueryResponseOfEAccountingDtos.EAccountingArticleQueryResponseWg5EthtI xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
<Offset>0</Offset>
<Total>0</Total>
<Results xmlns:d2p1="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<d2p1:EAccountingDtos.EAccountingArticleQueryResponse>
<d2p1:ArticleId>00000000-0000-0000-0000-000000000000</d2p1:ArticleId>
<d2p1:ArticleName>String</d2p1:ArticleName>
<d2p1:ArticlePrice>0</d2p1:ArticlePrice>
<d2p1:CreatedDate>0001-01-01T00:00:00</d2p1:CreatedDate>
<d2p1:CodingId>String</d2p1:CodingId>
<d2p1:CurrencySign>String</d2p1:CurrencySign>
<d2p1:UnitId>String</d2p1:UnitId>
<d2p1:VatRate>String</d2p1:VatRate>
<d2p1:VatRatePercent>String</d2p1:VatRatePercent>
</d2p1:EAccountingDtos.EAccountingArticleQueryResponse>
</Results>
<Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:KeyValueOfstringstring>
<d2p1:Key>String</d2p1:Key>
<d2p1:Value>String</d2p1:Value>
</d2p1:KeyValueOfstringstring>
</Meta>
<ResponseStatus>
<ErrorCode>String</ErrorCode>
<Message>String</Message>
<StackTrace>String</StackTrace>
<Errors>
<ResponseError>
<ErrorCode>String</ErrorCode>
<FieldName>String</FieldName>
<Message>String</Message>
<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>
</Meta>
</ResponseError>
</Errors>
<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>
</Meta>
</ResponseStatus>
</QueryResponseOfEAccountingDtos.EAccountingArticleQueryResponseWg5EthtI>