Richemont.Booster2.PublicApi

<back to all web services

GetStockPaginated

Requires Authentication
The following routes are available for this service:
GET/stock/{brand}/{posCode}Get Paginated Stock
import 'package:servicestack/servicestack.dart';

class RetailSalesPrice implements IConvertible
{
    /**
    * Currency Iso Code
    */
    // @ApiMember(Description="Currency Iso Code", IsRequired=true)
    String? currencyIsoCode;

    /**
    * Value
    */
    // @ApiMember(Description="Value", IsRequired=true)
    double? value;

    RetailSalesPrice({this.currencyIsoCode,this.value});
    RetailSalesPrice.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() => "RetailSalesPrice";
    TypeContext? context = _ctx;
}

class PaginatedStockElement implements IConvertible
{
    /**
    * 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;

    /**
    * Article Code
    */
    // @ApiMember(Description="Article Code", IsRequired=true)
    String? articleCode;

    /**
    * Serial Number
    */
    // @ApiMember(Description="Serial Number")
    String? serialNumber;

    /**
    * Current Stock Quantity
    */
    // @ApiMember(Description="Current Stock Quantity", IsRequired=true)
    int? quantity;

    /**
    * 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;

    /**
    * Retail Sales Price
    */
    // @ApiMember(Description="Retail Sales Price", IsRequired=true)
    RetailSalesPrice? retailSalesPrice;

    PaginatedStockElement({this.posCode,this.posCodeToBeDisplayed,this.articleCode,this.serialNumber,this.quantity,this.type,this.isConsignmentSellable,this.retailSalesPrice});
    PaginatedStockElement.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        posCode = json['posCode'];
        posCodeToBeDisplayed = json['posCodeToBeDisplayed'];
        articleCode = json['articleCode'];
        serialNumber = json['serialNumber'];
        quantity = json['quantity'];
        type = json['type'];
        isConsignmentSellable = json['isConsignmentSellable'];
        retailSalesPrice = JsonConverters.fromJson(json['retailSalesPrice'],'RetailSalesPrice',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'posCode': posCode,
        'posCodeToBeDisplayed': posCodeToBeDisplayed,
        'articleCode': articleCode,
        'serialNumber': serialNumber,
        'quantity': quantity,
        'type': type,
        'isConsignmentSellable': isConsignmentSellable,
        'retailSalesPrice': JsonConverters.toJson(retailSalesPrice,'RetailSalesPrice',context!)
    };

    getTypeName() => "PaginatedStockElement";
    TypeContext? context = _ctx;
}

class GetStockPaginatedResponse implements IConvertible
{
    /**
    * Total Pages
    */
    // @ApiMember(Description="Total Pages", IsRequired=true)
    int? totalPages;

    /**
    * Total Results
    */
    // @ApiMember(Description="Total Results", IsRequired=true)
    int? totalResults;

    /**
    * Index of the result set returned
    */
    // @ApiMember(Description="Index of the result set returned", IsRequired=true)
    int? page;

    /**
    * Size of the result set returned
    */
    // @ApiMember(Description="Size of the result set returned", IsRequired=true)
    int? items;

    /**
    * List of movements
    */
    // @ApiMember(Description="List of movements", IsRequired=true)
    List<PaginatedStockElement>? elements;

    GetStockPaginatedResponse({this.totalPages,this.totalResults,this.page,this.items,this.elements});
    GetStockPaginatedResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        totalPages = json['totalPages'];
        totalResults = json['totalResults'];
        page = json['page'];
        items = json['items'];
        elements = JsonConverters.fromJson(json['elements'],'List<PaginatedStockElement>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'totalPages': totalPages,
        'totalResults': totalResults,
        'page': page,
        'items': items,
        'elements': JsonConverters.toJson(elements,'List<PaginatedStockElement>',context!)
    };

    getTypeName() => "GetStockPaginatedResponse";
    TypeContext? context = _ctx;
}

class GetStockPaginated implements IPagedRequest, IConvertible
{
    /**
    * Brand
    */
    // @ApiMember(Description="Brand", IsRequired=true)
    String? brand;

    /**
    * POS Legacy
    */
    // @ApiMember(Description="POS Legacy", IsRequired=true)
    String? posCode;

    /**
    * Search Key (Article or SerialNumber)
    */
    // @ApiMember(Description="Search Key (Article or SerialNumber)")
    String? searchKey;

    /**
    * Index of the result set returned
    */
    // @ApiMember(Description="Index of the result set returned")
    int? page;

    /**
    * Size of the result set returned
    */
    // @ApiMember(Description="Size of the result set returned")
    int? items;

    /**
    * Omit precise record count - save on performance
    */
    // @ApiMember(Description="Omit precise record count - save on performance")
    bool? noCount;

    /**
    * Sorting expression
    */
    // @ApiMember(Description="Sorting expression")
    String? sortBy;

    /**
    * Parameter - Include Chain POSes Stock 
    */
    // @ApiMember(Description="Parameter - Include Chain POSes Stock ")
    bool? includeChainPosesStock;

    /**
    * Include Retail Sales Price in the Output, by default: false
    */
    // @ApiMember(Description="Include Retail Sales Price in the Output, by default: false")
    bool? includeRSP;

    GetStockPaginated({this.brand,this.posCode,this.searchKey,this.page,this.items,this.noCount,this.sortBy,this.includeChainPosesStock,this.includeRSP});
    GetStockPaginated.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        brand = json['brand'];
        posCode = json['posCode'];
        searchKey = json['searchKey'];
        page = json['page'];
        items = json['items'];
        noCount = json['noCount'];
        sortBy = json['sortBy'];
        includeChainPosesStock = json['includeChainPosesStock'];
        includeRSP = json['includeRSP'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'brand': brand,
        'posCode': posCode,
        'searchKey': searchKey,
        'page': page,
        'items': items,
        'noCount': noCount,
        'sortBy': sortBy,
        'includeChainPosesStock': includeChainPosesStock,
        'includeRSP': includeRSP
    };

    getTypeName() => "GetStockPaginated";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'dev_api_booster.richemont.com', types: <String, TypeInfo> {
    'RetailSalesPrice': TypeInfo(TypeOf.Class, create:() => RetailSalesPrice()),
    'PaginatedStockElement': TypeInfo(TypeOf.Class, create:() => PaginatedStockElement()),
    'GetStockPaginatedResponse': TypeInfo(TypeOf.Class, create:() => GetStockPaginatedResponse()),
    'List<PaginatedStockElement>': TypeInfo(TypeOf.Class, create:() => <PaginatedStockElement>[]),
    'GetStockPaginated': TypeInfo(TypeOf.Class, create:() => GetStockPaginated()),
});

Dart GetStockPaginated DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /stock/{brand}/{posCode} HTTP/1.1 
Host: dev-api-booster.richemont.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GetStockPaginatedResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Stock.ServiceModel">
  <elements i:nil="true" />
  <items>0</items>
  <page>0</page>
  <totalPages>0</totalPages>
  <totalResults>0</totalResults>
</GetStockPaginatedResponse>