-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlayFabExperimentationApi.lua
132 lines (116 loc) · 11.9 KB
/
PlayFabExperimentationApi.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
-- PlayFab Experimentation API
-- This is the main file you should require in your game
-- All api calls are documented here: https://docs.microsoft.com/gaming/playfab/api-references/
-- Example code:
-- local PlayFabExperimentationApi = require("PlayFab/PlayFabExperimentationApi")
-- PlayFabExperimentationApi.<ExperimentationApiCall>(request, successCallbackFunc, errorCallbackFunc)
local IPlayFabHttps = require("PlayFab/IPlayFabHttps")
local PlayFabSettings = require("PlayFab/PlayFabSettings")
local PlayFabExperimentationApi = {
settings = PlayFabSettings.settings
}
-- Creates a new experiment exclusion group for a title.
-- API Method Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/createexclusiongroup
-- Request Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/createexclusiongroup#createexclusiongrouprequest
-- Response Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/createexclusiongroup#createexclusiongroupresult
function PlayFabExperimentationApi.CreateExclusionGroup(request, onSuccess, onError)
if (not PlayFabSettings.settings.titleId or not PlayFabSettings._internalSettings.entityToken) then error("Must call GetEntityToken first, to call this method") end
IPlayFabHttps.MakePlayFabApiCall("/Experimentation/CreateExclusionGroup", request, "X-EntityToken", PlayFabSettings._internalSettings.entityToken, onSuccess, onError)
end
-- Creates a new experiment for a title.
-- API Method Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/createexperiment
-- Request Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/createexperiment#createexperimentrequest
-- Response Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/createexperiment#createexperimentresult
function PlayFabExperimentationApi.CreateExperiment(request, onSuccess, onError)
if (not PlayFabSettings.settings.titleId or not PlayFabSettings._internalSettings.entityToken) then error("Must call GetEntityToken first, to call this method") end
IPlayFabHttps.MakePlayFabApiCall("/Experimentation/CreateExperiment", request, "X-EntityToken", PlayFabSettings._internalSettings.entityToken, onSuccess, onError)
end
-- Deletes an existing exclusion group for a title.
-- API Method Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/deleteexclusiongroup
-- Request Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/deleteexclusiongroup#deleteexclusiongrouprequest
-- Response Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/deleteexclusiongroup#emptyresponse
function PlayFabExperimentationApi.DeleteExclusionGroup(request, onSuccess, onError)
if (not PlayFabSettings.settings.titleId or not PlayFabSettings._internalSettings.entityToken) then error("Must call GetEntityToken first, to call this method") end
IPlayFabHttps.MakePlayFabApiCall("/Experimentation/DeleteExclusionGroup", request, "X-EntityToken", PlayFabSettings._internalSettings.entityToken, onSuccess, onError)
end
-- Deletes an existing experiment for a title.
-- API Method Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/deleteexperiment
-- Request Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/deleteexperiment#deleteexperimentrequest
-- Response Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/deleteexperiment#emptyresponse
function PlayFabExperimentationApi.DeleteExperiment(request, onSuccess, onError)
if (not PlayFabSettings.settings.titleId or not PlayFabSettings._internalSettings.entityToken) then error("Must call GetEntityToken first, to call this method") end
IPlayFabHttps.MakePlayFabApiCall("/Experimentation/DeleteExperiment", request, "X-EntityToken", PlayFabSettings._internalSettings.entityToken, onSuccess, onError)
end
-- Gets the details of all exclusion groups for a title.
-- API Method Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/getexclusiongroups
-- Request Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/getexclusiongroups#getexclusiongroupsrequest
-- Response Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/getexclusiongroups#getexclusiongroupsresult
function PlayFabExperimentationApi.GetExclusionGroups(request, onSuccess, onError)
if (not PlayFabSettings.settings.titleId or not PlayFabSettings._internalSettings.entityToken) then error("Must call GetEntityToken first, to call this method") end
IPlayFabHttps.MakePlayFabApiCall("/Experimentation/GetExclusionGroups", request, "X-EntityToken", PlayFabSettings._internalSettings.entityToken, onSuccess, onError)
end
-- Gets the details of all exclusion groups for a title.
-- API Method Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/getexclusiongrouptraffic
-- Request Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/getexclusiongrouptraffic#getexclusiongrouptrafficrequest
-- Response Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/getexclusiongrouptraffic#getexclusiongrouptrafficresult
function PlayFabExperimentationApi.GetExclusionGroupTraffic(request, onSuccess, onError)
if (not PlayFabSettings.settings.titleId or not PlayFabSettings._internalSettings.entityToken) then error("Must call GetEntityToken first, to call this method") end
IPlayFabHttps.MakePlayFabApiCall("/Experimentation/GetExclusionGroupTraffic", request, "X-EntityToken", PlayFabSettings._internalSettings.entityToken, onSuccess, onError)
end
-- Gets the details of all experiments for a title.
-- API Method Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/getexperiments
-- Request Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/getexperiments#getexperimentsrequest
-- Response Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/getexperiments#getexperimentsresult
function PlayFabExperimentationApi.GetExperiments(request, onSuccess, onError)
if (not PlayFabSettings.settings.titleId or not PlayFabSettings._internalSettings.entityToken) then error("Must call GetEntityToken first, to call this method") end
IPlayFabHttps.MakePlayFabApiCall("/Experimentation/GetExperiments", request, "X-EntityToken", PlayFabSettings._internalSettings.entityToken, onSuccess, onError)
end
-- Gets the latest scorecard of the experiment for the title.
-- API Method Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/getlatestscorecard
-- Request Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/getlatestscorecard#getlatestscorecardrequest
-- Response Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/getlatestscorecard#getlatestscorecardresult
function PlayFabExperimentationApi.GetLatestScorecard(request, onSuccess, onError)
if (not PlayFabSettings.settings.titleId or not PlayFabSettings._internalSettings.entityToken) then error("Must call GetEntityToken first, to call this method") end
IPlayFabHttps.MakePlayFabApiCall("/Experimentation/GetLatestScorecard", request, "X-EntityToken", PlayFabSettings._internalSettings.entityToken, onSuccess, onError)
end
-- Gets the treatment assignments for a player for every running experiment in the title.
-- API Method Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/gettreatmentassignment
-- Request Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/gettreatmentassignment#gettreatmentassignmentrequest
-- Response Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/gettreatmentassignment#gettreatmentassignmentresult
function PlayFabExperimentationApi.GetTreatmentAssignment(request, onSuccess, onError)
if (not PlayFabSettings.settings.titleId or not PlayFabSettings._internalSettings.entityToken) then error("Must call GetEntityToken first, to call this method") end
IPlayFabHttps.MakePlayFabApiCall("/Experimentation/GetTreatmentAssignment", request, "X-EntityToken", PlayFabSettings._internalSettings.entityToken, onSuccess, onError)
end
-- Starts an existing experiment for a title.
-- API Method Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/startexperiment
-- Request Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/startexperiment#startexperimentrequest
-- Response Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/startexperiment#emptyresponse
function PlayFabExperimentationApi.StartExperiment(request, onSuccess, onError)
if (not PlayFabSettings.settings.titleId or not PlayFabSettings._internalSettings.entityToken) then error("Must call GetEntityToken first, to call this method") end
IPlayFabHttps.MakePlayFabApiCall("/Experimentation/StartExperiment", request, "X-EntityToken", PlayFabSettings._internalSettings.entityToken, onSuccess, onError)
end
-- Stops an existing experiment for a title.
-- API Method Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/stopexperiment
-- Request Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/stopexperiment#stopexperimentrequest
-- Response Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/stopexperiment#emptyresponse
function PlayFabExperimentationApi.StopExperiment(request, onSuccess, onError)
if (not PlayFabSettings.settings.titleId or not PlayFabSettings._internalSettings.entityToken) then error("Must call GetEntityToken first, to call this method") end
IPlayFabHttps.MakePlayFabApiCall("/Experimentation/StopExperiment", request, "X-EntityToken", PlayFabSettings._internalSettings.entityToken, onSuccess, onError)
end
-- Updates an existing exclusion group for a title.
-- API Method Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/updateexclusiongroup
-- Request Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/updateexclusiongroup#updateexclusiongrouprequest
-- Response Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/updateexclusiongroup#emptyresponse
function PlayFabExperimentationApi.UpdateExclusionGroup(request, onSuccess, onError)
if (not PlayFabSettings.settings.titleId or not PlayFabSettings._internalSettings.entityToken) then error("Must call GetEntityToken first, to call this method") end
IPlayFabHttps.MakePlayFabApiCall("/Experimentation/UpdateExclusionGroup", request, "X-EntityToken", PlayFabSettings._internalSettings.entityToken, onSuccess, onError)
end
-- Updates an existing experiment for a title.
-- API Method Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/updateexperiment
-- Request Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/updateexperiment#updateexperimentrequest
-- Response Documentation: https://docs.microsoft.com/rest/api/playfab/experimentation/experimentation/updateexperiment#emptyresponse
function PlayFabExperimentationApi.UpdateExperiment(request, onSuccess, onError)
if (not PlayFabSettings.settings.titleId or not PlayFabSettings._internalSettings.entityToken) then error("Must call GetEntityToken first, to call this method") end
IPlayFabHttps.MakePlayFabApiCall("/Experimentation/UpdateExperiment", request, "X-EntityToken", PlayFabSettings._internalSettings.entityToken, onSuccess, onError)
end
return PlayFabExperimentationApi