FBiHBetting.Aggregator.WebApi

<back to all web services

RegisterBettor

The following routes are available for this service:
POST/bettors/register
import 'package:servicestack/servicestack.dart';

class Reference implements IConvertible
{
    String? id;
    String? value;

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

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

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

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

class Address implements IConvertible
{
    String? street;
    Reference? city;
    String? postalCode;

    Address({this.street,this.city,this.postalCode});
    Address.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        street = json['street'];
        city = JsonConverters.fromJson(json['city'],'Reference',context!);
        postalCode = json['postalCode'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'street': street,
        'city': JsonConverters.toJson(city,'Reference',context!),
        'postalCode': postalCode
    };

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

class BettorType
{
    static const BettorType Internet = const BettorType._(0);
    static const BettorType SMS = const BettorType._(1);

    final int _value;
    const BettorType._(this._value);
    int get value => _value;
    static List<BettorType> get values => const [Internet,SMS];
}

class RegisterBettor implements IConvertible
{
    String? id;
    String? fullName;
    DateTime? dateOfBirth;
    String? jmbg;
    Address? bettorAddress;
    String? email;
    String? phoneNumber;
    String? username;
    String? bankTransactionAccountNumber;
    BettorType? bettorType;

    RegisterBettor({this.id,this.fullName,this.dateOfBirth,this.jmbg,this.bettorAddress,this.email,this.phoneNumber,this.username,this.bankTransactionAccountNumber,this.bettorType});
    RegisterBettor.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        fullName = json['fullName'];
        dateOfBirth = JsonConverters.fromJson(json['dateOfBirth'],'DateTime',context!);
        jmbg = json['jmbg'];
        bettorAddress = JsonConverters.fromJson(json['bettorAddress'],'Address',context!);
        email = json['email'];
        phoneNumber = json['phoneNumber'];
        username = json['username'];
        bankTransactionAccountNumber = json['bankTransactionAccountNumber'];
        bettorType = JsonConverters.fromJson(json['bettorType'],'BettorType',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'fullName': fullName,
        'dateOfBirth': JsonConverters.toJson(dateOfBirth,'DateTime',context!),
        'jmbg': jmbg,
        'bettorAddress': JsonConverters.toJson(bettorAddress,'Address',context!),
        'email': email,
        'phoneNumber': phoneNumber,
        'username': username,
        'bankTransactionAccountNumber': bankTransactionAccountNumber,
        'bettorType': JsonConverters.toJson(bettorType,'BettorType',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'fbihtaapi.bettor.webhop.biz', types: <String, TypeInfo> {
    'Reference': TypeInfo(TypeOf.Class, create:() => Reference()),
    'Address': TypeInfo(TypeOf.Class, create:() => Address()),
    'BettorType': TypeInfo(TypeOf.Enum, enumValues:BettorType.values),
    'RegisterBettor': TypeInfo(TypeOf.Class, create:() => RegisterBettor()),
});

Dart RegisterBettor 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 /bettors/register HTTP/1.1 
Host: fbihtaapi.bettor.webhop.biz 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	id: String,
	fullName: String,
	dateOfBirth: 0001-01-01,
	jmbg: String,
	bettorAddress: 
	{
		street: String,
		city: 
		{
			id: String,
			value: String
		},
		postalCode: String
	},
	email: String,
	phoneNumber: String,
	username: String,
	bankTransactionAccountNumber: String,
	bettorType: 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
	}
}