LootLocker Unreal SDK 11.1.0
Game backend SDK for Unreal Engine
Loading...
Searching...
No Matches
LootLockerSurveysRequestHandler.h
Go to the documentation of this file.
1// Copyright (c) 2021 LootLocker
2
3#pragma once
4
5
6#include "CoreMinimal.h"
7#include "JsonObjectWrapper.h"
11#include "LootLockerSurveysRequestHandler.generated.h"
12
13//==================================================
14// Data Type Definitions
15//==================================================
18
21USTRUCT(BlueprintType, Category = "LootLocker")
23{
24 GENERATED_BODY()
28 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
29 FString Id = "";
33 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
34 FString Survey_id = "";
38 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
39 FString Question_text = "";
43 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
44 FString Metadata_key = "";
48 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
49 FString Field_type = "";
54 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
55 FJsonObjectWrapper Params;
59 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
60 bool Required = false;
64 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
65 int32 Sort_order = 0;
69 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
70 FDateTime Created_at = FDateTime(0);
74 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
75 bool Sensitive = false;
76};
77
78
81
84USTRUCT(BlueprintType, Category = "LootLocker")
86{
87 GENERATED_BODY()
91 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
92 FString Id = "";
96 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
97 FString Name = "";
101 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
102 FDateTime Created_at = FDateTime(0);
107 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
108 bool Completed = false;
114 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
115 FDateTime Completed_at = FDateTime(0);
119 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
121};
122
123
124//==================================================
125// Request Definitions
126//==================================================
127
136USTRUCT(BlueprintType, Category = "LootLocker")
137struct LOOTLOCKERSDK_API FLootLockerSurveyAnswer
138{
139 GENERATED_BODY()
143 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
144 FString Metadata_key = "";
153 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
154 FString Value = "";
160 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
162
164 static LOOTLOCKERSDK_API FLootLockerSurveyAnswer FromText(const FString& MetadataKey, const FString& Value);
165
167 static LOOTLOCKERSDK_API FLootLockerSurveyAnswer FromNumber(const FString& MetadataKey, double Value);
168
170 static LOOTLOCKERSDK_API FLootLockerSurveyAnswer FromBool(const FString& MetadataKey, bool Value);
171
173 static LOOTLOCKERSDK_API FLootLockerSurveyAnswer FromMultiSelect(const FString& MetadataKey, const TArray<FString>& SelectedValues);
174};
175
176
177//==================================================
178// Response Definitions
179//==================================================
180
184USTRUCT(BlueprintType, Category = "LootLocker")
186{
187 GENERATED_BODY()
191 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
193};
194
198USTRUCT(BlueprintType, Category = "LootLocker")
200{
201 GENERATED_BODY()
205 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
206 FString Id = "";
210 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
211 FString Name = "";
215 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
216 FDateTime Created_at = FDateTime(0);
220 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
222};
223
227USTRUCT(BlueprintType, Category = "LootLocker")
229{
230 GENERATED_BODY()
235 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
236 bool Complete = false;
240 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
241 FDateTime Completed_at = FDateTime(0);
245 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
246 FString Survey_id = "";
247};
248
249//==================================================
250// Delegate Definitions
251//==================================================
254
266
267//==================================================
268// API Class Definition
269//==================================================
270
272UCLASS()
273class LOOTLOCKERSDK_API ULootLockerSurveysRequestHandler : public UObject
274{
275 GENERATED_BODY()
276public:
278
279 static FString ListSurveys(const FLootLockerPlayerData& PlayerData, const FLootLockerListSurveysResponseDelegate& OnComplete);
280 static FString GetSurvey(const FLootLockerPlayerData& PlayerData, const FString& SurveyId, const FLootLockerGetSurveyResponseDelegate& OnComplete);
281 static FString CompleteSurvey(const FLootLockerPlayerData& PlayerData, const FString& SurveyId, const FLootLockerCompleteSurveyResponseDelegate& OnComplete);
282
289 static FString SubmitSurveyAnswers(const FLootLockerPlayerData& PlayerData, const TArray<FLootLockerSurveyAnswer>& Answers, const FLootLockerSetMetadataResponseDelegate& OnComplete);
290};
static FString GetSurvey(const FLootLockerPlayerData &PlayerData, const FString &SurveyId, const FLootLockerGetSurveyResponseDelegate &OnComplete)
static FString CompleteSurvey(const FLootLockerPlayerData &PlayerData, const FString &SurveyId, const FLootLockerCompleteSurveyResponseDelegate &OnComplete)
static FString ListSurveys(const FLootLockerPlayerData &PlayerData, const FLootLockerListSurveysResponseDelegate &OnComplete)
ULootLockerSurveysRequestHandler()
Definition LootLockerSurveysRequestHandler.h:277
static FString SubmitSurveyAnswers(const FLootLockerPlayerData &PlayerData, const TArray< FLootLockerSurveyAnswer > &Answers, const FLootLockerSetMetadataResponseDelegate &OnComplete)
Submit answers to a survey for the current player.
ELootLockerMetadataTypes
Possible metadata types.
Definition LootLockerMetadataRequestHandler.h:45
void(* FLootLockerSetMetadataResponseDelegate)(FLootLockerSetMetadataResponse)
Blueprint response delegate for setting metadata.
Definition LootLockerMetadataRequestHandler.h:501
@ String
Definition LootLockerMetadataRequestHandler.h:46
void(* FLootLockerGetSurveyResponseDelegate)(FLootLockerGetSurveyResponse)
C++ response delegate for getting a single survey.
Definition LootLockerSurveysRequestHandler.h:261
void(* FLootLockerListSurveysResponseDelegate)(FLootLockerListSurveysResponse)
C++ response delegate for listing surveys.
Definition LootLockerSurveysRequestHandler.h:257
void(* FLootLockerCompleteSurveyResponseDelegate)(FLootLockerCompleteSurveyResponse)
C++ response delegate for completing a survey.
Definition LootLockerSurveysRequestHandler.h:265
Response returned after recording a survey completion for the current player.
Definition LootLockerSurveysRequestHandler.h:229
bool Complete
Whether the survey is now completed.
Definition LootLockerSurveysRequestHandler.h:236
FString Survey_id
The unique identifier of the completed survey.
Definition LootLockerSurveysRequestHandler.h:246
FDateTime Completed_at
When the survey was completed.
Definition LootLockerSurveysRequestHandler.h:241
Response containing a single survey and its questions.
Definition LootLockerSurveysRequestHandler.h:200
TArray< FLootLockerSurveyQuestion > Questions
The questions in this survey, ordered by sort_order.
Definition LootLockerSurveysRequestHandler.h:221
FString Id
The unique identifier of the survey.
Definition LootLockerSurveysRequestHandler.h:206
FDateTime Created_at
When the survey was created.
Definition LootLockerSurveysRequestHandler.h:216
FString Name
The name of the survey.
Definition LootLockerSurveysRequestHandler.h:211
Response containing the surveys the current player can see.
Definition LootLockerSurveysRequestHandler.h:186
TArray< FLootLockerSurvey > Surveys
The surveys visible to the current player, filtered by each survey's segments.
Definition LootLockerSurveysRequestHandler.h:192
Definition LootLockerPlayerData.h:12
Base response struct — every SDK callback receives a struct that derives from this.
Definition LootLockerResponse.h:19
A single answer to a survey question, submitted through SubmitSurveyAnswers.
Definition LootLockerSurveysRequestHandler.h:138
static FLootLockerSurveyAnswer FromBool(const FString &MetadataKey, bool Value)
Build a Bool answer, for checkbox questions.
FString Value
The answer value.
Definition LootLockerSurveysRequestHandler.h:154
static FLootLockerSurveyAnswer FromNumber(const FString &MetadataKey, double Value)
Build a Number answer, for number questions.
ELootLockerMetadataTypes Type
The metadata type of the value.
Definition LootLockerSurveysRequestHandler.h:161
FString Metadata_key
The metadata_key of the question this answers.
Definition LootLockerSurveysRequestHandler.h:144
static FLootLockerSurveyAnswer FromText(const FString &MetadataKey, const FString &Value)
Build a String answer, for short_text, long_text, date and select questions.
static FLootLockerSurveyAnswer FromMultiSelect(const FString &MetadataKey, const TArray< FString > &SelectedValues)
Build a Json answer, for multiselect questions.
A single question in a survey.
Definition LootLockerSurveysRequestHandler.h:23
FString Question_text
The text shown to the player for this question.
Definition LootLockerSurveysRequestHandler.h:39
bool Sensitive
When true, answers for this question's metadata_key are masked in game metadata reads.
Definition LootLockerSurveysRequestHandler.h:75
FString Field_type
The type of field to render for this question (for example short_text, long_text, select).
Definition LootLockerSurveysRequestHandler.h:49
FString Survey_id
The unique identifier of the survey this question belongs to.
Definition LootLockerSurveysRequestHandler.h:34
bool Required
Whether an answer to this question is required before the survey can be completed.
Definition LootLockerSurveysRequestHandler.h:60
FDateTime Created_at
When the question was created.
Definition LootLockerSurveysRequestHandler.h:70
FString Id
The unique identifier of the question.
Definition LootLockerSurveysRequestHandler.h:29
FJsonObjectWrapper Params
Opaque JSON parameters for the field type, for example the available options for a select field.
Definition LootLockerSurveysRequestHandler.h:55
FString Metadata_key
The player metadata key that the answer to this question is stored under.
Definition LootLockerSurveysRequestHandler.h:44
int32 Sort_order
The order in which this question should be presented, ascending.
Definition LootLockerSurveysRequestHandler.h:65
A survey that a player can see and complete.
Definition LootLockerSurveysRequestHandler.h:86
bool Completed
Whether the current player has already completed this survey.
Definition LootLockerSurveysRequestHandler.h:108
FString Name
The name of the survey.
Definition LootLockerSurveysRequestHandler.h:97
FDateTime Completed_at
When the current player completed this survey.
Definition LootLockerSurveysRequestHandler.h:115
FString Id
The unique identifier of the survey.
Definition LootLockerSurveysRequestHandler.h:92
FDateTime Created_at
When the survey was created.
Definition LootLockerSurveysRequestHandler.h:102
TArray< FLootLockerSurveyQuestion > Questions
The questions in this survey, ordered by sort_order.
Definition LootLockerSurveysRequestHandler.h:120