| POST | /cmd/organizations/register/integrations |
|---|
import 'package:servicestack/servicestack.dart';
class OrganizationNature
{
static const OrganizationNature FirstParty = const OrganizationNature._(1);
static const OrganizationNature Partner = const OrganizationNature._(2);
final int _value;
const OrganizationNature._(this._value);
int get value => _value;
static List<OrganizationNature> get values => const [FirstParty,Partner];
}
class IntegrationConnection implements IConvertible
{
String? url;
String? credentialsRef;
IntegrationConnection({this.url,this.credentialsRef});
IntegrationConnection.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
url = json['url'];
credentialsRef = json['credentialsRef'];
return this;
}
Map<String, dynamic> toJson() => {
'url': url,
'credentialsRef': credentialsRef
};
getTypeName() => "IntegrationConnection";
TypeContext? context = _ctx;
}
class IntegrationInstance implements IConvertible
{
String? id;
String? integrationId;
IntegrationConnection? wallet;
IntegrationConnection? partnerApi;
bool? slipForwardingEnabled;
IntegrationInstance({this.id,this.integrationId,this.wallet,this.partnerApi,this.slipForwardingEnabled});
IntegrationInstance.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
integrationId = json['integrationId'];
wallet = JsonConverters.fromJson(json['wallet'],'IntegrationConnection',context!);
partnerApi = JsonConverters.fromJson(json['partnerApi'],'IntegrationConnection',context!);
slipForwardingEnabled = json['slipForwardingEnabled'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'integrationId': integrationId,
'wallet': JsonConverters.toJson(wallet,'IntegrationConnection',context!),
'partnerApi': JsonConverters.toJson(partnerApi,'IntegrationConnection',context!),
'slipForwardingEnabled': slipForwardingEnabled
};
getTypeName() => "IntegrationInstance";
TypeContext? context = _ctx;
}
class OrganizationIntegrations implements IConvertible
{
IntegrationInstance? firstParty;
IntegrationInstance? partner;
OrganizationIntegrations({this.firstParty,this.partner});
OrganizationIntegrations.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
firstParty = JsonConverters.fromJson(json['firstParty'],'IntegrationInstance',context!);
partner = JsonConverters.fromJson(json['partner'],'IntegrationInstance',context!);
return this;
}
Map<String, dynamic> toJson() => {
'firstParty': JsonConverters.toJson(firstParty,'IntegrationInstance',context!),
'partner': JsonConverters.toJson(partner,'IntegrationInstance',context!)
};
getTypeName() => "OrganizationIntegrations";
TypeContext? context = _ctx;
}
class WalletPayoutMode
{
static const WalletPayoutMode RealTime = const WalletPayoutMode._(0);
static const WalletPayoutMode BatchPayout = const WalletPayoutMode._(1);
final int _value;
const WalletPayoutMode._(this._value);
int get value => _value;
static List<WalletPayoutMode> get values => const [RealTime,BatchPayout];
}
class PayoutPolicy implements IConvertible
{
WalletPayoutMode? selfService;
WalletPayoutMode? personal;
PayoutPolicy({this.selfService,this.personal});
PayoutPolicy.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
selfService = JsonConverters.fromJson(json['selfService'],'WalletPayoutMode',context!);
personal = JsonConverters.fromJson(json['personal'],'WalletPayoutMode',context!);
return this;
}
Map<String, dynamic> toJson() => {
'selfService': JsonConverters.toJson(selfService,'WalletPayoutMode',context!),
'personal': JsonConverters.toJson(personal,'WalletPayoutMode',context!)
};
getTypeName() => "PayoutPolicy";
TypeContext? context = _ctx;
}
class RegisterOrganizationIntegrations implements IConvertible
{
String? id;
OrganizationNature? nature;
OrganizationIntegrations? integrations;
PayoutPolicy? payoutPolicy;
RegisterOrganizationIntegrations({this.id,this.nature,this.integrations,this.payoutPolicy});
RegisterOrganizationIntegrations.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
nature = JsonConverters.fromJson(json['nature'],'OrganizationNature',context!);
integrations = JsonConverters.fromJson(json['integrations'],'OrganizationIntegrations',context!);
payoutPolicy = JsonConverters.fromJson(json['payoutPolicy'],'PayoutPolicy',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'nature': JsonConverters.toJson(nature,'OrganizationNature',context!),
'integrations': JsonConverters.toJson(integrations,'OrganizationIntegrations',context!),
'payoutPolicy': JsonConverters.toJson(payoutPolicy,'PayoutPolicy',context!)
};
getTypeName() => "RegisterOrganizationIntegrations";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.bettor.webhop.biz', types: <String, TypeInfo> {
'OrganizationNature': TypeInfo(TypeOf.Enum, enumValues:OrganizationNature.values),
'IntegrationConnection': TypeInfo(TypeOf.Class, create:() => IntegrationConnection()),
'IntegrationInstance': TypeInfo(TypeOf.Class, create:() => IntegrationInstance()),
'OrganizationIntegrations': TypeInfo(TypeOf.Class, create:() => OrganizationIntegrations()),
'WalletPayoutMode': TypeInfo(TypeOf.Enum, enumValues:WalletPayoutMode.values),
'PayoutPolicy': TypeInfo(TypeOf.Class, create:() => PayoutPolicy()),
'RegisterOrganizationIntegrations': TypeInfo(TypeOf.Class, create:() => RegisterOrganizationIntegrations()),
});
Dart RegisterOrganizationIntegrations DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /cmd/organizations/register/integrations HTTP/1.1
Host: api.bettor.webhop.biz
Accept: application/json
Content-Type: application/json
Content-Length: length
{"id":"String","nature":1,"integrations":{"firstParty":{"id":"String","integrationId":"String","wallet":{"url":"String","credentialsRef":"String"},"partnerApi":{"url":"String","credentialsRef":"String"},"slipForwardingEnabled":false},"partner":{"id":"String","integrationId":"String","wallet":{"url":"String","credentialsRef":"String"},"partnerApi":{"url":"String","credentialsRef":"String"},"slipForwardingEnabled":false}},"payoutPolicy":{"selfService":0,"personal":0}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}