| GET | /stock/{brand}/lookup | Get Serial Number and Article lookup from the database |
|---|
import 'package:servicestack/servicestack.dart';
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 GetStockLookupResponse implements IConvertible
{
/**
* Exists in Stock?
*/
// @ApiMember(Description="Exists in Stock?", IsRequired=true)
bool? existsInStock;
/**
* Stock Locations / POSes
*/
// @ApiMember(Description="Stock Locations / POSes", IsRequired=true)
Pos? stockLocation;
GetStockLookupResponse({this.existsInStock,this.stockLocation});
GetStockLookupResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
existsInStock = json['existsInStock'];
stockLocation = JsonConverters.fromJson(json['stockLocation'],'Pos',context!);
return this;
}
Map<String, dynamic> toJson() => {
'existsInStock': existsInStock,
'stockLocation': JsonConverters.toJson(stockLocation,'Pos',context!)
};
getTypeName() => "GetStockLookupResponse";
TypeContext? context = _ctx;
}
class GetStockLookup implements IConvertible
{
/**
* Brand
*/
// @ApiMember(Description="Brand", IsRequired=true)
String? brand;
/**
* Article Code
*/
// @ApiMember(Description="Article Code", IsRequired=true)
String? articleCode;
/**
* Serial Number
*/
// @ApiMember(Description="Serial Number", IsRequired=true)
String? serialNumber;
GetStockLookup({this.brand,this.articleCode,this.serialNumber});
GetStockLookup.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
brand = json['brand'];
articleCode = json['articleCode'];
serialNumber = json['serialNumber'];
return this;
}
Map<String, dynamic> toJson() => {
'brand': brand,
'articleCode': articleCode,
'serialNumber': serialNumber
};
getTypeName() => "GetStockLookup";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev_api_booster.richemont.com', types: <String, TypeInfo> {
'Pos': TypeInfo(TypeOf.Class, create:() => Pos()),
'GetStockLookupResponse': TypeInfo(TypeOf.Class, create:() => GetStockLookupResponse()),
'GetStockLookup': TypeInfo(TypeOf.Class, create:() => GetStockLookup()),
});
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 /stock/{brand}/lookup HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetStockLookupResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Stock.ServiceModel">
<existsInStock>false</existsInStock>
<stockLocation>
<city>String</city>
<country>String</country>
<name>String</name>
<posCode>String</posCode>
<posCodeToBeDisplayed>String</posCodeToBeDisplayed>
<postalCode>String</postalCode>
<state>String</state>
<street>String</street>
</stockLocation>
</GetStockLookupResponse>