GET | /RestApi/ab-testing/{id} |
---|
import 'package:servicestack/servicestack.dart';
class GetABTest implements IConvertible
{
String? Id;
GetABTest({this.Id});
GetABTest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id
};
getTypeName() => "GetABTest";
TypeContext? context = _ctx;
}
class VariationViewModel implements IConvertible
{
String? Id;
String? Name;
int? Distribution;
bool? IsOriginal;
int? Ordinal;
String? PageDataId;
bool? IsWinner;
VariationViewModel({this.Id,this.Name,this.Distribution,this.IsOriginal,this.Ordinal,this.PageDataId,this.IsWinner});
VariationViewModel.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Name = json['Name'];
Distribution = json['Distribution'];
IsOriginal = json['IsOriginal'];
Ordinal = json['Ordinal'];
PageDataId = json['PageDataId'];
IsWinner = json['IsWinner'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Name': Name,
'Distribution': Distribution,
'IsOriginal': IsOriginal,
'Ordinal': Ordinal,
'PageDataId': PageDataId,
'IsWinner': IsWinner
};
getTypeName() => "VariationViewModel";
TypeContext? context = _ctx;
}
enum GoalType
{
NextPageView,
FormSubmission,
DecConversion,
}
class GoalViewModel implements IConvertible
{
String? Id;
GoalType? GoalType;
String? GoalNameResourceKey;
String? PredicateOperator;
String? ObjectId;
String? ObjectName;
String? ObjectCulture;
bool? IsPrimary;
int? Ordinal;
GoalViewModel({this.Id,this.GoalType,this.GoalNameResourceKey,this.PredicateOperator,this.ObjectId,this.ObjectName,this.ObjectCulture,this.IsPrimary,this.Ordinal});
GoalViewModel.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
GoalType = JsonConverters.fromJson(json['GoalType'],'GoalType',context!);
GoalNameResourceKey = json['GoalNameResourceKey'];
PredicateOperator = json['PredicateOperator'];
ObjectId = json['ObjectId'];
ObjectName = json['ObjectName'];
ObjectCulture = json['ObjectCulture'];
IsPrimary = json['IsPrimary'];
Ordinal = json['Ordinal'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'GoalType': JsonConverters.toJson(GoalType,'GoalType',context!),
'GoalNameResourceKey': GoalNameResourceKey,
'PredicateOperator': PredicateOperator,
'ObjectId': ObjectId,
'ObjectName': ObjectName,
'ObjectCulture': ObjectCulture,
'IsPrimary': IsPrimary,
'Ordinal': Ordinal
};
getTypeName() => "GoalViewModel";
TypeContext? context = _ctx;
}
enum ABTestStatus
{
NotStarted,
Scheduled,
Active,
Stopped,
Ended,
}
class ABTestViewModel implements IConvertible
{
String? Id;
String? Title;
String? Description;
DateTime? StartDate;
DateTime? StopDate;
String? Page;
String? SiteId;
String? Culture;
List<VariationViewModel>? Variations;
List<GoalViewModel>? Goals;
String? ReportUrl;
DateTime? LastModified;
ABTestStatus? Status;
String? Owner;
String? WinnerVariationId;
String? SelectedVariationId;
String? PageNodeErrorMessage;
String? WarningMessage;
String? ApiKey;
String? UserSegmentId;
ABTestViewModel({this.Id,this.Title,this.Description,this.StartDate,this.StopDate,this.Page,this.SiteId,this.Culture,this.Variations,this.Goals,this.ReportUrl,this.LastModified,this.Status,this.Owner,this.WinnerVariationId,this.SelectedVariationId,this.PageNodeErrorMessage,this.WarningMessage,this.ApiKey,this.UserSegmentId});
ABTestViewModel.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Title = json['Title'];
Description = json['Description'];
StartDate = JsonConverters.fromJson(json['StartDate'],'DateTime',context!);
StopDate = JsonConverters.fromJson(json['StopDate'],'DateTime',context!);
Page = json['Page'];
SiteId = json['SiteId'];
Culture = json['Culture'];
Variations = JsonConverters.fromJson(json['Variations'],'List<VariationViewModel>',context!);
Goals = JsonConverters.fromJson(json['Goals'],'List<GoalViewModel>',context!);
ReportUrl = json['ReportUrl'];
LastModified = JsonConverters.fromJson(json['LastModified'],'DateTime',context!);
Status = JsonConverters.fromJson(json['Status'],'ABTestStatus',context!);
Owner = json['Owner'];
WinnerVariationId = json['WinnerVariationId'];
SelectedVariationId = json['SelectedVariationId'];
PageNodeErrorMessage = json['PageNodeErrorMessage'];
WarningMessage = json['WarningMessage'];
ApiKey = json['ApiKey'];
UserSegmentId = json['UserSegmentId'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Title': Title,
'Description': Description,
'StartDate': JsonConverters.toJson(StartDate,'DateTime',context!),
'StopDate': JsonConverters.toJson(StopDate,'DateTime',context!),
'Page': Page,
'SiteId': SiteId,
'Culture': Culture,
'Variations': JsonConverters.toJson(Variations,'List<VariationViewModel>',context!),
'Goals': JsonConverters.toJson(Goals,'List<GoalViewModel>',context!),
'ReportUrl': ReportUrl,
'LastModified': JsonConverters.toJson(LastModified,'DateTime',context!),
'Status': JsonConverters.toJson(Status,'ABTestStatus',context!),
'Owner': Owner,
'WinnerVariationId': WinnerVariationId,
'SelectedVariationId': SelectedVariationId,
'PageNodeErrorMessage': PageNodeErrorMessage,
'WarningMessage': WarningMessage,
'ApiKey': ApiKey,
'UserSegmentId': UserSegmentId
};
getTypeName() => "ABTestViewModel";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'www.asg.com.au', types: <String, TypeInfo> {
'GetABTest': TypeInfo(TypeOf.Class, create:() => GetABTest()),
'VariationViewModel': TypeInfo(TypeOf.Class, create:() => VariationViewModel()),
'GoalType': TypeInfo(TypeOf.Enum, enumValues:GoalType.values),
'GoalViewModel': TypeInfo(TypeOf.Class, create:() => GoalViewModel()),
'ABTestStatus': TypeInfo(TypeOf.Enum, enumValues:ABTestStatus.values),
'ABTestViewModel': TypeInfo(TypeOf.Class, create:() => ABTestViewModel()),
'List<VariationViewModel>': TypeInfo(TypeOf.Class, create:() => <VariationViewModel>[]),
'List<GoalViewModel>': TypeInfo(TypeOf.Class, create:() => <GoalViewModel>[]),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /RestApi/ab-testing/{id} HTTP/1.1 Host: www.asg.com.au Accept: text/csv
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"Title":"String","Description":"String","StartDate":"\/Date(-62135596800000)\/","StopDate":"\/Date(-62135596800000)\/","Culture":"String","ReportUrl":"String","LastModified":"\/Date(-62135596800000-0000)\/","Status":"NotStarted","Owner":"String","WinnerVariationId":"00000000-0000-0000-0000-000000000000","SelectedVariationId":"00000000-0000-0000-0000-000000000000","PageNodeErrorMessage":"String","WarningMessage":"String","ApiKey":"String","UserSegmentId":"00000000-0000-0000-0000-000000000000"}