Richemont.Booster2.PublicApi

<back to all web services

GetBuyInPaginated

Requires Authentication
The following routes are available for this service:
GET/buyin/{brand}Get list of buyinGet list of paginated buyin based on the search parameters submitted
import 'package:servicestack/servicestack.dart';

class BuyIn implements IConvertible
{
    /**
    * Brand Trigram, e.g. CAR, IWC; compulsory only if articleCode is not provided
    */
    // @ApiMember(Description="Brand Trigram, e.g. CAR, IWC; compulsory only if articleCode is not provided", IsRequired=true)
    String brand = "";

    /**
    * Code of BuyIn
    */
    // @ApiMember(Description="Code of BuyIn", IsRequired=true)
    int buyInOrderId = 0;

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

    /**
    * Richemont Reference Code of the item
    */
    // @ApiMember(Description="Richemont Reference Code of the item", IsRequired=true)
    String articleCode = "";

    /**
    * Serial Number of the item
    */
    // @ApiMember(Description="Serial Number of the item")
    String serialNumber = "";

    /**
    * Buy-in order status code
    */
    // @ApiMember(Description="Buy-in order status code")
    String buyInStatusId = "";

    /**
    * Buy-in creation date
    */
    // @ApiMember(Description="Buy-in creation date")
    DateTime? buyInDate;

    /**
    * Emails of Sale Representatives
    */
    // @ApiMember(Description="Emails of Sale Representatives")
    List<String> saleRepresentativeEmails = [];

    /**
    * True is the buy-in’s piece is in stock, False otherwise
    */
    // @ApiMember(Description="True is the buy-in’s piece is in stock, False otherwise")
    bool? isInStock;

    BuyIn({this.brand="",this.buyInOrderId=0,this.posCode="",this.articleCode="",this.serialNumber="",this.buyInStatusId="",this.buyInDate,this.saleRepresentativeEmails=const [],this.isInStock});
    BuyIn.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        brand = json['brand'] ?? "";
        buyInOrderId = json['buyInOrderId'] ?? 0;
        posCode = json['posCode'] ?? "";
        articleCode = json['articleCode'] ?? "";
        serialNumber = json['serialNumber'] ?? "";
        buyInStatusId = json['buyInStatusId'] ?? "";
        buyInDate = JsonConverters.fromJson(json['buyInDate'],'DateTime',context!) ?? DateTime(0);
        saleRepresentativeEmails = JsonConverters.fromJson(json['saleRepresentativeEmails'],'List<String>',context!) ?? [];
        isInStock = json['isInStock'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'brand': brand,
        'buyInOrderId': buyInOrderId,
        'posCode': posCode,
        'articleCode': articleCode,
        'serialNumber': serialNumber,
        'buyInStatusId': buyInStatusId,
        'buyInDate': JsonConverters.toJson(buyInDate,'DateTime',context!),
        'saleRepresentativeEmails': JsonConverters.toJson(saleRepresentativeEmails,'List<String>',context!),
        'isInStock': isInStock
    };

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

class GetBuyInPaginatedResponse implements IConvertible
{
    /**
    * Index of the result set returnedr
    */
    // @ApiMember(Description="Index of the result set returnedr", IsRequired=true)
    int page = 0;

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

    /**
    * Total amount of pages / result sets
    */
    // @ApiMember(Description="Total amount of pages / result sets", IsRequired=true)
    int totalPages = 0;

    /**
    * Total amount of results
    */
    // @ApiMember(Description="Total amount of results", IsRequired=true)
    int totalResults = 0;

    /**
    * List of Sale Details
    */
    // @ApiMember(Description="List of Sale Details", IsRequired=true)
    List<BuyIn>? elements;

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

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

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

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

class GetBuyInPaginated implements IConvertible
{
    /**
    * Richemont Brand ID
    */
    // @ApiMember(Description="Richemont Brand ID")
    String brand = "";

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

    /**
    * Richemont Reference Code of the item
    */
    // @ApiMember(Description="Richemont Reference Code of the item")
    String articleCode = "";

    /**
    * Serial Number of the item
    */
    // @ApiMember(Description="Serial Number of the item")
    String serialNumber = "";

    /**
    * Buy-in order status code
    */
    // @ApiMember(Description="Buy-in order status code")
    String buyInStatusId = "";

    /**
    * True is the buy-in’s piece is in stock, False otherwise
    */
    // @ApiMember(Description="True is the buy-in’s piece is in stock, False otherwise")
    bool? isInStock;

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

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

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

    /**
    * Sort Expression, Possible values: 'SaleDetailIdDESC', 'DocumentDate'.
    */
    // @ApiMember(Description="Sort Expression, Possible values: 'SaleDetailIdDESC', 'DocumentDate'.")
    String sortBy = "";

    GetBuyInPaginated({this.brand="",this.posCode="",this.articleCode="",this.serialNumber="",this.buyInStatusId="",this.isInStock,this.page=0,this.items=0,this.noCount,this.sortBy=""});
    GetBuyInPaginated.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        brand = json['brand'] ?? "";
        posCode = json['posCode'] ?? "";
        articleCode = json['articleCode'] ?? "";
        serialNumber = json['serialNumber'] ?? "";
        buyInStatusId = json['buyInStatusId'] ?? "";
        isInStock = json['isInStock'];
        page = json['page'] ?? 0;
        items = json['items'] ?? 0;
        noCount = json['noCount'];
        sortBy = json['sortBy'] ?? "";
        return this;
    }

    Map<String, dynamic> toJson() => {
        'brand': brand,
        'posCode': posCode,
        'articleCode': articleCode,
        'serialNumber': serialNumber,
        'buyInStatusId': buyInStatusId,
        'isInStock': isInStock,
        'page': page,
        'items': items,
        'noCount': noCount,
        'sortBy': sortBy
    };

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

TypeContext _ctx = TypeContext(library: 'dev_api_booster.richemont.com', types: <String, TypeInfo> {
    'BuyIn': TypeInfo(TypeOf.Class, create:() => BuyIn()),
    'GetBuyInPaginatedResponse': TypeInfo(TypeOf.Class, create:() => GetBuyInPaginatedResponse()),
    'List<BuyIn>': TypeInfo(TypeOf.Class, create:() => <BuyIn>[]),
    'GetBuyInPaginated': TypeInfo(TypeOf.Class, create:() => GetBuyInPaginated()),
});

Dart GetBuyInPaginated DTOs

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

HTTP + OTHER

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

GET /buyin/{brand} HTTP/1.1 
Host: dev-api-booster.richemont.com 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"page":0,"items":0,"totalPages":0,"totalResults":0}