| POST | /cmd/pool-transaction/request |
|---|
import 'package:servicestack/servicestack.dart';
class PoolRef implements IConvertible
{
int id = 0;
String? name;
PoolRef({this.id,this.name});
PoolRef.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() => "PoolRef";
TypeContext? context = _ctx;
}
class PoolTransaction implements IConvertible
{
PoolRef? source;
PoolRef? destination;
double amount = 0;
PoolTransaction({this.source,this.destination,this.amount});
PoolTransaction.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
source = JsonConverters.fromJson(json['source'],'PoolRef',context!);
destination = JsonConverters.fromJson(json['destination'],'PoolRef',context!);
amount = JsonConverters.toDouble(json['amount']);
return this;
}
Map<String, dynamic> toJson() => {
'source': JsonConverters.toJson(source,'PoolRef',context!),
'destination': JsonConverters.toJson(destination,'PoolRef',context!),
'amount': amount
};
getTypeName() => "PoolTransaction";
TypeContext? context = _ctx;
}
class RequestPoolTransaction implements IConvertible
{
String? id;
PoolTransaction? transaction;
RequestPoolTransaction({this.id,this.transaction});
RequestPoolTransaction.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
transaction = JsonConverters.fromJson(json['transaction'],'PoolTransaction',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'transaction': JsonConverters.toJson(transaction,'PoolTransaction',context!)
};
getTypeName() => "RequestPoolTransaction";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 's4w1.api.bettor.webhop.biz', types: <String, TypeInfo> {
'PoolRef': TypeInfo(TypeOf.Class, create:() => PoolRef()),
'PoolTransaction': TypeInfo(TypeOf.Class, create:() => PoolTransaction()),
'RequestPoolTransaction': TypeInfo(TypeOf.Class, create:() => RequestPoolTransaction()),
});
Dart RequestPoolTransaction 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 /cmd/pool-transaction/request HTTP/1.1
Host: s4w1.api.bettor.webhop.biz
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<RequestPoolTransaction xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Six4Win.WebApi.ServiceModel">
<Id>String</Id>
<Transaction xmlns:d2p1="http://schemas.datacontract.org/2004/07/Six4Win">
<d2p1:Amount>0</d2p1:Amount>
<d2p1:Destination>
<d2p1:Id>0</d2p1:Id>
<d2p1:Name>String</d2p1:Name>
</d2p1:Destination>
<d2p1:Source>
<d2p1:Id>0</d2p1:Id>
<d2p1:Name>String</d2p1:Name>
</d2p1:Source>
</Transaction>
</RequestPoolTransaction>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<ResponseStatus xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
<ErrorCode>String</ErrorCode>
<Message>String</Message>
<StackTrace>String</StackTrace>
<Errors>
<ResponseError>
<ErrorCode>String</ErrorCode>
<FieldName>String</FieldName>
<Message>String</Message>
<Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringstring>
<d4p1:Key>String</d4p1:Key>
<d4p1:Value>String</d4p1:Value>
</d4p1:KeyValueOfstringstring>
</Meta>
</ResponseError>
</Errors>
<Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:KeyValueOfstringstring>
<d2p1:Key>String</d2p1:Key>
<d2p1:Value>String</d2p1:Value>
</d2p1:KeyValueOfstringstring>
</Meta>
</ResponseStatus>