| POST | /selfService/transferTicket/targetTicketTypes | Ticket types on the target event a buyer may exchange into, with per-option price difference and blocking reason |
|---|
import 'package:servicestack/servicestack.dart';
class SelfServiceTransferResultBase implements IConvertible
{
bool? ok;
int? statusCode;
String? code;
String? message;
SelfServiceTransferResultBase({this.ok,this.statusCode,this.code,this.message});
SelfServiceTransferResultBase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ok = json['ok'];
statusCode = json['statusCode'];
code = json['code'];
message = json['message'];
return this;
}
Map<String, dynamic> toJson() => {
'ok': ok,
'statusCode': statusCode,
'code': code,
'message': message
};
getTypeName() => "SelfServiceTransferResultBase";
TypeContext? context = _ctx;
}
class SelfServiceTargetTicketTypeOption implements IConvertible
{
int? ownerTicketTypeId;
int? seriesTicketTypeId;
String? name;
double? price;
String? direction;
double? priceDifference;
bool? nameMatchesSource;
bool? selectable;
String? blockedReason;
String? blockedMessage;
int? maxTickets;
int? ticketsSold;
int? ticketsLeft;
String? saleStatus;
DateTime? saleStartsUTC;
DateTime? saleEndsUTC;
SelfServiceTargetTicketTypeOption({this.ownerTicketTypeId,this.seriesTicketTypeId,this.name,this.price,this.direction,this.priceDifference,this.nameMatchesSource,this.selectable,this.blockedReason,this.blockedMessage,this.maxTickets,this.ticketsSold,this.ticketsLeft,this.saleStatus,this.saleStartsUTC,this.saleEndsUTC});
SelfServiceTargetTicketTypeOption.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ownerTicketTypeId = json['ownerTicketTypeId'];
seriesTicketTypeId = json['seriesTicketTypeId'];
name = json['name'];
price = JsonConverters.toDouble(json['price']);
direction = json['direction'];
priceDifference = JsonConverters.toDouble(json['priceDifference']);
nameMatchesSource = json['nameMatchesSource'];
selectable = json['selectable'];
blockedReason = json['blockedReason'];
blockedMessage = json['blockedMessage'];
maxTickets = json['maxTickets'];
ticketsSold = json['ticketsSold'];
ticketsLeft = json['ticketsLeft'];
saleStatus = json['saleStatus'];
saleStartsUTC = JsonConverters.fromJson(json['saleStartsUTC'],'DateTime',context!);
saleEndsUTC = JsonConverters.fromJson(json['saleEndsUTC'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ownerTicketTypeId': ownerTicketTypeId,
'seriesTicketTypeId': seriesTicketTypeId,
'name': name,
'price': price,
'direction': direction,
'priceDifference': priceDifference,
'nameMatchesSource': nameMatchesSource,
'selectable': selectable,
'blockedReason': blockedReason,
'blockedMessage': blockedMessage,
'maxTickets': maxTickets,
'ticketsSold': ticketsSold,
'ticketsLeft': ticketsLeft,
'saleStatus': saleStatus,
'saleStartsUTC': JsonConverters.toJson(saleStartsUTC,'DateTime',context!),
'saleEndsUTC': JsonConverters.toJson(saleEndsUTC,'DateTime',context!)
};
getTypeName() => "SelfServiceTargetTicketTypeOption";
TypeContext? context = _ctx;
}
class SelfServiceTransferTargetTicketTypesResult extends SelfServiceTransferResultBase implements IConvertible
{
double? sourceTicketPrice;
String? sourceTicketTypeName;
int? toEventId;
bool? targetIsSeated;
List<SelfServiceTargetTicketTypeOption>? options;
SelfServiceTransferTargetTicketTypesResult({this.sourceTicketPrice,this.sourceTicketTypeName,this.toEventId,this.targetIsSeated,this.options});
SelfServiceTransferTargetTicketTypesResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
sourceTicketPrice = JsonConverters.toDouble(json['sourceTicketPrice']);
sourceTicketTypeName = json['sourceTicketTypeName'];
toEventId = json['toEventId'];
targetIsSeated = json['targetIsSeated'];
options = JsonConverters.fromJson(json['options'],'List<SelfServiceTargetTicketTypeOption>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'sourceTicketPrice': sourceTicketPrice,
'sourceTicketTypeName': sourceTicketTypeName,
'toEventId': toEventId,
'targetIsSeated': targetIsSeated,
'options': JsonConverters.toJson(options,'List<SelfServiceTargetTicketTypeOption>',context!)
});
getTypeName() => "SelfServiceTransferTargetTicketTypesResult";
TypeContext? context = _ctx;
}
class SelfServiceTransferTargetTicketTypesRequest implements IConvertible
{
String? ticketTokenId;
String? buyerPhone;
int? toEventId;
int? sectionId;
SelfServiceTransferTargetTicketTypesRequest({this.ticketTokenId,this.buyerPhone,this.toEventId,this.sectionId});
SelfServiceTransferTargetTicketTypesRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ticketTokenId = json['ticketTokenId'];
buyerPhone = json['buyerPhone'];
toEventId = json['toEventId'];
sectionId = json['sectionId'];
return this;
}
Map<String, dynamic> toJson() => {
'ticketTokenId': ticketTokenId,
'buyerPhone': buyerPhone,
'toEventId': toEventId,
'sectionId': sectionId
};
getTypeName() => "SelfServiceTransferTargetTicketTypesRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
'SelfServiceTransferResultBase': TypeInfo(TypeOf.Class, create:() => SelfServiceTransferResultBase()),
'SelfServiceTargetTicketTypeOption': TypeInfo(TypeOf.Class, create:() => SelfServiceTargetTicketTypeOption()),
'SelfServiceTransferTargetTicketTypesResult': TypeInfo(TypeOf.Class, create:() => SelfServiceTransferTargetTicketTypesResult()),
'List<SelfServiceTargetTicketTypeOption>': TypeInfo(TypeOf.Class, create:() => <SelfServiceTargetTicketTypeOption>[]),
'SelfServiceTransferTargetTicketTypesRequest': TypeInfo(TypeOf.Class, create:() => SelfServiceTransferTargetTicketTypesRequest()),
});
Dart SelfServiceTransferTargetTicketTypesRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /selfService/transferTicket/targetTicketTypes HTTP/1.1
Host: stubbur-app.azurewebsites.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ticketTokenId: String,
buyerPhone: String,
toEventId: 0,
sectionId: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
sourceTicketPrice: 0,
sourceTicketTypeName: String,
toEventId: 0,
targetIsSeated: False,
options:
[
{
ownerTicketTypeId: 0,
seriesTicketTypeId: 0,
name: String,
price: 0,
direction: String,
priceDifference: 0,
nameMatchesSource: False,
selectable: False,
blockedReason: String,
blockedMessage: String,
maxTickets: 0,
ticketsSold: 0,
ticketsLeft: 0,
saleStatus: String,
saleStartsUTC: 0001-01-01,
saleEndsUTC: 0001-01-01
}
],
ok: False,
statusCode: 0,
code: String,
message: String
}