| GET | /aggregatedStock/{brand}/{posCode} | Get aggregated stock |
|---|
import 'package:servicestack/servicestack.dart';
class ClusterStockItem implements IConvertible
{
/**
* Article Code
*/
// @ApiMember(Description="Article Code", IsRequired=true)
String? articleCode;
/**
* Asset Quantity
*/
// @ApiMember(Description="Asset Quantity", IsRequired=true)
int? assetQuantity;
/**
* Consignment Quantity
*/
// @ApiMember(Description="Consignment Quantity", IsRequired=true)
int? consignmentQuantity;
ClusterStockItem({this.articleCode,this.assetQuantity,this.consignmentQuantity});
ClusterStockItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
articleCode = json['articleCode'];
assetQuantity = json['assetQuantity'];
consignmentQuantity = json['consignmentQuantity'];
return this;
}
Map<String, dynamic> toJson() => {
'articleCode': articleCode,
'assetQuantity': assetQuantity,
'consignmentQuantity': consignmentQuantity
};
getTypeName() => "ClusterStockItem";
TypeContext? context = _ctx;
}
class ClusterStock implements IConvertible
{
/**
* Cluster code
*/
// @ApiMember(Description="Cluster code", IsRequired=true)
String? clusterCode;
/**
* Stock Items
*/
// @ApiMember(Description="Stock Items", IsRequired=true)
List<ClusterStockItem>? stockItems;
ClusterStock({this.clusterCode,this.stockItems});
ClusterStock.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
clusterCode = json['clusterCode'];
stockItems = JsonConverters.fromJson(json['stockItems'],'List<ClusterStockItem>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'clusterCode': clusterCode,
'stockItems': JsonConverters.toJson(stockItems,'List<ClusterStockItem>',context!)
};
getTypeName() => "ClusterStock";
TypeContext? context = _ctx;
}
class AggregatedStockResponse extends ClusterStock implements IConvertible
{
AggregatedStockResponse();
AggregatedStockResponse.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() => "AggregatedStockResponse";
TypeContext? context = _ctx;
}
class GetAggregatedStock implements IConvertible
{
/**
* Brand
*/
// @ApiMember(Description="Brand", IsRequired=true)
String? brand;
/**
* Authorized POS Code e.g. ES100:102048
*/
// @ApiMember(Description="Authorized POS Code e.g. ES100:102048", IsRequired=true)
String? posCode;
/**
* Article Codes
*/
// @ApiMember(Description="Article Codes")
List<String>? articleCodes;
GetAggregatedStock({this.brand,this.posCode,this.articleCodes});
GetAggregatedStock.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
brand = json['brand'];
posCode = json['posCode'];
articleCodes = JsonConverters.fromJson(json['articleCodes'],'List<String>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'brand': brand,
'posCode': posCode,
'articleCodes': JsonConverters.toJson(articleCodes,'List<String>',context!)
};
getTypeName() => "GetAggregatedStock";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev_api_booster.richemont.com', types: <String, TypeInfo> {
'ClusterStockItem': TypeInfo(TypeOf.Class, create:() => ClusterStockItem()),
'ClusterStock': TypeInfo(TypeOf.Class, create:() => ClusterStock()),
'List<ClusterStockItem>': TypeInfo(TypeOf.Class, create:() => <ClusterStockItem>[]),
'AggregatedStockResponse': TypeInfo(TypeOf.Class, create:() => AggregatedStockResponse()),
'GetAggregatedStock': TypeInfo(TypeOf.Class, create:() => GetAggregatedStock()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /aggregatedStock/{brand}/{posCode} HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"clusterCode":"String","stockItems":[{"articleCode":"String","assetQuantity":0,"consignmentQuantity":0}]}