LootLocker Unreal Server SDK 6.7.1
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 legacy items, while the "inventory_item" source is for item instances
29 inventory_item = 8, // This is the source for item instances (player inventory items)
30 item_template = 9, // This is the source for item templates
31};
32
36UENUM(BlueprintType, Category = "LootLockerServer")
38{
39 String = 0,
40 Number = 1,
41 Bool = 2,
42 Json = 3,
43 Base64 = 4,
44};
45
49UENUM(BlueprintType, Category = "LootLockerServer")
51{
52 Create = 0,
53 Update = 1,
54 Delete = 2,
55 Create_or_Update = 3, // Alias for Upsert (same thing)
56 Upsert = 4
57};
58
62UENUM(BlueprintType, Category = "LootLockerServer")
64{
65 OnString = 0 UMETA(ToolTip="Triggered when the parsed entry is of type String. The String Value field will be populated"),
66 OnInteger = 1 UMETA(ToolTip = "Triggered when the parsed entry is of type Integer (non decimal number). The Integer Value field will be populated"),
67 OnFloat = 2 UMETA(ToolTip = "Triggered when the parsed entry is of type Float (decimal number). The Float Value field will be populated"),
68 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"),
69 OnBool = 4 UMETA(ToolTip = "Triggered when the parsed entry is of type Bool. The Bool Value field will be populated"),
70 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"),
71 OnBase64 = 6 UMETA(ToolTip = "Triggered when the parsed entry is of type Base64. The Base64 Value field will be populated"),
72 OnError = 7 UMETA(ToolTip = "Triggered when the entry could not be parsed. The ErrorMessage Value field will be populated"),
73};
74
75
76//==================================================
77// Data Type Definitions
78//==================================================
79
83USTRUCT(BlueprintType, Category = "LootLockerServer")
85{
86 GENERATED_BODY()
90 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
91 FString Content_type;
95 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
96 FString Content;
97};
98
102USTRUCT(BlueprintType, Category = "LootLockerServer")
104{
105 GENERATED_BODY()
109 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
110 FString Key;
114 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
119 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
120 TArray<FString> Tags;
125 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
126 TArray<FString> Access;
127 /*
128 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.
129 */
130 LOOTLOCKERSERVERSDK_API bool TryGetValueAsString(FString& Output) const;
131 /*
132 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.
133 */
134 LOOTLOCKERSERVERSDK_API bool TryGetValueAsFloat(float& Output) const;
135 /*
136 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
137 */
138 LOOTLOCKERSERVERSDK_API bool TryGetValueAsInteger(int& Output) const;
139 /*
140 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).
141 */
142 LOOTLOCKERSERVERSDK_API bool TryGetValueAsBool(bool& Output) const;
143 /*
144 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.
145 */
146 LOOTLOCKERSERVERSDK_API bool TryGetRawValue(TSharedPtr<FJsonValue>& Output) const;
147 /*
148 Get the value in a json string format. Returns true if the value was present and could be serialized, returns false otherwise
149 */
150 LOOTLOCKERSERVERSDK_API bool TryGetSerializedValue(FString& Output) const;
151 /*
152 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.
153 */
154 LOOTLOCKERSERVERSDK_API bool TryGetValueAsJsonObject(TSharedPtr<FJsonObject>& Output) const;
155 /*
156 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
157 */
158 LOOTLOCKERSERVERSDK_API bool TryGetValueAsJsonArray(TArray<TSharedPtr<FJsonValue>>& Output) const;
159 /*
160 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.
161 */
162 LOOTLOCKERSERVERSDK_API bool TryGetValueAsBase64(FLootLockerServerMetadataBase64Value& Output) const;
163
164 /*
165 Set the value as a String.
166 */
167 LOOTLOCKERSERVERSDK_API void SetValueAsString(const FString& Value);
168 /*
169 Set the value as a float.
170 */
171 LOOTLOCKERSERVERSDK_API void SetValueAsFloat(const float& Value);
172 /*
173 Set the value as an integer.
174 */
175 LOOTLOCKERSERVERSDK_API void SetValueAsInteger(const int& Value);
176 /*
177 Set the value as a bool.
178 */
179 LOOTLOCKERSERVERSDK_API void SetValueAsBool(const bool& Value);
180 /*
181 Set the value as a JsonValue.
182 */
183 LOOTLOCKERSERVERSDK_API void SetRawValue(const TSharedPtr<FJsonValue>& Value);
184 /*
185 Set the value as the provided UStruct object. Returns true if value could be serialized.
186 */
187 template<typename T>
188 LOOTLOCKERSERVERSDK_API bool SetValueAsUStruct(const T& Value);
189 /*
190 Set the value as a Json Object.
191 */
192 LOOTLOCKERSERVERSDK_API void SetValueAsJsonObject(const FJsonObject& Value);
193 /*
194 Set the value as a Json Array.
195 */
196 LOOTLOCKERSERVERSDK_API void SetValueAsJsonArray(const TArray<TSharedPtr<FJsonValue>>& Value);
197 /*
198 Set the value as a Base64 object.
199 */
200 LOOTLOCKERSERVERSDK_API void SetValueAsBase64(const FLootLockerServerMetadataBase64Value& Value);
201
202 /*
203 Factory method that makes an FLootLockerServerMetadataEntry with a String Value
204 */
205 static LOOTLOCKERSERVERSDK_API FLootLockerServerMetadataEntry MakeStringEntry(const FString& Key, const TArray<FString>& Tags, const TArray<FString>& Access, const FString& Value);
206 /*
207 Factory method that makes an FLootLockerServerMetadataEntry with a Float Value
208 */
209 static LOOTLOCKERSERVERSDK_API FLootLockerServerMetadataEntry MakeFloatEntry(const FString& Key, const TArray<FString>& Tags, const TArray<FString>& Access, const float& Value);
210 /*
211 Factory method that makes an FLootLockerServerMetadataEntry with an Integer Value
212 */
213 static LOOTLOCKERSERVERSDK_API FLootLockerServerMetadataEntry MakeIntegerEntry(const FString& Key, const TArray<FString>& Tags, const TArray<FString>& Access, const int Value);
214 /*
215 Factory method that makes an FLootLockerServerMetadataEntry with a Bool Value
216 */
217 static LOOTLOCKERSERVERSDK_API FLootLockerServerMetadataEntry MakeBoolEntry(const FString& Key, const TArray<FString>& Tags, const TArray<FString>& Access, const bool Value);
218 /*
219 Factory method that makes an FLootLockerServerMetadataEntry with a JsonValue Value
220 */
221 static LOOTLOCKERSERVERSDK_API FLootLockerServerMetadataEntry MakeJsonValueEntry(const FString& Key, const TArray<FString>& Tags, const TArray<FString>& Access, const ELootLockerServerMetadataTypes Type, const TSharedPtr<FJsonValue> Value);
222 /*
223 Factory method that makes an FLootLockerServerMetadataEntry with a JsonObject Value
224 */
225 static LOOTLOCKERSERVERSDK_API FLootLockerServerMetadataEntry MakeJsonObjectEntry(const FString& Key, const TArray<FString>& Tags, const TArray<FString>& Access, const FJsonObject& Value);
226 /*
227 Factory method that makes an FLootLockerServerMetadataEntry with a JsonArray Value
228 */
229 static LOOTLOCKERSERVERSDK_API FLootLockerServerMetadataEntry MakeJsonArrayEntry(const FString& Key, const TArray<FString>& Tags, const TArray<FString>& Access, const TArray<TSharedPtr<FJsonValue>>& Value);
230 /*
231 Factory method that makes an FLootLockerServerMetadataEntry with a Base64 Value
232 */
233 static LOOTLOCKERSERVERSDK_API FLootLockerServerMetadataEntry MakeBase64Entry(const FString& Key, const TArray<FString>& Tags, const TArray<FString>& Access, const FLootLockerServerMetadataBase64Value& Value);
234
235 /*
236 For internal use only
237 */
238 void LOOTLOCKERSERVERSDK_API _INTERNAL_SetJsonRepresentation(const FJsonObject& obj);
239 static FLootLockerServerMetadataEntry LOOTLOCKERSERVERSDK_API _INTERNAL_MakeEntryExceptValue(const FString& Key, const TArray<FString>& Tags, const TArray<FString>& Access, const ELootLockerServerMetadataTypes Type);
240private:
241
242 FJsonObject EntryAsJson;
243};
244
248USTRUCT(BlueprintType, Category = "LootLockerServer")
250{
251 GENERATED_BODY()
255 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
256 FString Key;
260 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
262};
263
267USTRUCT(BlueprintType, Category = "LootLockerServer")
269{
270 GENERATED_BODY()
274 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
279 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
284 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
285 FString Error;
286};
287
291USTRUCT(BlueprintType, Category = "LootLockerServer")
293{
294 GENERATED_BODY()
298 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
303 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
304 FString Id;
308 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
309 TArray<FString> Keys;
310};
311
315USTRUCT(BlueprintType, Category = "LootLockerServer")
317{
318 GENERATED_BODY()
322 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
327 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
328 FString Source_id;
332 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
334 /*
335
336 */
337 int LOOTLOCKERSERVERSDK_API __INTERNAL_GetEntryIndexByKey(const FString& Key) const;
338 /*
339
340 */
341 void LOOTLOCKERSERVERSDK_API __INTERNAL_GenerateKeyMap();
342private:
343 TMap<FString, int> KeyToEntryIndex = TMap<FString, int>();
344};
345
346//==================================================
347// Request Definitions
348//==================================================
349
353USTRUCT(BlueprintType, Category = "LootLockerServer")
355{
356 GENERATED_BODY()
360 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
365 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
367};
368
372USTRUCT(BlueprintType, Category = "LootLockerServer")
374{
375 GENERATED_BODY()
379 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
381};
382
383//==================================================
384// Response Definitions
385//==================================================
386
389USTRUCT(BlueprintType, Category = "LootLockerServer")
391{
392 GENERATED_BODY()
396 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
401 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
403 /*
404 Internal Use Only
405 */
406 int LOOTLOCKERSERVERSDK_API __INTERNAL_GetEntryIndexByKey(const FString Key) const;
407 /*
408 Internal Use Only
409 */
410 void LOOTLOCKERSERVERSDK_API __INTERNAL_GenerateKeyMap();
411private:
412 TMap<FString, int> KeyToEntryIndex = TMap<FString, int>();
413};
414
417USTRUCT(BlueprintType, Category = "LootLockerServer")
419{
420 GENERATED_BODY()
424 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
426};
427
430USTRUCT(BlueprintType, Category = "LootLockerServer")
432{
433 GENERATED_BODY()
437 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
442 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
447 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
448 FString Source_id;
449};
450
453USTRUCT(BlueprintType, Category = "LootLockerServer")
455{
456 GENERATED_BODY()
460 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
462};
463
464//==================================================
465// C++ Delegate Definitions
466//==================================================
467
468/*
469 C++ response delegate for listing metadata
470 */
472/*
473 C++ response delegate for getting a single metadata entry
474 */
476/*
477 Blueprint response delegate for getting multi source metadata
478 */
480/*
481 Blueprint response delegate for setting metadata
482 */
484
485//==================================================
486// API Class Definition
487//==================================================
488
489
490UCLASS()
491class LOOTLOCKERSERVERSDK_API ULootLockerServerMetadataRequest : public UObject
492{
493 GENERATED_BODY()
494public:
496
497 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);
498 static FString GetMetadata(const ELootLockerServerMetadataSources Source, const FString& SourceID, const FString& Key, const bool IgnoreFiles, const FLootLockerServerGetMetadataResponseDelegate& OnComplete);
499 static FString GetMultisourceMetadata(const TArray<FLootLockerServerMetadataSourceAndKeys>& SourcesAndKeysToGet, const bool IgnoreFiles, const FLootLockerServerGetMultisourceMetadataResponseDelegate& OnComplete);
500 static FString SetMetadata(const ELootLockerServerMetadataSources Source, const FString& SourceID, const TArray<FLootLockerServerSetMetadataAction>& MetadataToActionsToPerform, const FLootLockerServerSetMetadataResponseDelegate& OnComplete);
501};
void(* FLootLockerServerGetMetadataResponseDelegate)(FLootLockerServerGetMetadataResponse)
Definition LootLockerServerMetadataRequest.h:475
ELootLockerServerMetadataTypes
Possible metadata types.
Definition LootLockerServerMetadataRequest.h:38
ELootLockerServerMetadataActions
Possible metadata actions.
Definition LootLockerServerMetadataRequest.h:51
void(* FLootLockerServerSetMetadataResponseDelegate)(FLootLockerServerSetMetadataResponse)
Definition LootLockerServerMetadataRequest.h:483
ELootLockerServerMetadataSources
Possible metadata sources.
Definition LootLockerServerMetadataRequest.h:20
void(* FLootLockerServerGetMultisourceMetadataResponseDelegate)(FLootLockerServerGetMultisourceMetadataResponse)
Definition LootLockerServerMetadataRequest.h:479
void(* FLootLockerServerListMetadataResponseDelegate)(FLootLockerServerListMetadataResponse)
Definition LootLockerServerMetadataRequest.h:471
ELootLockerServerMetadataParserOutputTypes
Possible metadata parser output types.
Definition LootLockerServerMetadataRequest.h:64
Definition LootLockerServerMetadataRequest.h:492
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:419
Definition LootLockerServerMetadataRequest.h:374
Definition LootLockerServerMetadataRequest.h:455
Definition LootLockerServerMetadataRequest.h:391
Definition LootLockerServerMetadataRequest.h:85
Definition LootLockerServerMetadataRequest.h:104
Definition LootLockerServerMetadataRequest.h:317
Definition LootLockerServerMetadataRequest.h:293
The base response for all LootLocker Server responses.
Definition LootLockerServerResponse.h:67
Definition LootLockerServerMetadataRequest.h:355
Definition LootLockerServerMetadataRequest.h:250
Definition LootLockerServerMetadataRequest.h:269
Definition LootLockerServerMetadataRequest.h:432