SDK for / Overview

XsollaStoreAuxiliaryDataModel.h

1// Copyright 2024 Xsolla Inc. All Rights Reserved.
2
3#pragma once
4
5#include "XsollaStoreDataModel.h"
6#include "XsollaStoreDelegates.h"
7#include "XsollaStoreAuxiliaryDataModel.generated.h"
8
9USTRUCT()
11{
12GENERATED_BODY()
13
14UPROPERTY()
15FString Locale;
16
17UPROPERTY()
18FString Country;
19
20UPROPERTY()
21TArray<FString> AdditionalFields;
22
23UPROPERTY()
24FOnStoreItemsUpdate ResultSuccessCallback;
25
26UPROPERTY()
27FOnError ResultErrorCallback;
28
29UPROPERTY()
30FStoreItemsData ResultData;
31
32UPROPERTY()
33FErrorData ResultErrorData;
34
35UPROPERTY()
36FOnStoreItemsUpdate CurrentSuccessCallback;
37
38UPROPERTY()
39FOnError CurrentErrorCallback;
40
41UPROPERTY()
42int32 Limit = 50;
43
44UPROPERTY()
45int32 Offset = 0;
46
47UPROPERTY()
48FString AuthToken;
49
50void ProcessNextPartOfData(const FStoreItemsData& InItemsData, const TFunction<void()>& NextCallFunc)
51{
52ResultData.Items.Append(InItemsData.Items);
53
54if (InItemsData.has_more)
55{
56Offset += Limit;
57NextCallFunc();
58}
59else
60{
61Finish(true);
62}
63}
64
65void Finish(bool isSuccess)
66{
67CurrentSuccessCallback.Unbind();
68CurrentErrorCallback.Unbind();
69isSuccess ? ResultSuccessCallback.ExecuteIfBound(ResultData) : ResultErrorCallback.ExecuteIfBound(ResultErrorData.StatusCode, ResultErrorData.ErrorCode, ResultErrorData.ErrorMessage);
70}
71
73{
74}
75
77const FString& InLocale,
78const FString& InCountry,
79const TArray<FString>& InAdditionalFields,
80const FOnStoreItemsUpdate& InResultSuccessCallback,
81const FOnError& InResultErrorCallback,
82const FString& InAuthToken)
83: Locale(InLocale)
84, Country(InCountry)
85, AdditionalFields(InAdditionalFields)
86, ResultSuccessCallback(InResultSuccessCallback)
87, ResultErrorCallback(InResultErrorCallback)
88, AuthToken(InAuthToken)
89{
90}
91};
92
93USTRUCT()
95{
96GENERATED_BODY()
97
98UPROPERTY()
99FString Locale;
100
101UPROPERTY()
102FString Country;
103
104UPROPERTY()
105TArray<FString> AdditionalFields;
106
107UPROPERTY()
108FOnVirtualCurrenciesUpdate ResultSuccessCallback;
109
110UPROPERTY()
111FOnError ResultErrorCallback;
112
113UPROPERTY()
114FVirtualCurrencyData ResultData;
115
116UPROPERTY()
117FErrorData ResultErrorData;
118
119UPROPERTY()
120FOnVirtualCurrenciesUpdate CurrentSuccessCallback;
121
122UPROPERTY()
123FOnError CurrentErrorCallback;
124
125UPROPERTY()
126int32 Limit = 50;
127
128UPROPERTY()
129int32 Offset = 0;
130
131void ProcessNextPartOfData(const FVirtualCurrencyData& InCurrenciesData, const TFunction<void()>& NextCallFunc)
132{
133ResultData.Items.Append(InCurrenciesData.Items);
134
135if (InCurrenciesData.has_more)
136{
137Offset += Limit;
138NextCallFunc();
139}
140else
141{
142Finish(true);
143}
144}
145
146void Finish(bool isSuccess)
147{
148CurrentSuccessCallback.Unbind();
149CurrentErrorCallback.Unbind();
150isSuccess ? ResultSuccessCallback.ExecuteIfBound(ResultData) : ResultErrorCallback.ExecuteIfBound(ResultErrorData.StatusCode, ResultErrorData.ErrorCode, ResultErrorData.ErrorMessage);
151}
152
154{
155}
156
158const FString& InLocale,
159const FString& InCountry,
160const TArray<FString>& InAdditionalFields,
161const FOnVirtualCurrenciesUpdate& InResultSuccessCallback,
162const FOnError& InResultErrorCallback)
163: Locale(InLocale)
164, Country(InCountry)
165, AdditionalFields(InAdditionalFields)
166, ResultSuccessCallback(InResultSuccessCallback)
167, ResultErrorCallback(InResultErrorCallback)
168{
169}
170};
171
172USTRUCT()
174{
175GENERATED_BODY()
176
177UPROPERTY()
178FString Locale;
179
180UPROPERTY()
181FString Country;
182
183UPROPERTY()
184TArray<FString> AdditionalFields;
185
186UPROPERTY()
187FOnVirtualCurrencyPackagesUpdate ResultSuccessCallback;
188
189UPROPERTY()
190FOnError ResultErrorCallback;
191
192UPROPERTY()
194
195UPROPERTY()
196FErrorData ResultErrorData;
197
198UPROPERTY()
199FOnVirtualCurrencyPackagesUpdate CurrentSuccessCallback;
200
201UPROPERTY()
202FOnError CurrentErrorCallback;
203
204UPROPERTY()
205int32 Limit = 50;
206
207UPROPERTY()
208int32 Offset = 0;
209
210UPROPERTY()
211FString AuthToken;
212
213void ProcessNextPartOfData(const FVirtualCurrencyPackagesData& InCurrencyPackagesData, const TFunction<void()>& NextCallFunc)
214{
215ResultData.Items.Append(InCurrencyPackagesData.Items);
216
217if (InCurrencyPackagesData.has_more)
218{
219Offset += Limit;
220NextCallFunc();
221}
222else
223{
224Finish(true);
225}
226}
227
228void Finish(bool isSuccess)
229{
230CurrentSuccessCallback.Unbind();
231CurrentErrorCallback.Unbind();
232isSuccess ? ResultSuccessCallback.ExecuteIfBound(ResultData) : ResultErrorCallback.ExecuteIfBound(ResultErrorData.StatusCode, ResultErrorData.ErrorCode, ResultErrorData.ErrorMessage);
233}
234
236{
237}
238
240const FString& InLocale,
241const FString& InCountry,
242const TArray<FString>& InAdditionalFields,
243const FOnVirtualCurrencyPackagesUpdate& InResultSuccessCallback,
244const FOnError& InResultErrorCallback,
245const FString& InAuthToken)
246: Locale(InLocale)
247, Country(InCountry)
248, AdditionalFields(InAdditionalFields)
249, ResultSuccessCallback(InResultSuccessCallback)
250, ResultErrorCallback(InResultErrorCallback)
251, AuthToken(InAuthToken)
252{
253}
254};
255
256USTRUCT()
258{
259GENERATED_BODY()
260
261UPROPERTY()
262FString ExternalId;
263
264UPROPERTY()
265FString Locale;
266
267UPROPERTY()
268FString Country;
269
270UPROPERTY()
271TArray<FString> AdditionalFields;
272
273UPROPERTY()
274FOnGetItemsListBySpecifiedGroup ResultSuccessCallback;
275
276UPROPERTY()
277FOnError ResultErrorCallback;
278
279UPROPERTY()
280FStoreItemsList ResultData;
281
282UPROPERTY()
283FErrorData ResultErrorData;
284
285UPROPERTY()
286FOnGetItemsListBySpecifiedGroup CurrentSuccessCallback;
287
288UPROPERTY()
289FOnError CurrentErrorCallback;
290
291UPROPERTY()
292int32 Limit = 50;
293
294UPROPERTY()
295int32 Offset = 0;
296
297UPROPERTY()
298FString AuthToken;
299
300void ProcessNextPartOfData(const FStoreItemsList& InData, const TFunction<void()>& NextCallFunc)
301{
302ResultData.Items.Append(InData.Items);
303
304if (InData.has_more)
305{
306Offset += Limit;
307NextCallFunc();
308}
309else
310{
311Finish(true);
312}
313}
314
315void Finish(bool isSuccess)
316{
317CurrentSuccessCallback.Unbind();
318CurrentErrorCallback.Unbind();
319isSuccess ? ResultSuccessCallback.ExecuteIfBound(ResultData) : ResultErrorCallback.ExecuteIfBound(ResultErrorData.StatusCode, ResultErrorData.ErrorCode, ResultErrorData.ErrorMessage);
320}
321
323{
324}
325
327const FString& InExternalId,
328const FString& InLocale,
329const FString& InCountry,
330const TArray<FString>& InAdditionalFields,
331const FOnGetItemsListBySpecifiedGroup& InResultSuccessCallback,
332const FOnError& InResultErrorCallback,
333const FString& InAuthToken)
334: ExternalId(InExternalId)
335, Locale(InLocale)
336, Country(InCountry)
337, AdditionalFields(InAdditionalFields)
338, ResultSuccessCallback(InResultSuccessCallback)
339, ResultErrorCallback(InResultErrorCallback)
340, AuthToken(InAuthToken)
341{
342}
343};
344
345USTRUCT()
347{
348GENERATED_BODY()
349
350UPROPERTY()
351FString Locale;
352
353UPROPERTY()
354FString Country;
355
356UPROPERTY()
357TArray<FString> AdditionalFields;
358
359UPROPERTY()
360FOnGetListOfBundlesUpdate ResultSuccessCallback;
361
362UPROPERTY()
363FOnError ResultErrorCallback;
364
365UPROPERTY()
366FStoreListOfBundles ResultData;
367
368UPROPERTY()
369FErrorData ResultErrorData;
370
371UPROPERTY()
372FOnGetListOfBundlesUpdate CurrentSuccessCallback;
373
374UPROPERTY()
375FOnError CurrentErrorCallback;
376
377UPROPERTY()
378int32 Limit = 50;
379
380UPROPERTY()
381int32 Offset = 0;
382
383UPROPERTY()
384FString AuthToken;
385
386void ProcessNextPartOfData(const FStoreListOfBundles& InData, const TFunction<void()>& NextCallFunc)
387{
388ResultData.items.Append(InData.items);
389
390if (InData.has_more)
391{
392Offset += Limit;
393NextCallFunc();
394}
395else
396{
397Finish(true);
398}
399}
400
401void Finish(bool isSuccess)
402{
403CurrentSuccessCallback.Unbind();
404CurrentErrorCallback.Unbind();
405isSuccess ? ResultSuccessCallback.ExecuteIfBound(ResultData) : ResultErrorCallback.ExecuteIfBound(ResultErrorData.StatusCode, ResultErrorData.ErrorCode, ResultErrorData.ErrorMessage);
406}
407
409{
410}
411
413const FString& InLocale,
414const FString& InCountry,
415const TArray<FString>& InAdditionalFields,
416const FOnGetListOfBundlesUpdate& InResultSuccessCallback,
417const FOnError& InResultErrorCallback,
418const FString& InAuthToken)
419: Locale(InLocale)
420, Country(InCountry)
421, AdditionalFields(InAdditionalFields)
422, ResultSuccessCallback(InResultSuccessCallback)
423, ResultErrorCallback(InResultErrorCallback)
424, AuthToken(InAuthToken)
425{
426}
427};
Definition: XsollaStoreAuxiliaryDataModel.h:347
Definition: XsollaStoreAuxiliaryDataModel.h:258
Definition: XsollaStoreAuxiliaryDataModel.h:95
Definition: XsollaStoreAuxiliaryDataModel.h:174
Definition: XsollaStoreAuxiliaryDataModel.h:11
Definition: XsollaStoreDataModel.h:248
Definition: XsollaStoreDataModel.h:236
Definition: XsollaStoreDataModel.h:658
Definition: XsollaStoreDataModel.h:338
Definition: XsollaStoreDataModel.h:449