Six4Win.WebApi

<back to all web services

RequestPoolTransaction

Requires Authentication
The following routes are available for this service:
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: 's4w2.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 .jsv suffix or ?format=jsv

HTTP + JSV

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: s4w2.api.bettor.webhop.biz 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	id: String,
	transaction: 
	{
		source: 
		{
			id: 0,
			name: String
		},
		destination: 
		{
			id: 0,
			name: String
		},
		amount: 0
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	errorCode: String,
	message: String,
	stackTrace: String,
	errors: 
	[
		{
			errorCode: String,
			fieldName: String,
			message: String,
			meta: 
			{
				String: String
			}
		}
	],
	meta: 
	{
		String: String
	}
}