| POST | /bets/cancel |
|---|
import 'package:servicestack/servicestack.dart';
class BetSource
{
static const BetSource Landbase = const BetSource._(0);
static const BetSource Web = const BetSource._(1);
final int _value;
const BetSource._(this._value);
int get value => _value;
static List<BetSource> get values => const [Landbase,Web];
}
class TransactionDtoBase implements IConvertible
{
String? transaction_id;
DateTime? transaction_time;
double? transaction_amount;
String? game_name;
String? betting_place_id;
String? betting_terminal_id;
String? jmbg;
String? passport_number;
BetSource? source;
String? identification_document_country;
String? identification_document_type;
TransactionDtoBase({this.transaction_id,this.transaction_time,this.transaction_amount,this.game_name,this.betting_place_id,this.betting_terminal_id,this.jmbg,this.passport_number,this.source,this.identification_document_country,this.identification_document_type});
TransactionDtoBase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
transaction_id = json['transaction_id'];
transaction_time = JsonConverters.fromJson(json['transaction_time'],'DateTime',context!);
transaction_amount = JsonConverters.toDouble(json['transaction_amount']);
game_name = json['game_name'];
betting_place_id = json['betting_place_id'];
betting_terminal_id = json['betting_terminal_id'];
jmbg = json['jmbg'];
passport_number = json['passport_number'];
source = JsonConverters.fromJson(json['source'],'BetSource',context!);
identification_document_country = json['identification_document_country'];
identification_document_type = json['identification_document_type'];
return this;
}
Map<String, dynamic> toJson() => {
'transaction_id': transaction_id,
'transaction_time': JsonConverters.toJson(transaction_time,'DateTime',context!),
'transaction_amount': transaction_amount,
'game_name': game_name,
'betting_place_id': betting_place_id,
'betting_terminal_id': betting_terminal_id,
'jmbg': jmbg,
'passport_number': passport_number,
'source': JsonConverters.toJson(source,'BetSource',context!),
'identification_document_country': identification_document_country,
'identification_document_type': identification_document_type
};
getTypeName() => "TransactionDtoBase";
TypeContext? context = _ctx;
}
class RollbackTransactionType
{
static const RollbackTransactionType Bet = const RollbackTransactionType._(0);
static const RollbackTransactionType Win = const RollbackTransactionType._(1);
static const RollbackTransactionType Jackpot = const RollbackTransactionType._(1);
final int _value;
const RollbackTransactionType._(this._value);
int get value => _value;
static List<RollbackTransactionType> get values => const [Bet,Win,Jackpot];
}
class RollbackDto extends TransactionDtoBase implements IConvertible
{
String? rollback_transaction_id;
String? ticket_id;
RollbackTransactionType? rollback_transaction_type;
RollbackDto({this.rollback_transaction_id,this.ticket_id,this.rollback_transaction_type});
RollbackDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
rollback_transaction_id = json['rollback_transaction_id'];
ticket_id = json['ticket_id'];
rollback_transaction_type = JsonConverters.fromJson(json['rollback_transaction_type'],'RollbackTransactionType',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'rollback_transaction_id': rollback_transaction_id,
'ticket_id': ticket_id,
'rollback_transaction_type': JsonConverters.toJson(rollback_transaction_type,'RollbackTransactionType',context!)
});
getTypeName() => "RollbackDto";
TypeContext? context = _ctx;
}
class ReportBetCancellations implements IConvertible
{
RecordList<RollbackDto>? betCancellations;
ReportBetCancellations({this.betCancellations});
ReportBetCancellations.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
betCancellations = JsonConverters.fromJson(json['betCancellations'],'RecordList<RollbackDto>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'betCancellations': JsonConverters.toJson(betCancellations,'RecordList<RollbackDto>',context!)
};
getTypeName() => "ReportBetCancellations";
TypeContext? context = _ctx;
}
class RecordList<T> extends ListBase<T> implements IConvertible
{
final List<T> l = [];
set length(int newLength) { l.length = newLength; }
int get length => l.length;
T operator [](int index) => l[index];
void operator []=(int index, T value) { l[index] = value; }
RecordList();
RecordList.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "RecordList<$T>";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.sbbet_prod_mnta.webhop.biz', types: <String, TypeInfo> {
'BetSource': TypeInfo(TypeOf.Enum, enumValues:BetSource.values),
'TransactionDtoBase': TypeInfo(TypeOf.Class, create:() => TransactionDtoBase()),
'RollbackTransactionType': TypeInfo(TypeOf.Enum, enumValues:RollbackTransactionType.values),
'RollbackDto': TypeInfo(TypeOf.Class, create:() => RollbackDto()),
'ReportBetCancellations': TypeInfo(TypeOf.Class, create:() => ReportBetCancellations()),
'RecordList<RollbackDto>': TypeInfo(TypeOf.Class, create:() => RecordList<RollbackDto>()),
'RecordList<T>': TypeInfo(TypeOf.GenericDef,create:() => RecordList()),
});
Dart ReportBetCancellations 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 /bets/cancel HTTP/1.1
Host: api.sbbet-prod-mnta.webhop.biz
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<ReportBetCancellations xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Starnet.MontenegroTaxationAuthority.WebApi.ServiceModel">
<BetCancellations xmlns:d2p1="http://schemas.datacontract.org/2004/07/Starnet.MontenegroTaxationAuthority.Common">
<d2p1:RollbackDto>
<d2p1:betting_place_id>String</d2p1:betting_place_id>
<d2p1:betting_terminal_id>String</d2p1:betting_terminal_id>
<d2p1:game_name>String</d2p1:game_name>
<d2p1:identification_document_country>String</d2p1:identification_document_country>
<d2p1:identification_document_type>String</d2p1:identification_document_type>
<d2p1:jmbg>String</d2p1:jmbg>
<d2p1:passport_number>String</d2p1:passport_number>
<d2p1:source>Landbase</d2p1:source>
<d2p1:transaction_amount>0</d2p1:transaction_amount>
<d2p1:transaction_id>String</d2p1:transaction_id>
<d2p1:transaction_time>0001-01-01T00:00:00</d2p1:transaction_time>
<d2p1:rollback_transaction_id>String</d2p1:rollback_transaction_id>
<d2p1:rollback_transaction_type>Bet</d2p1:rollback_transaction_type>
<d2p1:ticket_id>String</d2p1:ticket_id>
</d2p1:RollbackDto>
</BetCancellations>
</ReportBetCancellations>
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>