LootLocker Unreal Server SDK 7.1.1
Server-side backend SDK for Unreal Engine
Loading...
Searching...
No Matches
LootLockerServerResponse.h
Go to the documentation of this file.
1// Copyright (c) 2021 LootLocker
2
3#pragma once
4#include "LootLockerServerResponse.generated.h"
5
9USTRUCT(BlueprintType)
11{
12 GENERATED_BODY()
13};
14
15USTRUCT(BlueprintType)
17{
18 GENERATED_BODY()
20 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
21 FString Code;
23 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
24 FString Doc_url;
26 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
27 FString Request_id;
29 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
30 FString Trace_id;
34 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
37 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
38 FString Message;
39};
40
41USTRUCT(BlueprintType)
43{
44 GENERATED_BODY()
46 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
47 FString RequestTime = "";
49 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
50 FString RequestId = "";
52 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
53 FString RequestURL = "";
55 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
56 FString RequestMethod = "";
58 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
60};
61
65USTRUCT(BlueprintType)
67{
68 GENERATED_BODY()
69
70
71 UPROPERTY(BlueprintReadWrite, Category = "LootLockerServer")
72 bool Success = false;
74 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
75 int StatusCode = 0;
77 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
80 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
83 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
85};
86
87//==================================================
88// C++ Delegate Definitions
89//==================================================
90
91/*
92 C++ response delegate for a generic LootLocker Response
93 */
95
96//==================================================
97// Definition of pagination data structures
98//==================================================
99
104USTRUCT(BlueprintType)
106{
107 GENERATED_BODY()
111 UPROPERTY(BlueprintReadWrite, EditAnywhere, BlueprintReadWrite, Category = "LootLockerServer")
112 int Total = 0;
116 UPROPERTY(BlueprintReadWrite, EditAnywhere, BlueprintReadWrite, Category = "LootLockerServer")
117 FString Next_Cursor = "";
121 UPROPERTY(BlueprintReadWrite, EditAnywhere, BlueprintReadWrite, Category = "LootLockerServer")
122 FString Previous_Cursor = "";
123};
124
129USTRUCT(BlueprintType)
131{
132 GENERATED_BODY()
136 UPROPERTY(BlueprintReadWrite, EditAnywhere, BlueprintReadWrite, Category = "LootLockerServer")
137 int32 Total = 0;
141 UPROPERTY(BlueprintReadWrite, EditAnywhere, BlueprintReadWrite, Category = "LootLockerServer")
142 int32 Next_Cursor = 0;
146 UPROPERTY(BlueprintReadWrite, EditAnywhere, BlueprintReadWrite, Category = "LootLockerServer")
148};
149
150USTRUCT(BlueprintType)
152{
153 GENERATED_BODY()
157 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
158 FString Field;
162 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
163 FString Message;
164};
165
166USTRUCT(BlueprintType)
168{
169 GENERATED_BODY()
173 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
174 int32 Total = 0;
178 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
179 int32 Offset = 0;
183 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
184 int32 Per_page = 0;
188 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
189 int32 Last_page = 0;
193 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
194 int32 Current_page = 0;
198 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
199 FString Next_page;
203 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
204 FString Prev_page;
208 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
210};
211
216{
217 static const int LL_ERROR_UNDOCUMENTED = 0;
218 static const int LL_ERROR_INVALID_HTTP = -1;
219 static const int LL_ERROR_INVALID_INPUT = -2;
220 static const int LL_ERROR_PARSE_ERROR = -3;
221};
222
224{
225public:
226 // Construct a standardized error response
227 template<typename T>
228 static T Error(FString ErrorMessage, int StatusCode = 0, const FString& RequestId = "")
229 {
230 T ErrorResponse;
231 ErrorResponse.Success = false;
232 ErrorResponse.StatusCode = StatusCode;
233 ErrorResponse.FullTextFromServer = "{ \"message\": \"" + ErrorMessage + "\"}";
234 ErrorResponse.ErrorData.Message = ErrorMessage;
235 ErrorResponse.RequestContext.RequestId = RequestId;
236 return ErrorResponse;
237 }
238};
void(* FLootLockerServerResponseCallback)(FLootLockerServerResponse)
Definition LootLockerServerResponse.h:94
Definition LootLockerServerResponse.h:224
static T Error(FString ErrorMessage, int StatusCode=0, const FString &RequestId="")
Definition LootLockerServerResponse.h:228
An empty type to use as empty request bodies.
Definition LootLockerServerResponse.h:11
Definition LootLockerServerResponse.h:17
FString Trace_id
A unique identifier for tracing the request through LootLocker systems, use this in contact with supp...
Definition LootLockerServerResponse.h:30
FString Message
A free text description of the problem and potential suggestions for fixing it.
Definition LootLockerServerResponse.h:38
FString Request_id
A unique identifier of the request to use in contact with support.
Definition LootLockerServerResponse.h:27
FString Doc_url
A link to further documentation on the error.
Definition LootLockerServerResponse.h:24
FString Code
A descriptive code identifying the error.
Definition LootLockerServerResponse.h:21
int Retry_after_seconds
If the request was rate limited (status code 429) or the servers were temporarily unavailable (status...
Definition LootLockerServerResponse.h:35
Definition LootLockerServerResponse.h:168
int32 Last_page
The page index to use for fetching the last page of entries.
Definition LootLockerServerResponse.h:189
int32 Per_page
Number of entries on each page.
Definition LootLockerServerResponse.h:184
FString Next_page
The page index to use for fetching the page of entries immediately succeeding this page of entries.
Definition LootLockerServerResponse.h:199
FString Prev_page
The page index to use for fetching the page of entries immediately preceding this page of entries.
Definition LootLockerServerResponse.h:204
int32 Offset
How many entries (counting from the beginning of the paginated list) from the first entry that the cu...
Definition LootLockerServerResponse.h:179
TArray< FLootLockerServerExtendedPaginationError > Errors
List of pagination errors (if any).
Definition LootLockerServerResponse.h:209
int32 Current_page
The page index used for fetching this page of entries.
Definition LootLockerServerResponse.h:194
int32 Total
How many entries in total exists in the paginated list.
Definition LootLockerServerResponse.h:174
Definition LootLockerServerResponse.h:152
FString Field
Which field in the pagination that this error relates to.
Definition LootLockerServerResponse.h:158
FString Message
The error message in question.
Definition LootLockerServerResponse.h:163
Pagination data for index based pagination This is used for methods that have a "count" and an "after...
Definition LootLockerServerResponse.h:131
int32 Next_Cursor
The index to use for the "after" parameter in the next request.
Definition LootLockerServerResponse.h:142
int32 Previous_Cursor
The index used for the "after" parameter in the previous request.
Definition LootLockerServerResponse.h:147
int32 Total
The total number of items in the list this pagination refers to.
Definition LootLockerServerResponse.h:137
Pagination data for key based pagination This is used for methods that have a "count" and an "after" ...
Definition LootLockerServerResponse.h:106
FString Previous_Cursor
The key used for the "after" parameter in the previous request.
Definition LootLockerServerResponse.h:122
FString Next_Cursor
The key to use for the "after" parameter in the next request.
Definition LootLockerServerResponse.h:117
int Total
The total number of items in the list this pagination refers to.
Definition LootLockerServerResponse.h:112
Definition LootLockerServerResponse.h:43
FString RequestMethod
The HTTP Method that was used for this request.
Definition LootLockerServerResponse.h:56
FString RequestId
The unique identifier for this request.
Definition LootLockerServerResponse.h:50
FString RequestURL
The url that this request was made to.
Definition LootLockerServerResponse.h:53
FString RequestTime
The time that this request was made.
Definition LootLockerServerResponse.h:47
FString RequestParametersJsonString
The request parameters as a json string.
Definition LootLockerServerResponse.h:59
The base response for all LootLocker Server responses.
Definition LootLockerServerResponse.h:67
FString FullTextFromServer
Raw text/http body from the server response.
Definition LootLockerServerResponse.h:78
FLootLockerServerErrorData ErrorData
If this request was not a success, this structure holds all the information needed to identify the pr...
Definition LootLockerServerResponse.h:81
FLootLockerServerRequestContext RequestContext
Context information about the request.
Definition LootLockerServerResponse.h:84
int StatusCode
HTTP Status code from the request to LootLockers backend.
Definition LootLockerServerResponse.h:75
bool Success
True if the request succeeded.
Definition LootLockerServerResponse.h:72
Static defines of the different predefined error status codes that can occur in responses.
Definition LootLockerServerResponse.h:216
static const int LL_ERROR_PARSE_ERROR
Definition LootLockerServerResponse.h:220
static const int LL_ERROR_INVALID_HTTP
Definition LootLockerServerResponse.h:218
static const int LL_ERROR_INVALID_INPUT
Definition LootLockerServerResponse.h:219
static const int LL_ERROR_UNDOCUMENTED
Definition LootLockerServerResponse.h:217