| All Verbs | /locations/byRound |
|---|
import 'package:servicestack/servicestack.dart';
class Order
{
static const Order None = const Order._(0);
static const Order Ascending = const Order._(1);
static const Order Descending = const Order._(2);
final int _value;
const Order._(this._value);
int get value => _value;
static List<Order> get values => const [None,Ascending,Descending];
}
class FindLocationRoundStats implements IConvertible
{
String? roundId;
String? search;
String? orderBy;
Order order;
int currentPage = 0;
int pageSize = 0;
FindLocationRoundStats({this.roundId,this.search,this.orderBy,this.order,this.currentPage,this.pageSize});
FindLocationRoundStats.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
roundId = json['roundId'];
search = json['search'];
orderBy = json['orderBy'];
order = JsonConverters.fromJson(json['order'],'Order',context!);
currentPage = json['currentPage'];
pageSize = json['pageSize'];
return this;
}
Map<String, dynamic> toJson() => {
'roundId': roundId,
'search': search,
'orderBy': orderBy,
'order': JsonConverters.toJson(order,'Order',context!),
'currentPage': currentPage,
'pageSize': pageSize
};
getTypeName() => "FindLocationRoundStats";
TypeContext? context = _ctx;
}
class RoundStatus
{
static const RoundStatus Pending = const RoundStatus._(0);
static const RoundStatus InProgress = const RoundStatus._(1);
static const RoundStatus Ended = const RoundStatus._(2);
final int _value;
const RoundStatus._(this._value);
int get value => _value;
static List<RoundStatus> get values => const [Pending,InProgress,Ended];
}
class RoundStats implements IConvertible
{
String? id;
DateTime createdAt = DateTime(0);
RoundStatus status;
int canceledCount = 0;
double canceledAmount = 0;
int betCount = 0;
double stakeAmount = 0;
double winningsAmount = 0;
double balanceAmount = 0;
double balancePct = 0;
RoundStats({this.id,this.createdAt,this.status,this.canceledCount,this.canceledAmount,this.betCount,this.stakeAmount,this.winningsAmount,this.balanceAmount,this.balancePct});
RoundStats.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
createdAt = JsonConverters.fromJson(json['createdAt'],'DateTime',context!);
status = JsonConverters.fromJson(json['status'],'RoundStatus',context!);
canceledCount = json['canceledCount'];
canceledAmount = JsonConverters.toDouble(json['canceledAmount']);
betCount = json['betCount'];
stakeAmount = JsonConverters.toDouble(json['stakeAmount']);
winningsAmount = JsonConverters.toDouble(json['winningsAmount']);
balanceAmount = JsonConverters.toDouble(json['balanceAmount']);
balancePct = JsonConverters.toDouble(json['balancePct']);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'createdAt': JsonConverters.toJson(createdAt,'DateTime',context!),
'status': JsonConverters.toJson(status,'RoundStatus',context!),
'canceledCount': canceledCount,
'canceledAmount': canceledAmount,
'betCount': betCount,
'stakeAmount': stakeAmount,
'winningsAmount': winningsAmount,
'balanceAmount': balanceAmount,
'balancePct': balancePct
};
getTypeName() => "RoundStats";
TypeContext? context = _ctx;
}
class PaginatedResult<T> implements IConvertible
{
List<RoundStats>? data;
int currentPage = 0;
int pageSize = 0;
int totalItems = 0;
int totalPages = 0;
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<RoundStats>',context!);
currentPage = json['currentPage'];
pageSize = json['pageSize'];
totalItems = json['totalItems'];
totalPages = json['totalPages'];
return this;
}
Map<String, dynamic> toJson() => {
'data': JsonConverters.toJson(data,'List<RoundStats>',context!),
'currentPage': currentPage,
'pageSize': pageSize,
'totalItems': totalItems,
'totalPages': totalPages
};
getTypeName() => "PaginatedResult<$T>";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'grh1.api.bettor.webhop.biz', types: <String, TypeInfo> {
'Order': TypeInfo(TypeOf.Enum, enumValues:Order.values),
'FindLocationRoundStats': TypeInfo(TypeOf.Class, create:() => FindLocationRoundStats()),
'RoundStatus': TypeInfo(TypeOf.Enum, enumValues:RoundStatus.values),
'RoundStats': TypeInfo(TypeOf.Class, create:() => RoundStats()),
'PaginatedResult<T>': TypeInfo(TypeOf.Class, create:() => PaginatedResult<T>()),
'List<RoundStats>': TypeInfo(TypeOf.Class, create:() => <RoundStats>[]),
});
Dart FindLocationRoundStats DTOs
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.
POST /locations/byRound HTTP/1.1
Host: grh1.api.bettor.webhop.biz
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<FindLocationRoundStats xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Greyhounds.WebApi.ServiceModel">
<CurrentPage>0</CurrentPage>
<Order>None</Order>
<OrderBy>String</OrderBy>
<PageSize>0</PageSize>
<RoundId>String</RoundId>
<Search>String</Search>
</FindLocationRoundStats>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<PaginatedResultOfLocationRoundStatsHTcU5Hwp xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Greyhounds.ReadModel">
<CurrentPage>0</CurrentPage>
<Data>
<LocationRoundStats>
<BetAmount>0</BetAmount>
<BetCount>0</BetCount>
<Location>String</Location>
<LocationId>String</LocationId>
<Pct>0</Pct>
<RoundId>String</RoundId>
</LocationRoundStats>
</Data>
<PageSize>0</PageSize>
<TotalItems>0</TotalItems>
<TotalPages>0</TotalPages>
</PaginatedResultOfLocationRoundStatsHTcU5Hwp>