PUT | /RestApi/ab-testing |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class ABTestViewModel
{
public UUID Id = null;
public String Title = null;
public String Description = null;
public Date StartDate = null;
public Date StopDate = null;
public UUID Page = null;
public UUID SiteId = null;
public String Culture = null;
public ArrayList<VariationViewModel> Variations = null;
public ArrayList<GoalViewModel> Goals = null;
public String ReportUrl = null;
public Date LastModified = null;
public ABTestStatus Status = null;
public String Owner = null;
public UUID WinnerVariationId = null;
public UUID SelectedVariationId = null;
public String PageNodeErrorMessage = null;
public String WarningMessage = null;
public String ApiKey = null;
public UUID UserSegmentId = null;
public UUID getId() { return Id; }
public ABTestViewModel setId(UUID value) { this.Id = value; return this; }
public String getTitle() { return Title; }
public ABTestViewModel setTitle(String value) { this.Title = value; return this; }
public String getDescription() { return Description; }
public ABTestViewModel setDescription(String value) { this.Description = value; return this; }
public Date getStartDate() { return StartDate; }
public ABTestViewModel setStartDate(Date value) { this.StartDate = value; return this; }
public Date getStopDate() { return StopDate; }
public ABTestViewModel setStopDate(Date value) { this.StopDate = value; return this; }
public UUID getPage() { return Page; }
public ABTestViewModel setPage(UUID value) { this.Page = value; return this; }
public UUID getSiteId() { return SiteId; }
public ABTestViewModel setSiteId(UUID value) { this.SiteId = value; return this; }
public String getCulture() { return Culture; }
public ABTestViewModel setCulture(String value) { this.Culture = value; return this; }
public ArrayList<VariationViewModel> getVariations() { return Variations; }
public ABTestViewModel setVariations(ArrayList<VariationViewModel> value) { this.Variations = value; return this; }
public ArrayList<GoalViewModel> getGoals() { return Goals; }
public ABTestViewModel setGoals(ArrayList<GoalViewModel> value) { this.Goals = value; return this; }
public String getReportUrl() { return ReportUrl; }
public ABTestViewModel setReportUrl(String value) { this.ReportUrl = value; return this; }
public Date getLastModified() { return LastModified; }
public ABTestViewModel setLastModified(Date value) { this.LastModified = value; return this; }
public ABTestStatus getStatus() { return Status; }
public ABTestViewModel setStatus(ABTestStatus value) { this.Status = value; return this; }
public String getOwner() { return Owner; }
public ABTestViewModel setOwner(String value) { this.Owner = value; return this; }
public UUID getWinnerVariationId() { return WinnerVariationId; }
public ABTestViewModel setWinnerVariationId(UUID value) { this.WinnerVariationId = value; return this; }
public UUID getSelectedVariationId() { return SelectedVariationId; }
public ABTestViewModel setSelectedVariationId(UUID value) { this.SelectedVariationId = value; return this; }
public String getPageNodeErrorMessage() { return PageNodeErrorMessage; }
public ABTestViewModel setPageNodeErrorMessage(String value) { this.PageNodeErrorMessage = value; return this; }
public String getWarningMessage() { return WarningMessage; }
public ABTestViewModel setWarningMessage(String value) { this.WarningMessage = value; return this; }
public String getApiKey() { return ApiKey; }
public ABTestViewModel setApiKey(String value) { this.ApiKey = value; return this; }
public UUID getUserSegmentId() { return UserSegmentId; }
public ABTestViewModel setUserSegmentId(UUID value) { this.UserSegmentId = value; return this; }
}
public static class VariationViewModel
{
public UUID Id = null;
public String Name = null;
public Integer Distribution = null;
public Boolean IsOriginal = null;
public Integer Ordinal = null;
public UUID PageDataId = null;
public Boolean IsWinner = null;
public UUID getId() { return Id; }
public VariationViewModel setId(UUID value) { this.Id = value; return this; }
public String getName() { return Name; }
public VariationViewModel setName(String value) { this.Name = value; return this; }
public Integer getDistribution() { return Distribution; }
public VariationViewModel setDistribution(Integer value) { this.Distribution = value; return this; }
public Boolean getIsOriginal() { return IsOriginal; }
public VariationViewModel setIsOriginal(Boolean value) { this.IsOriginal = value; return this; }
public Integer getOrdinal() { return Ordinal; }
public VariationViewModel setOrdinal(Integer value) { this.Ordinal = value; return this; }
public UUID getPageDataId() { return PageDataId; }
public VariationViewModel setPageDataId(UUID value) { this.PageDataId = value; return this; }
public Boolean getIsWinner() { return IsWinner; }
public VariationViewModel setIsWinner(Boolean value) { this.IsWinner = value; return this; }
}
public static class GoalViewModel
{
public UUID Id = null;
public GoalType GoalType = null;
public String GoalNameResourceKey = null;
public String PredicateOperator = null;
public String ObjectId = null;
public String ObjectName = null;
public String ObjectCulture = null;
public Boolean IsPrimary = null;
public Integer Ordinal = null;
public UUID getId() { return Id; }
public GoalViewModel setId(UUID value) { this.Id = value; return this; }
public GoalType getGoalType() { return GoalType; }
public GoalViewModel setGoalType(GoalType value) { this.GoalType = value; return this; }
public String getGoalNameResourceKey() { return GoalNameResourceKey; }
public GoalViewModel setGoalNameResourceKey(String value) { this.GoalNameResourceKey = value; return this; }
public String getPredicateOperator() { return PredicateOperator; }
public GoalViewModel setPredicateOperator(String value) { this.PredicateOperator = value; return this; }
public String getObjectId() { return ObjectId; }
public GoalViewModel setObjectId(String value) { this.ObjectId = value; return this; }
public String getObjectName() { return ObjectName; }
public GoalViewModel setObjectName(String value) { this.ObjectName = value; return this; }
public String getObjectCulture() { return ObjectCulture; }
public GoalViewModel setObjectCulture(String value) { this.ObjectCulture = value; return this; }
public Boolean getIsPrimary() { return IsPrimary; }
public GoalViewModel setIsPrimary(Boolean value) { this.IsPrimary = value; return this; }
public Integer getOrdinal() { return Ordinal; }
public GoalViewModel setOrdinal(Integer value) { this.Ordinal = value; return this; }
}
public static enum GoalType
{
NextPageView,
FormSubmission,
DecConversion;
}
public static enum ABTestStatus
{
NotStarted,
Scheduled,
Active,
Stopped,
Ended;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /RestApi/ab-testing HTTP/1.1
Host: www.asg.com.au
Accept: text/jsonl
Content-Type: text/jsonl
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"}
HTTP/1.1 200 OK Content-Type: text/jsonl 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"}