| POST | /stock/{brand}/export | Export Stock Data |
|---|
import 'package:servicestack/servicestack.dart';
class StockRequest implements IConvertible
{
/**
* Brand
*/
// @ApiMember(Description="Brand", IsRequired=true)
String? brand;
/**
* POS Legacy
*/
// @ApiMember(Description="POS Legacy")
List<String>? posCodes;
/**
* Article Codes
*/
// @ApiMember(Description="Article Codes")
List<String>? articleCodes;
/**
* Include Extra Info
*/
// @ApiMember(Description="Include Extra Info")
bool? includeExtraInfo;
/**
* Cluster Id
*/
// @ApiMember(Description="Cluster Id")
List<String>? clusterIds;
/**
* Include Consignment NotAuthorized POS
*/
// @ApiMember(Description="Include Consignment NotAuthorized POS")
bool? includeConsignmentNotAuthorizedPOS;
/**
* Include Retail Sales Price in the Output, by default: false
*/
// @ApiMember(Description="Include Retail Sales Price in the Output, by default: false")
bool? includeRSP;
/**
* In Stock Since date from
*/
// @ApiMember(Description="In Stock Since date from ")
DateTime? dateFrom;
/**
* In Stock Since date to
*/
// @ApiMember(Description="In Stock Since date to")
DateTime? dateTo;
/**
* Item type, 'standard' OR 'consigned'. By default, all are coming
*/
// @ApiMember(Description="Item type, 'standard' OR 'consigned'. By default, all are coming")
String? type;
StockRequest({this.brand,this.posCodes,this.articleCodes,this.includeExtraInfo,this.clusterIds,this.includeConsignmentNotAuthorizedPOS,this.includeRSP,this.dateFrom,this.dateTo,this.type});
StockRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
brand = json['brand'];
posCodes = JsonConverters.fromJson(json['posCodes'],'List<String>',context!);
articleCodes = JsonConverters.fromJson(json['articleCodes'],'List<String>',context!);
includeExtraInfo = json['includeExtraInfo'];
clusterIds = JsonConverters.fromJson(json['clusterIds'],'List<String>',context!);
includeConsignmentNotAuthorizedPOS = json['includeConsignmentNotAuthorizedPOS'];
includeRSP = json['includeRSP'];
dateFrom = JsonConverters.fromJson(json['dateFrom'],'DateTime',context!);
dateTo = JsonConverters.fromJson(json['dateTo'],'DateTime',context!);
type = json['type'];
return this;
}
Map<String, dynamic> toJson() => {
'brand': brand,
'posCodes': JsonConverters.toJson(posCodes,'List<String>',context!),
'articleCodes': JsonConverters.toJson(articleCodes,'List<String>',context!),
'includeExtraInfo': includeExtraInfo,
'clusterIds': JsonConverters.toJson(clusterIds,'List<String>',context!),
'includeConsignmentNotAuthorizedPOS': includeConsignmentNotAuthorizedPOS,
'includeRSP': includeRSP,
'dateFrom': JsonConverters.toJson(dateFrom,'DateTime',context!),
'dateTo': JsonConverters.toJson(dateTo,'DateTime',context!),
'type': type
};
getTypeName() => "StockRequest";
TypeContext? context = _ctx;
}
class ExportStockResponse implements IConvertible
{
/**
* Unique Identifier of the Export Request created
*/
// @ApiMember(Description="Unique Identifier of the Export Request created", IsRequired=true)
String? asyncTaskId;
ExportStockResponse({this.asyncTaskId});
ExportStockResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
asyncTaskId = json['asyncTaskId'];
return this;
}
Map<String, dynamic> toJson() => {
'asyncTaskId': asyncTaskId
};
getTypeName() => "ExportStockResponse";
TypeContext? context = _ctx;
}
class ProductCategory implements IConvertible
{
/**
* Brand Category ID
*/
// @ApiMember(Description="Brand Category ID")
String? brandCategoryId;
/**
* Grand Category ID
*/
// @ApiMember(Description="Grand Category ID", IsRequired=true)
String? grandCategoryId;
/**
* Master Category ID
*/
// @ApiMember(Description="Master Category ID")
String? masterCategoryId;
/**
* Category ID
*/
// @ApiMember(Description="Category ID")
String? categoryId;
/**
* Sub Category ID
*/
// @ApiMember(Description="Sub Category ID")
String? subCategoryId;
ProductCategory({this.brandCategoryId,this.grandCategoryId,this.masterCategoryId,this.categoryId,this.subCategoryId});
ProductCategory.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
brandCategoryId = json['brandCategoryId'];
grandCategoryId = json['grandCategoryId'];
masterCategoryId = json['masterCategoryId'];
categoryId = json['categoryId'];
subCategoryId = json['subCategoryId'];
return this;
}
Map<String, dynamic> toJson() => {
'brandCategoryId': brandCategoryId,
'grandCategoryId': grandCategoryId,
'masterCategoryId': masterCategoryId,
'categoryId': categoryId,
'subCategoryId': subCategoryId
};
getTypeName() => "ProductCategory";
TypeContext? context = _ctx;
}
class ExportStock extends StockRequest implements IConvertible
{
/**
* Product Categories
*/
// @ApiMember(Description="Product Categories")
List<ProductCategory>? productCategories;
/**
* Export Request ID of the API Consumers
*/
// @ApiMember(Description="Export Request ID of the API Consumers", IsRequired=true)
String? downloadRequestId;
ExportStock({this.productCategories,this.downloadRequestId});
ExportStock.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
productCategories = JsonConverters.fromJson(json['productCategories'],'List<ProductCategory>',context!);
downloadRequestId = json['downloadRequestId'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'productCategories': JsonConverters.toJson(productCategories,'List<ProductCategory>',context!),
'downloadRequestId': downloadRequestId
});
getTypeName() => "ExportStock";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev_api_booster.richemont.com', types: <String, TypeInfo> {
'StockRequest': TypeInfo(TypeOf.Class, create:() => StockRequest()),
'ExportStockResponse': TypeInfo(TypeOf.Class, create:() => ExportStockResponse()),
'ProductCategory': TypeInfo(TypeOf.Class, create:() => ProductCategory()),
'ExportStock': TypeInfo(TypeOf.Class, create:() => ExportStock()),
'List<ProductCategory>': TypeInfo(TypeOf.Class, create:() => <ProductCategory>[]),
});
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 /stock/{brand}/export HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
productCategories:
[
{
brandCategoryId: String,
grandCategoryId: String,
masterCategoryId: String,
categoryId: String,
subCategoryId: String
}
],
downloadRequestId: String,
brand: String,
posCodes:
[
String
],
articleCodes:
[
String
],
includeExtraInfo: False,
clusterIds:
[
String
],
includeConsignmentNotAuthorizedPOS: False,
includeRSP: False,
dateFrom: 0001-01-01,
dateTo: 0001-01-01,
type: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
asyncTaskId: 00000000000000000000000000000000
}