#if !DISABLE_PLAYFABENTITY_API
using System;
using System.Collections.Generic;
using PlayFab.SharedModels;
namespace PlayFab.ExperimentationModels
{
public enum AnalysisTaskState
{
Waiting,
ReadyForSubmission,
SubmittingToPipeline,
Running,
Completed,
Failed,
Canceled
}
///
/// Given a title entity token and exclusion group details, will create a new exclusion group for the title.
///
[Serializable]
public class CreateExclusionGroupRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// Description of the exclusion group.
///
public string Description;
///
/// Friendly name of the exclusion group.
///
public string Name;
}
[Serializable]
public class CreateExclusionGroupResult : PlayFabResultCommon
{
///
/// Identifier of the exclusion group.
///
public string ExclusionGroupId;
}
///
/// Given a title entity token and experiment details, will create a new experiment for the title.
///
[Serializable]
public class CreateExperimentRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// Description of the experiment.
///
public string Description;
///
/// When experiment should end.
///
public DateTime? EndDate;
///
/// Id of the exclusion group.
///
public string ExclusionGroupId;
///
/// Percentage of exclusion group traffic that will see this experiment.
///
public uint? ExclusionGroupTrafficAllocation;
///
/// Type of experiment.
///
public ExperimentType? ExperimentType;
///
/// Friendly name of the experiment.
///
public string Name;
///
/// Id of the segment to which this experiment applies. Defaults to the 'All Players' segment.
///
public string SegmentId;
///
/// When experiment should start.
///
public DateTime StartDate;
///
/// List of title player account IDs that automatically receive treatments in the experiment, but are not included when
/// calculating experiment metrics.
///
public List TitlePlayerAccountTestIds;
///
/// List of variants for the experiment.
///
public List Variants;
}
[Serializable]
public class CreateExperimentResult : PlayFabResultCommon
{
///
/// The ID of the new experiment.
///
public string ExperimentId;
}
///
/// Given an entity token and an exclusion group ID this API deletes the exclusion group.
///
[Serializable]
public class DeleteExclusionGroupRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The ID of the exclusion group to delete.
///
public string ExclusionGroupId;
}
///
/// Given an entity token and an experiment ID this API deletes the experiment. A running experiment must be stopped before
/// it can be deleted.
///
[Serializable]
public class DeleteExperimentRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The ID of the experiment to delete.
///
public string ExperimentId;
}
[Serializable]
public class EmptyResponse : PlayFabResultCommon
{
}
///
/// Combined entity type and ID structure which uniquely identifies a single entity.
///
[Serializable]
public class EntityKey : PlayFabBaseModel
{
///
/// Unique ID of the entity.
///
public string Id;
///
/// Entity type. See https://docs.microsoft.com/gaming/playfab/features/data/entities/available-built-in-entity-types
///
public string Type;
}
[Serializable]
public class ExclusionGroupTrafficAllocation : PlayFabBaseModel
{
///
/// Id of the experiment.
///
public string ExperimentId;
///
/// Percentage of exclusion group traffic that will see this experiment.
///
public uint TrafficAllocation;
}
[Serializable]
public class Experiment : PlayFabBaseModel
{
///
/// Description of the experiment.
///
public string Description;
///
/// When experiment should end/was ended.
///
public DateTime? EndDate;
///
/// Id of the exclusion group for this experiment.
///
public string ExclusionGroupId;
///
/// Percentage of exclusion group traffic that will see this experiment.
///
public uint? ExclusionGroupTrafficAllocation;
///
/// Type of experiment.
///
public ExperimentType? ExperimentType;
///
/// Id of the experiment.
///
public string Id;
///
/// Friendly name of the experiment.
///
public string Name;
///
/// Id of the segment to which this experiment applies. Defaults to the 'All Players' segment.
///
public string SegmentId;
///
/// When experiment should start/was started.
///
public DateTime StartDate;
///
/// State experiment is currently in.
///
public ExperimentState? State;
///
/// List of title player account IDs that automatically receive treatments in the experiment, but are not included when
/// calculating experiment metrics.
///
public List TitlePlayerAccountTestIds;
///
/// List of variants for the experiment.
///
public List Variants;
}
[Serializable]
public class ExperimentExclusionGroup : PlayFabBaseModel
{
///
/// Description of the exclusion group.
///
public string Description;
///
/// Id of the exclusion group.
///
public string ExclusionGroupId;
///
/// Friendly name of the exclusion group.
///
public string Name;
}
public enum ExperimentState
{
New,
Started,
Stopped,
Deleted
}
public enum ExperimentType
{
Active,
Snapshot
}
///
/// Given a title entity token will return the list of all exclusion groups for a title.
///
[Serializable]
public class GetExclusionGroupsRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
}
[Serializable]
public class GetExclusionGroupsResult : PlayFabResultCommon
{
///
/// List of exclusion groups for the title.
///
public List ExclusionGroups;
}
///
/// Given a title entity token and an exclusion group ID, will return the list of traffic allocations for the exclusion
/// group.
///
[Serializable]
public class GetExclusionGroupTrafficRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The ID of the exclusion group.
///
public string ExclusionGroupId;
}
[Serializable]
public class GetExclusionGroupTrafficResult : PlayFabResultCommon
{
///
/// List of traffic allocations for the exclusion group.
///
public List TrafficAllocations;
}
///
/// Given a title entity token will return the list of all experiments for a title, including scheduled, started, stopped or
/// completed experiments.
///
[Serializable]
public class GetExperimentsRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
}
[Serializable]
public class GetExperimentsResult : PlayFabResultCommon
{
///
/// List of experiments for the title.
///
public List Experiments;
}
///
/// Given a title entity token and experiment details, will return the latest available scorecard.
///
[Serializable]
public class GetLatestScorecardRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The ID of the experiment.
///
public string ExperimentId;
}
[Serializable]
public class GetLatestScorecardResult : PlayFabResultCommon
{
///
/// Scorecard for the experiment of the title.
///
public Scorecard Scorecard;
}
///
/// Given a title player or a title entity token, returns the treatment variants and variables assigned to the entity across
/// all running experiments
///
[Serializable]
public class GetTreatmentAssignmentRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The optional entity to perform this action on. Defaults to the currently logged in entity.
///
public EntityKey Entity;
}
[Serializable]
public class GetTreatmentAssignmentResult : PlayFabResultCommon
{
///
/// Treatment assignment for the entity.
///
public TreatmentAssignment TreatmentAssignment;
}
[Serializable]
public class MetricData : PlayFabBaseModel
{
///
/// The upper bound of the confidence interval for the relative delta (Delta.RelativeValue).
///
public double ConfidenceIntervalEnd;
///
/// The lower bound of the confidence interval for the relative delta (Delta.RelativeValue).
///
public double ConfidenceIntervalStart;
///
/// The absolute delta between TreatmentStats.Average and ControlStats.Average.
///
public float DeltaAbsoluteChange;
///
/// The relative delta ratio between TreatmentStats.Average and ControlStats.Average.
///
public float DeltaRelativeChange;
///
/// The machine name of the metric.
///
public string InternalName;
///
/// Indicates if a movement was detected on that metric.
///
public string Movement;
///
/// The readable name of the metric.
///
public string Name;
///
/// The expectation that a movement is real
///
public float PMove;
///
/// The p-value resulting from the statistical test run for this metric
///
public float PValue;
///
/// The threshold for observing sample ratio mismatch.
///
public float PValueThreshold;
///
/// Indicates if the movement is statistically significant.
///
public string StatSigLevel;
///
/// Observed standard deviation value of the metric.
///
public float StdDev;
///
/// Observed average value of the metric.
///
public float Value;
}
[Serializable]
public class Scorecard : PlayFabBaseModel
{
///
/// Represents the date the scorecard was generated.
///
public string DateGenerated;
///
/// Represents the duration of scorecard analysis.
///
public string Duration;
///
/// Represents the number of events processed for the generation of this scorecard
///
public double EventsProcessed;
///
/// Id of the experiment.
///
public string ExperimentId;
///
/// Friendly name of the experiment.
///
public string ExperimentName;
///
/// Represents the latest compute job status.
///
public AnalysisTaskState? LatestJobStatus;
///
/// Represents the presence of a sample ratio mismatch in the scorecard data.
///
public bool SampleRatioMismatch;
///
/// Scorecard containing list of analysis.
///
public List ScorecardDataRows;
}
[Serializable]
public class ScorecardDataRow : PlayFabBaseModel
{
///
/// Represents whether the variant is control or not.
///
public bool IsControl;
///
/// Data of the analysis with the internal name of the metric as the key and an object of metric data as value.
///
public Dictionary MetricDataRows;
///
/// Represents the player count in the variant.
///
public uint PlayerCount;
///
/// Name of the variant of analysis.
///
public string VariantName;
}
///
/// Given a title entity token and an experiment ID, this API starts the experiment.
///
[Serializable]
public class StartExperimentRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The ID of the experiment to start.
///
public string ExperimentId;
}
///
/// Given a title entity token and an experiment ID, this API stops the experiment if it is running.
///
[Serializable]
public class StopExperimentRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The ID of the experiment to stop.
///
public string ExperimentId;
}
[Serializable]
public class TreatmentAssignment : PlayFabBaseModel
{
///
/// List of the experiment variables.
///
public List Variables;
///
/// List of the experiment variants.
///
public List Variants;
}
///
/// Given an entity token and exclusion group details this API updates the exclusion group.
///
[Serializable]
public class UpdateExclusionGroupRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// Description of the exclusion group.
///
public string Description;
///
/// The ID of the exclusion group to update.
///
public string ExclusionGroupId;
///
/// Friendly name of the exclusion group.
///
public string Name;
}
///
/// Given a title entity token and experiment details, this API updates the experiment. If an experiment is already running,
/// only the description and duration properties can be updated.
///
[Serializable]
public class UpdateExperimentRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// Description of the experiment.
///
public string Description;
///
/// When experiment should end.
///
public DateTime? EndDate;
///
/// Id of the exclusion group.
///
public string ExclusionGroupId;
///
/// Percentage of exclusion group traffic that will see this experiment.
///
public uint? ExclusionGroupTrafficAllocation;
///
/// Type of experiment.
///
public ExperimentType? ExperimentType;
///
/// Id of the experiment.
///
public string Id;
///
/// Friendly name of the experiment.
///
public string Name;
///
/// Id of the segment to which this experiment applies. Defaults to the 'All Players' segment.
///
public string SegmentId;
///
/// When experiment should start.
///
public DateTime StartDate;
///
/// List of title player account IDs that automatically receive treatments in the experiment, but are not included when
/// calculating experiment metrics.
///
public List TitlePlayerAccountTestIds;
///
/// List of variants for the experiment.
///
public List Variants;
}
[Serializable]
public class Variable : PlayFabBaseModel
{
///
/// Name of the variable.
///
public string Name;
///
/// Value of the variable.
///
public string Value;
}
[Serializable]
public class Variant : PlayFabBaseModel
{
///
/// Description of the variant.
///
public string Description;
///
/// Id of the variant.
///
public string Id;
///
/// Specifies if variant is control for experiment.
///
public bool IsControl;
///
/// Name of the variant.
///
public string Name;
///
/// Id of the TitleDataOverride to use with this variant.
///
public string TitleDataOverrideLabel;
///
/// Percentage of target audience traffic that will see this variant.
///
public uint TrafficPercentage;
///
/// Variables returned by this variant.
///
public List Variables;
}
}
#endif