LootLocker Unreal Server SDK 6.5.0
Server-side backend SDK for Unreal Engine
Loading...
Searching...
No Matches
LootLockerServerMetadataRequest.h
Go to the documentation of this file.
1// Copyright (c) 2021 LootLocker
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Dom/JsonObject.h"
7#include "Dom/JsonValue.h"
9#include "LootLockerServerMetadataRequest.generated.h"
10
11//==================================================
12// Enum Definitions
13//==================================================
14
18UENUM(BlueprintType, Category = "LootLockerServer")
20{
21 reward = 0,
22 leaderboard = 1,
23 catalog_item = 2,
24 progression = 3,
25 currency = 4,
26 player = 5,
27 asset = 6,
28 item = 7, // This is the source for asset instances (player inventory items), while the "asset" source is for the asset in general
29};
30
34UENUM(BlueprintType, Category = "LootLockerServer")
36{
37 String = 0,
38 Number = 1,
39 Bool = 2,
40 Json = 3,
41 Base64 = 4,
42};
43
47UENUM(BlueprintType, Category = "LootLockerServer")
49{
50 Create = 0,
51 Update = 1,
52 Delete = 2,
53 Create_or_Update = 3, // Alias for Upsert (same thing)
54 Upsert = 4
55};
56
60UENUM(BlueprintType, Category = "LootLockerServer")
62{
63 OnString = 0 UMETA(ToolTip="Triggered when the parsed entry is of type String. The String Value field will be populated"),
64 OnInteger = 1 UMETA(ToolTip = "Triggered when the parsed entry is of type Integer (non decimal number). The Integer Value field will be populated"),
65 OnFloat = 2 UMETA(ToolTip = "Triggered when the parsed entry is of type Float (decimal number). The Float Value field will be populated"),
66 OnNumber = 3 UMETA(ToolTip = "Triggered when the parsed entry is a number but not a regular integer or float (could for example be too big to fit in either of those types, or the decimal precision is higher than can be solved with either of the types). The NumberString value field will be populated"),
67 OnBool = 4 UMETA(ToolTip = "Triggered when the parsed entry is of type Bool. The Bool Value field will be populated"),
68 OnJson = 5 UMETA(ToolTip = "Triggered when the parsed entry is of type Json. The JsonString Value field will be populated with the string representation of the json, convert to a JSON object or straight to a USTRUCT of your design"),
69 OnBase64 = 6 UMETA(ToolTip = "Triggered when the parsed entry is of type Base64. The Base64 Value field will be populated"),
70 OnError = 7 UMETA(ToolTip = "Triggered when the entry could not be parsed. The ErrorMessage Value field will be populated"),
71};
72
73
74//==================================================
75// Data Type Definitions
76//==================================================
77
81USTRUCT(BlueprintType, Category = "LootLockerServer")
83{
84 GENERATED_BODY()
88 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
89 FString Content_type;
93 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
94 FString Content;
95};
96
100USTRUCT(BlueprintType, Category = "LootLockerServer")
102{
103 GENERATED_BODY()
107 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
108 FString Key;
112 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
117 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
118 TArray<FString> Tags;
123 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
124 TArray<FString> Access;
125 /*
126 Get the value as a String. Returns true if value could be parsed in which case Output contains the string value untouched, returns false if parsing failed.
127 */
128 LOOTLOCKERSERVERSDK_API bool TryGetValueAsString(FString& Output) const;
129 /*
130 Get the value as a float. Returns true if value could be parsed in which case Output contains the float, returns false if parsing failed which can happen if the value is not numeric, the conversion under or overflows, or the string value precision is larger than can be dealt within a float.
131 */
132 LOOTLOCKERSERVERSDK_API bool TryGetValueAsFloat(float& Output) const;
133 /*
134 Get the value as an integer. TReturns true if value could be parsed in which case Output contains the int, returns false if parsing failed which can happen if
135 */
136 LOOTLOCKERSERVERSDK_API bool TryGetValueAsInteger(int& Output) const;
137 /*
138 Get the value as a boolean. Returns true if value could be parsed in which case Output contains the bool, returns false if parsing failed which can happen if the string is not a convertible to a boolean (those are for example "0", "1", "true", "False", "yes", "NO", etc).
139 */
140 LOOTLOCKERSERVERSDK_API bool TryGetValueAsBool(bool& Output) const;
141 /*
142 Get the value as an unparsed json value. Returns true if value could be found in which case Output contains the JsonValue, returns false if the value field was not present.
143 */
144 LOOTLOCKERSERVERSDK_API bool TryGetRawValue(TSharedPtr<FJsonValue>& Output) const;
145 /*
146 Get the value in a json string format. Returns true if the value was present and could be serialized, returns false otherwise
147 */
148 LOOTLOCKERSERVERSDK_API bool TryGetSerializedValue(FString& Output) const;
149 /*
150 Get the value as a Json Object. Returns true if value could be parsed in which case Output contains the Json Object, returns false if parsing failed which can happen if the value is not a valid json object string.
151 */
152 LOOTLOCKERSERVERSDK_API bool TryGetValueAsJsonObject(TSharedPtr<FJsonObject>& Output) const;
153 /*
154 Get the value as a Json Array. Returns true if value could be parsed in which case Output contains the Json Array, returns false if parsing failed which can happen if the value is not a valid json array string
155 */
156 LOOTLOCKERSERVERSDK_API bool TryGetValueAsJsonArray(TArray<TSharedPtr<FJsonValue>>& Output) const;
157 /*
158 Get the value as a LootLockerServerMetadataBase64Value object. Returns true if value could be parsed in which case Output contains the FLootLockerServerMetadataBase64Value, returns false if parsing failed.
159 */
160 LOOTLOCKERSERVERSDK_API bool TryGetValueAsBase64(FLootLockerServerMetadataBase64Value& Output) const;
161
162 /*
163 Set the value as a String.
164 */
165 LOOTLOCKERSERVERSDK_API void SetValueAsString(const FString& Value);
166 /*
167 Set the value as a float.
168 */
169 LOOTLOCKERSERVERSDK_API void SetValueAsFloat(const float& Value);
170 /*
171 Set the value as an integer.
172 */
173 LOOTLOCKERSERVERSDK_API void SetValueAsInteger(const int& Value);
174 /*
175 Set the value as a bool.
176 */
177 LOOTLOCKERSERVERSDK_API void SetValueAsBool(const bool& Value);
178 /*
179 Set the value as a JsonValue.
180 */
181 LOOTLOCKERSERVERSDK_API void SetRawValue(const TSharedPtr<FJsonValue>& Value);
182 /*
183 Set the value as the provided UStruct object. Returns true if value could be serialized.
184 */
185 template<typename T>
186 LOOTLOCKERSERVERSDK_API bool SetValueAsUStruct(const T& Value);
187 /*
188 Set the value as a Json Object.
189 */
190 LOOTLOCKERSERVERSDK_API void SetValueAsJsonObject(const FJsonObject& Value);
191 /*
192 Set the value as a Json Array.
193 */
194 LOOTLOCKERSERVERSDK_API void SetValueAsJsonArray(const TArray<TSharedPtr<FJsonValue>>& Value);
195 /*
196 Set the value as a Base64 object.
197 */
198 LOOTLOCKERSERVERSDK_API void SetValueAsBase64(const FLootLockerServerMetadataBase64Value& Value);
199
200 /*
201 Factory method that makes an FLootLockerServerMetadataEntry with a String Value
202 */
203 static LOOTLOCKERSERVERSDK_API FLootLockerServerMetadataEntry MakeStringEntry(const FString& Key, const TArray<FString>& Tags, const TArray<FString>& Access, const FString& Value);
204 /*
205 Factory method that makes an FLootLockerServerMetadataEntry with a Float Value
206 */
207 static LOOTLOCKERSERVERSDK_API FLootLockerServerMetadataEntry MakeFloatEntry(const FString& Key, const TArray<FString>& Tags, const TArray<FString>& Access, const float& Value);
208 /*
209 Factory method that makes an FLootLockerServerMetadataEntry with an Integer Value
210 */
211 static LOOTLOCKERSERVERSDK_API FLootLockerServerMetadataEntry MakeIntegerEntry(const FString& Key, const TArray<FString>& Tags, const TArray<FString>& Access, const int Value);
212 /*
213 Factory method that makes an FLootLockerServerMetadataEntry with a Bool Value
214 */
215 static LOOTLOCKERSERVERSDK_API FLootLockerServerMetadataEntry MakeBoolEntry(const FString& Key, const TArray<FString>& Tags, const TArray<FString>& Access, const bool Value);
216 /*
217 Factory method that makes an FLootLockerServerMetadataEntry with a JsonValue Value
218 */
219 static LOOTLOCKERSERVERSDK_API FLootLockerServerMetadataEntry MakeJsonValueEntry(const FString& Key, const TArray<FString>& Tags, const TArray<FString>& Access, const ELootLockerServerMetadataTypes Type, const TSharedPtr<FJsonValue> Value);
220 /*
221 Factory method that makes an FLootLockerServerMetadataEntry with a JsonObject Value
222 */
223 static LOOTLOCKERSERVERSDK_API FLootLockerServerMetadataEntry MakeJsonObjectEntry(const FString& Key, const TArray<FString>& Tags, const TArray<FString>& Access, const FJsonObject& Value);
224 /*
225 Factory method that makes an FLootLockerServerMetadataEntry with a JsonArray Value
226 */
227 static LOOTLOCKERSERVERSDK_API FLootLockerServerMetadataEntry MakeJsonArrayEntry(const FString& Key, const TArray<FString>& Tags, const TArray<FString>& Access, const TArray<TSharedPtr<FJsonValue>>& Value);
228 /*
229 Factory method that makes an FLootLockerServerMetadataEntry with a Base64 Value
230 */
231 static LOOTLOCKERSERVERSDK_API FLootLockerServerMetadataEntry MakeBase64Entry(const FString& Key, const TArray<FString>& Tags, const TArray<FString>& Access, const FLootLockerServerMetadataBase64Value& Value);
232
233 /*
234 For internal use only
235 */
236 void LOOTLOCKERSERVERSDK_API _INTERNAL_SetJsonRepresentation(const FJsonObject& obj);
237 static FLootLockerServerMetadataEntry LOOTLOCKERSERVERSDK_API _INTERNAL_MakeEntryExceptValue(const FString& Key, const TArray<FString>& Tags, const TArray<FString>& Access, const ELootLockerServerMetadataTypes Type);
238private:
239
240 FJsonObject EntryAsJson;
241};
242
246USTRUCT(BlueprintType, Category = "LootLockerServer")
248{
249 GENERATED_BODY()
253 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
254 FString Key;
258 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
260};
261
265USTRUCT(BlueprintType, Category = "LootLockerServer")
267{
268 GENERATED_BODY()
272 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
277 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
282 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
283 FString Error;
284};
285
289USTRUCT(BlueprintType, Category = "LootLockerServer")
291{
292 GENERATED_BODY()
296 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
301 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
302 FString Id;
306 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
307 TArray<FString> Keys;
308};
309
313USTRUCT(BlueprintType, Category = "LootLockerServer")
315{
316 GENERATED_BODY()
320 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
325 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
326 FString Source_id;
330 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
332 /*
333
334 */
335 int LOOTLOCKERSERVERSDK_API __INTERNAL_GetEntryIndexByKey(const FString& Key) const;
336 /*
337
338 */
339 void LOOTLOCKERSERVERSDK_API __INTERNAL_GenerateKeyMap();
340private:
341 TMap<FString, int> KeyToEntryIndex = TMap<FString, int>();
342};
343
344//==================================================
345// Request Definitions
346//==================================================
347
351USTRUCT(BlueprintType, Category = "LootLockerServer")
353{
354 GENERATED_BODY()
358 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
363 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
365};
366
370USTRUCT(BlueprintType, Category = "LootLockerServer")
372{
373 GENERATED_BODY()
377 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
379};
380
381//==================================================
382// Response Definitions
383//==================================================
384
387USTRUCT(BlueprintType, Category = "LootLockerServer")
389{
390 GENERATED_BODY()
394 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
399 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
401 /*
402 Internal Use Only
403 */
404 int LOOTLOCKERSERVERSDK_API __INTERNAL_GetEntryIndexByKey(const FString Key) const;
405 /*
406 Internal Use Only
407 */
408 void LOOTLOCKERSERVERSDK_API __INTERNAL_GenerateKeyMap();
409private:
410 TMap<FString, int> KeyToEntryIndex = TMap<FString, int>();
411};
412
415USTRUCT(BlueprintType, Category = "LootLockerServer")
417{
418 GENERATED_BODY()
422 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
424};
425
428USTRUCT(BlueprintType, Category = "LootLockerServer")
430{
431 GENERATED_BODY()
435 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
440 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
445 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
446 FString Source_id;
447};
448
451USTRUCT(BlueprintType, Category = "LootLockerServer")
453{
454 GENERATED_BODY()
458 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
460};
461
462//==================================================
463// C++ Delegate Definitions
464//==================================================
465
466/*
467 C++ response delegate for listing metadata
468 */
470/*
471 C++ response delegate for getting a single metadata entry
472 */
474/*
475 Blueprint response delegate for getting multi source metadata
476 */
478/*
479 Blueprint response delegate for setting metadata
480 */
482
483//==================================================
484// API Class Definition
485//==================================================
486
487
488UCLASS()
489class LOOTLOCKERSERVERSDK_API ULootLockerServerMetadataRequest : public UObject
490{
491 GENERATED_BODY()
492public:
494
495 static FString ListMetadata(const ELootLockerServerMetadataSources Source, const FString& SourceID, const int Page, const int PerPage, const FString& Key, const TArray<FString>& Tags, const bool IgnoreFiles, const FLootLockerServerListMetadataResponseDelegate& OnComplete);
496 static FString GetMetadata(const ELootLockerServerMetadataSources Source, const FString& SourceID, const FString& Key, const bool IgnoreFiles, const FLootLockerServerGetMetadataResponseDelegate& OnComplete);
497 static FString GetMultisourceMetadata(const TArray<FLootLockerServerMetadataSourceAndKeys>& SourcesAndKeysToGet, const bool IgnoreFiles, const FLootLockerServerGetMultisourceMetadataResponseDelegate& OnComplete);
498 static FString SetMetadata(const ELootLockerServerMetadataSources Source, const FString& SourceID, const TArray<FLootLockerServerSetMetadataAction>& MetadataToActionsToPerform, const FLootLockerServerSetMetadataResponseDelegate& OnComplete);
499};
void(* FLootLockerServerGetMetadataResponseDelegate)(FLootLockerServerGetMetadataResponse)
Definition LootLockerServerMetadataRequest.h:473
ELootLockerServerMetadataTypes
Possible metadata types.
Definition LootLockerServerMetadataRequest.h:36
ELootLockerServerMetadataActions
Possible metadata actions.
Definition LootLockerServerMetadataRequest.h:49
void(* FLootLockerServerSetMetadataResponseDelegate)(FLootLockerServerSetMetadataResponse)
Definition LootLockerServerMetadataRequest.h:481
ELootLockerServerMetadataSources
Possible metadata sources.
Definition LootLockerServerMetadataRequest.h:20
void(* FLootLockerServerGetMultisourceMetadataResponseDelegate)(FLootLockerServerGetMultisourceMetadataResponse)
Definition LootLockerServerMetadataRequest.h:477
void(* FLootLockerServerListMetadataResponseDelegate)(FLootLockerServerListMetadataResponse)
Definition LootLockerServerMetadataRequest.h:469
ELootLockerServerMetadataParserOutputTypes
Possible metadata parser output types.
Definition LootLockerServerMetadataRequest.h:62
Definition LootLockerServerMetadataRequest.h:490
static FString GetMultisourceMetadata(const TArray< FLootLockerServerMetadataSourceAndKeys > &SourcesAndKeysToGet, const bool IgnoreFiles, const FLootLockerServerGetMultisourceMetadataResponseDelegate &OnComplete)
static FString SetMetadata(const ELootLockerServerMetadataSources Source, const FString &SourceID, const TArray< FLootLockerServerSetMetadataAction > &MetadataToActionsToPerform, const FLootLockerServerSetMetadataResponseDelegate &OnComplete)
static FString GetMetadata(const ELootLockerServerMetadataSources Source, const FString &SourceID, const FString &Key, const bool IgnoreFiles, const FLootLockerServerGetMetadataResponseDelegate &OnComplete)
static FString ListMetadata(const ELootLockerServerMetadataSources Source, const FString &SourceID, const int Page, const int PerPage, const FString &Key, const TArray< FString > &Tags, const bool IgnoreFiles, const FLootLockerServerListMetadataResponseDelegate &OnComplete)
Definition LootLockerServerResponse.h:168
Definition LootLockerServerMetadataRequest.h:417
Definition LootLockerServerMetadataRequest.h:372
Definition LootLockerServerMetadataRequest.h:453
Definition LootLockerServerMetadataRequest.h:389
Definition LootLockerServerMetadataRequest.h:83
Definition LootLockerServerMetadataRequest.h:102
Definition LootLockerServerMetadataRequest.h:315
Definition LootLockerServerMetadataRequest.h:291
The base response for all LootLocker Server responses.
Definition LootLockerServerResponse.h:67
Definition LootLockerServerMetadataRequest.h:353
Definition LootLockerServerMetadataRequest.h:248
Definition LootLockerServerMetadataRequest.h:267
Definition LootLockerServerMetadataRequest.h:430