| GET | /stock/{brand} | Get stock |
|---|
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 Pos implements IConvertible
{
/**
* Name of the POS
*/
// @ApiMember(Description="Name of the POS", IsRequired=true)
String? name;
/**
* POS Code
*/
// @ApiMember(Description="POS Code", IsRequired=true)
String? posCode;
/**
* Pos Code To Be Displayed
*/
// @ApiMember(Description="Pos Code To Be Displayed", IsRequired=true)
String? posCodeToBeDisplayed;
/**
* Country of the POS
*/
// @ApiMember(Description="Country of the POS", IsRequired=true)
String? country;
/**
* City of the POS
*/
// @ApiMember(Description="City of the POS", IsRequired=true)
String? city;
/**
* Postal Code
*/
// @ApiMember(Description="Postal Code", IsRequired=true)
String? postalCode;
/**
* State
*/
// @ApiMember(Description="State", IsRequired=true)
String? state;
/**
* Street
*/
// @ApiMember(Description="Street", IsRequired=true)
String? street;
Pos({this.name,this.posCode,this.posCodeToBeDisplayed,this.country,this.city,this.postalCode,this.state,this.street});
Pos.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
name = json['name'];
posCode = json['posCode'];
posCodeToBeDisplayed = json['posCodeToBeDisplayed'];
country = json['country'];
city = json['city'];
postalCode = json['postalCode'];
state = json['state'];
street = json['street'];
return this;
}
Map<String, dynamic> toJson() => {
'name': name,
'posCode': posCode,
'posCodeToBeDisplayed': posCodeToBeDisplayed,
'country': country,
'city': city,
'postalCode': postalCode,
'state': state,
'street': street
};
getTypeName() => "Pos";
TypeContext? context = _ctx;
}
class UnitNetAmount implements IConvertible
{
/**
* Currency Iso Code
*/
// @ApiMember(Description="Currency Iso Code", IsRequired=true)
String? currencyIsoCode;
/**
* Value
*/
// @ApiMember(Description="Value", IsRequired=true)
double? value;
UnitNetAmount({this.currencyIsoCode,this.value});
UnitNetAmount.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
currencyIsoCode = json['currencyIsoCode'];
value = JsonConverters.toDouble(json['value']);
return this;
}
Map<String, dynamic> toJson() => {
'currencyIsoCode': currencyIsoCode,
'value': value
};
getTypeName() => "UnitNetAmount";
TypeContext? context = _ctx;
}
class StockPositionItem implements IConvertible
{
/**
* Quantity
*/
// @ApiMember(Description="Quantity", IsRequired=true)
int? quantity;
/**
* Serial Number
*/
// @ApiMember(Description="Serial Number")
String? serialNumber;
/**
* Stock Date
*/
// @ApiMember(Description="Stock Date", IsRequired=true)
String? stockDate;
/**
* Loaded On Date
*/
// @ApiMember(Description="Loaded On Date", IsRequired=true)
String? loadedOnDate;
/**
* Type e.g. consignment or standard
*/
// @ApiMember(Description="Type e.g. consignment or standard", IsRequired=true)
String? type;
/**
* Is Consignment Sellable
*/
// @ApiMember(Description="Is Consignment Sellable ", IsRequired=true)
bool? isConsignmentSellable;
/**
* Sell-In Price. Disclaimer: this data will be arriving empty/null due to DealerCost project still being in test phase.
*/
// @ApiMember(Description="Sell-In Price. Disclaimer: this data will be arriving empty/null due to DealerCost project still being in test phase.")
UnitNetAmount? unitNetAmount;
/**
* Retail Sales Price
*/
// @ApiMember(Description="Retail Sales Price")
UnitNetAmount? retailSalesPrice;
StockPositionItem({this.quantity,this.serialNumber,this.stockDate,this.loadedOnDate,this.type,this.isConsignmentSellable,this.unitNetAmount,this.retailSalesPrice});
StockPositionItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
quantity = json['quantity'];
serialNumber = json['serialNumber'];
stockDate = json['stockDate'];
loadedOnDate = json['loadedOnDate'];
type = json['type'];
isConsignmentSellable = json['isConsignmentSellable'];
unitNetAmount = JsonConverters.fromJson(json['unitNetAmount'],'UnitNetAmount',context!);
retailSalesPrice = JsonConverters.fromJson(json['retailSalesPrice'],'UnitNetAmount',context!);
return this;
}
Map<String, dynamic> toJson() => {
'quantity': quantity,
'serialNumber': serialNumber,
'stockDate': stockDate,
'loadedOnDate': loadedOnDate,
'type': type,
'isConsignmentSellable': isConsignmentSellable,
'unitNetAmount': JsonConverters.toJson(unitNetAmount,'UnitNetAmount',context!),
'retailSalesPrice': JsonConverters.toJson(retailSalesPrice,'UnitNetAmount',context!)
};
getTypeName() => "StockPositionItem";
TypeContext? context = _ctx;
}
class StockItem implements IConvertible
{
/**
* Article Code
*/
// @ApiMember(Description="Article Code", IsRequired=true)
String? articleCode;
/**
* Current Stock Quantity
*/
// @ApiMember(Description="Current Stock Quantity", IsRequired=true)
int? currentStockQuantity;
/**
* Serial Numbers
*/
// @ApiMember(Description="Serial Numbers")
List<String>? serialNumbers;
/**
* Stock Item in Details
*/
// @ApiMember(Description="Stock Item in Details", IsRequired=true)
List<StockPositionItem>? stockPositions;
StockItem({this.articleCode,this.currentStockQuantity,this.serialNumbers,this.stockPositions});
StockItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
articleCode = json['articleCode'];
currentStockQuantity = json['currentStockQuantity'];
serialNumbers = JsonConverters.fromJson(json['serialNumbers'],'List<String>',context!);
stockPositions = JsonConverters.fromJson(json['stockPositions'],'List<StockPositionItem>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'articleCode': articleCode,
'currentStockQuantity': currentStockQuantity,
'serialNumbers': JsonConverters.toJson(serialNumbers,'List<String>',context!),
'stockPositions': JsonConverters.toJson(stockPositions,'List<StockPositionItem>',context!)
};
getTypeName() => "StockItem";
TypeContext? context = _ctx;
}
class PosStockItem implements IConvertible
{
/**
* Brand
*/
// @ApiMember(Description="Brand", IsRequired=true)
String? brand;
/**
* Pos Code
*/
// @ApiMember(Description="Pos Code", IsRequired=true)
String? posCode;
/**
* Shared Stock Location
*/
// @ApiMember(Description="Shared Stock Location", IsRequired=true)
Pos? sharedStockLocation;
/**
* Stock Items
*/
// @ApiMember(Description="Stock Items")
List<StockItem>? stockItems;
PosStockItem({this.brand,this.posCode,this.sharedStockLocation,this.stockItems});
PosStockItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
brand = json['brand'];
posCode = json['posCode'];
sharedStockLocation = JsonConverters.fromJson(json['sharedStockLocation'],'Pos',context!);
stockItems = JsonConverters.fromJson(json['stockItems'],'List<StockItem>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'brand': brand,
'posCode': posCode,
'sharedStockLocation': JsonConverters.toJson(sharedStockLocation,'Pos',context!),
'stockItems': JsonConverters.toJson(stockItems,'List<StockItem>',context!)
};
getTypeName() => "PosStockItem";
TypeContext? context = _ctx;
}
class GetStockResponse extends ListBase<PosStockItem> implements IConvertible
{
final List<PosStockItem> l = [];
set length(int newLength) { l.length = newLength; }
int get length => l.length;
PosStockItem operator [](int index) => l[index];
void operator []=(int index, PosStockItem value) { l[index] = value; }
GetStockResponse();
GetStockResponse.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "GetStockResponse";
TypeContext? context = _ctx;
}
class GetStock extends StockRequest implements IConvertible
{
GetStock();
GetStock.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() => "GetStock";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev_api_booster.richemont.com', types: <String, TypeInfo> {
'StockRequest': TypeInfo(TypeOf.Class, create:() => StockRequest()),
'Pos': TypeInfo(TypeOf.Class, create:() => Pos()),
'UnitNetAmount': TypeInfo(TypeOf.Class, create:() => UnitNetAmount()),
'StockPositionItem': TypeInfo(TypeOf.Class, create:() => StockPositionItem()),
'StockItem': TypeInfo(TypeOf.Class, create:() => StockItem()),
'List<StockPositionItem>': TypeInfo(TypeOf.Class, create:() => <StockPositionItem>[]),
'PosStockItem': TypeInfo(TypeOf.Class, create:() => PosStockItem()),
'List<StockItem>': TypeInfo(TypeOf.Class, create:() => <StockItem>[]),
'GetStockResponse': TypeInfo(TypeOf.Class, create:() => GetStockResponse()),
'GetStock': TypeInfo(TypeOf.Class, create:() => GetStock()),
});
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 /stock/{brand} HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: application/json
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length []