GET | /RestApi/ab-testing/{id} |
---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetABTest:
id: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class VariationViewModel:
id: Optional[str] = None
name: Optional[str] = None
distribution: int = 0
is_original: bool = False
ordinal: int = 0
page_data_id: Optional[str] = None
is_winner: bool = False
class GoalType(str, Enum):
NEXT_PAGE_VIEW = 'NextPageView'
FORM_SUBMISSION = 'FormSubmission'
DEC_CONVERSION = 'DecConversion'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GoalViewModel:
id: Optional[str] = None
goal_type: Optional[GoalType] = None
goal_name_resource_key: Optional[str] = None
predicate_operator: Optional[str] = None
object_id: Optional[str] = None
object_name: Optional[str] = None
object_culture: Optional[str] = None
is_primary: bool = False
ordinal: int = 0
class ABTestStatus(str, Enum):
NOT_STARTED = 'NotStarted'
SCHEDULED = 'Scheduled'
ACTIVE = 'Active'
STOPPED = 'Stopped'
ENDED = 'Ended'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ABTestViewModel:
id: Optional[str] = None
title: Optional[str] = None
description: Optional[str] = None
start_date: Optional[datetime.datetime] = None
stop_date: Optional[datetime.datetime] = None
page: Optional[str] = None
site_id: Optional[str] = None
culture: Optional[str] = None
variations: Optional[List[VariationViewModel]] = None
goals: Optional[List[GoalViewModel]] = None
report_url: Optional[str] = None
last_modified: datetime.datetime = datetime.datetime(1, 1, 1)
status: Optional[ABTestStatus] = None
owner: Optional[str] = None
winner_variation_id: Optional[str] = None
selected_variation_id: Optional[str] = None
page_node_error_message: Optional[str] = None
warning_message: Optional[str] = None
api_key: Optional[str] = None
user_segment_id: Optional[str] = None
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.
GET /RestApi/ab-testing/{id} HTTP/1.1 Host: www.asg.com.au Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Title: String, Description: String, StartDate: 0001-01-01, StopDate: 0001-01-01, Culture: String, ReportUrl: String, LastModified: 0001-01-01, 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 }