FBiHBetting.Aggregator.WebApi

<back to all web services

FindProducts

The following routes are available for this service:
GET/products
import 'package:servicestack/servicestack.dart';

class FindProducts implements IConvertible
{
    String? id;
    String? qry;
    int? currentPage;
    int? pageSize;

    FindProducts({this.id,this.qry,this.currentPage,this.pageSize});
    FindProducts.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        qry = json['qry'];
        currentPage = json['currentPage'];
        pageSize = json['pageSize'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'qry': qry,
        'currentPage': currentPage,
        'pageSize': pageSize
    };

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

class ProductProvider implements IConvertible
{
    String? id;
    String? name;

    ProductProvider({this.id,this.name});
    ProductProvider.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        name = json['name'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name
    };

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

class PaginatedResult<T> implements IConvertible
{
    List<ProductProvider>? data;
    int? currentPage;
    int? pageSize;
    int? totalItems;
    int? totalPages;

    PaginatedResult({this.data,this.currentPage,this.pageSize,this.totalItems,this.totalPages});
    PaginatedResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        data = JsonConverters.fromJson(json['data'],'List<ProductProvider>',context!);
        currentPage = json['currentPage'];
        pageSize = json['pageSize'];
        totalItems = json['totalItems'];
        totalPages = json['totalPages'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'data': JsonConverters.toJson(data,'List<ProductProvider>',context!),
        'currentPage': currentPage,
        'pageSize': pageSize,
        'totalItems': totalItems,
        'totalPages': totalPages
    };

    getTypeName() => "PaginatedResult<$T>";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'fbihtaapi.bettor.webhop.biz', types: <String, TypeInfo> {
    'FindProducts': TypeInfo(TypeOf.Class, create:() => FindProducts()),
    'ProductProvider': TypeInfo(TypeOf.Class, create:() => ProductProvider()),
    'PaginatedResult<T>': TypeInfo(TypeOf.Class, create:() => PaginatedResult<T>()),
    'List<ProductProvider>': TypeInfo(TypeOf.Class, create:() => <ProductProvider>[]),
});

Dart FindProducts 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 /products HTTP/1.1 
Host: fbihtaapi.bettor.webhop.biz 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<PaginatedResultOfProductdnWDpBBx xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/FBiHBetting.Aggregator.ReadModel">
  <CurrentPage>0</CurrentPage>
  <Data>
    <Product>
      <Category>Sportsbook</Category>
      <Id>String</Id>
      <Name>String</Name>
      <ProductProvider>
        <Id>String</Id>
        <Value>String</Value>
      </ProductProvider>
    </Product>
  </Data>
  <PageSize>0</PageSize>
  <TotalItems>0</TotalItems>
  <TotalPages>0</TotalPages>
</PaginatedResultOfProductdnWDpBBx>