-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathAPI.gd.ejs
54 lines (50 loc) · 2.11 KB
/
API.gd.ejs
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
extends Node
# -------------------------------------------------------------------- enum(s)
# ------------------------------------------------------------------- const(s)
# --------------------------------------------------------------------- var(s)
# ------------------------------------------------------------------ signal(s)
# -------------------------------------------------------------- innerclass(s)
# -------------------------------------------------------------------- func(s)
<% if (hasClientOptions) { %>
static func IsClientLoggedIn():
return bool(PlayFabSettings._internalSettings.ClientSessionTicket)
<% } %>
<% for(var i in api.calls) { var apiCall=api.calls[i]; %>
static func <%- apiCall.name %>(dict_request, user_callback = null, dict_header_extra = {}):
<%- generateApiSummary(" ", apiCall, "summary", "https://docs.microsoft.com/rest/api/playfab/" + api.name.toLowerCase() + "/" + apiCall.subgroup.toLowerCase().replaceAll(" ","-") + "/" + apiCall.name.toLowerCase()) %>
<% if (apiCall.url === "/Authentication/GetEntityToken") { %>
var list_prologue_work = []
if PlayFabSettings._internalSettings.EntityToken:
list_prologue_work = [
PlayFab.E_PRO.CHK_ENTITY_TOKEN,
PlayFab.E_PRO.USE_AUTH_ENTITY_TOKEN
]
elif PlayFabSettings.DeveloperSecretKey:
list_prologue_work = [
PlayFab.E_PRO.CHK_SECRET_KEY,
PlayFab.E_PRO.USE_AUTH_SECRET_KEY
]
elif PlayFabSettings._internalSettings.ClientSessionTicket:
list_prologue_work = [
PlayFab.E_PRO.CHK_SESSION_TICKET,
PlayFab.E_PRO.USE_AUTH_AUTHORIZATION
]
return PlayFab._http_cli.request_append(
"<%- apiCall.url %>",
dict_request,
user_callback,
dict_header_extra,
list_prologue_work,
<%- getResultActions(apiCall, api) %>
)
<% } else { %>
return PlayFab._http_cli.request_append(
"<%- apiCall.url %>",
dict_request,
user_callback,
dict_header_extra,
<%- getRequestActions(apiCall) %>,
<%- getResultActions(apiCall, api) %>
)
<% } %>
<% } %>