5#include "CoreMinimal.h"
9#include "ApexTypes.generated.h"
16 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Join Session")
17 FString Uuid = TEXT("");
18 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Join Session")
19 FString EventType = TEXT("");
20 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Join Session")
22 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Join Session")
23 FString DeviceId = TEXT("");
24 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Join Session")
25 FString IpAddress = TEXT("");
26 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Join Session")
33 TSharedPtr<FJsonObject> Result(
new FJsonObject);
36 Result->SetStringField(
"uuid", Uuid);
39 if (!EventType.IsEmpty())
41 Result->SetStringField(
"eventType", EventType);
44 Result->SetNumberField(
"moduleId", ModuleId);
46 if (!DeviceId.IsEmpty())
48 Result->SetStringField(
"deviceId", DeviceId);
51 if (!IpAddress.IsEmpty())
53 Result->SetStringField(
"ipAddress", IpAddress);
58 if (!JsonData.IsEmpty())
60 Result->SetObjectField(
"jsonData", JsonData.ToJsonObject());
72 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Failed Request")
75 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Failed Request")
76 FString HttpCode = TEXT("0");
78 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Failed Request")
79 FString Message = TEXT("");
85 HttpCode = TEXT(
"400");
86 Message = TEXT(
"There is a server connection error. Please check that there is a valid URL being used or check if APEX is down.");
89 virtual void FromJsonObject(
const TSharedPtr<FJsonObject>& JObject)
override
91 if (JObject->HasField(
"Error"))
93 if (JObject->HasTypedField<EJson::Boolean>(
"Error"))
95 Error = JObject->GetBoolField(
"Error");
100 Message = JObject->GetStringField(
"error");
104 if (JObject->HasField(
"HttpCode"))
105 HttpCode = JObject->GetStringField(
"HttpCode");
107 if (JObject->HasField(
"Message"))
108 Message = JObject->GetStringField(
"Message");
112USTRUCT(BlueprintType)
117 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"PixoVR|Platform|Session")
124 virtual void FromJsonObject(
const TSharedPtr<FJsonObject>& JObject)
override
128 if (JObject->HasField(
"Data"))
130 const TSharedPtr<FJsonObject>& DataObject = JObject->GetObjectField(
"Data");
131 if (DataObject->HasField(
"SessionId"))
133 SessionId = DataObject->GetIntegerField(
"SessionId");
139USTRUCT(BlueprintType)
145 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Data")
146 bool Complete = false;
147 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Data")
148 bool Success = false;
149 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Data")
151 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Data")
152 float ScoreScaled = 0.0f;
153 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Data")
154 float ScoreMin = 0.0f;
155 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Data")
156 float ScoreMax = 0.0f;
157 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Data")
160 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Data")
162 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Data")
169 FSessionData(
bool InComplete,
bool InSuccess,
float InScore,
float InScoreScaled,
170 float InScoreMin,
float InScoreMax,
int InDuration,
172 : Complete(InComplete), Success(InSuccess), Score(InScore), ScoreScaled(InScoreScaled),
173 ScoreMin(InScoreMin), ScoreMax(InScoreMax), Duration(InDuration),
174 AdditionalContextData(InContextExtension), AdditionalResultData(InResultExtension)
178 virtual void FromJsonObject(
const TSharedPtr<FJsonObject>& JObject)
override
180 Score = JObject->GetNumberField(
"score");
181 ScoreScaled = JObject->GetNumberField(
"scoreScaled");
182 ScoreMin = JObject->GetNumberField(
"scoreMin");
183 ScoreMax = JObject->GetNumberField(
"scoreMax");
184 Duration = JObject->GetNumberField(
"sessionDuration");
185 Complete = JObject->GetBoolField(
"success");
186 FString LessonStatus = JObject->GetStringField(
"lessonStatus");
188 if (LessonStatus.Equals(
"passed"))
199USTRUCT(BlueprintType)
205 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Complete Session")
206 FString Uuid = TEXT("");
207 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Complete Session")
208 FString EventType = TEXT("");
209 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Complete Session")
211 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Complete Session")
212 FString DeviceId = TEXT("");
213 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Complete Session")
222 virtual void FromJsonObject(
const TSharedPtr<FJsonObject>& JObject)
override
224 if (JObject->HasField(
"uuid"))
226 Uuid = JObject->GetStringField(
"uuid");
229 if (JObject->HasField(
"eventType"))
231 EventType = JObject->GetStringField(
"eventType");
234 ModuleId = JObject->GetNumberField(
"moduleId");
236 if (JObject->HasField(
"deviceId"))
238 DeviceId = JObject->GetStringField(
"deviceId");
241 if (JObject->HasField(
"jsonData"))
244 SessionData.FromJsonObject(JObject->GetObjectField(
"jsonData"));
248 virtual TSharedPtr<FJsonObject>
ToJsonObject()
const override
250 TSharedPtr<FJsonObject> Result(
new FJsonObject);
254 Result->SetStringField(
"uuid", Uuid);
257 if (!EventType.IsEmpty())
259 Result->SetStringField(
"eventType", EventType);
262 Result->SetNumberField(
"moduleId", ModuleId);
264 if (!DeviceId.IsEmpty())
266 Result->SetStringField(
"deviceId", DeviceId);
272 if (!JsonData.IsEmpty())
274 TSharedPtr<FJsonObject> JsonDataObject = JsonData.ToJsonObject();
275 JsonDataObject->SetNumberField(
"score", SessionData.Score);
276 JsonDataObject->SetNumberField(
"scoreScaled", SessionData.ScoreScaled);
277 JsonDataObject->SetNumberField(
"scoreMin", SessionData.ScoreMin);
278 JsonDataObject->SetNumberField(
"scoreMax", SessionData.ScoreMax);
279 JsonDataObject->SetNumberField(
"sessionDuration", SessionData.Duration);
280 JsonDataObject->SetBoolField(
"success", SessionData.Success);
281 FString LessonStatus =
"failed";
282 if (SessionData.Success)
284 LessonStatus =
"passed";
286 JsonDataObject->SetStringField(
"lessonStatus", LessonStatus);
287 JsonDataObject->SetStringField(
"moduleName", FString::FromInt(ModuleId));
289 Result->SetObjectField(
"jsonData", JsonDataObject);
296USTRUCT(BlueprintType)
301 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Event")
302 FString Uuid = TEXT("");
303 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Event")
304 FString EventType = TEXT("");
305 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Event")
307 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Event")
308 FString DeviceId = TEXT("");
309 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Event")
315 virtual TSharedPtr<FJsonObject>
ToJsonObject()
const override
317 TSharedPtr<FJsonObject> Result(
new FJsonObject);
321 Result->SetStringField(
"uuid", Uuid);
324 if (!EventType.IsEmpty())
326 Result->SetStringField(
"eventType", EventType);
329 Result->SetNumberField(
"moduleId", ModuleId);
331 if (!DeviceId.IsEmpty())
333 Result->SetStringField(
"deviceId", DeviceId);
339 if (!JsonData.IsEmpty())
341 Result->SetObjectField(
"jsonData", JsonData.ToJsonObject());
348USTRUCT(BlueprintType)
353 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|
Apex Org")
355 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|
Apex Org")
356 FString Name = TEXT("");
357 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|
Apex Org")
358 FString Status = TEXT("");
363 virtual void FromJsonObject(
const TSharedPtr<FJsonObject>& JObject)
override
365 ID = JObject->GetIntegerField(
"ID");
366 Name = JObject->GetStringField(
"Name");
367 Status = JObject->GetStringField(
"Status");
370 virtual TSharedPtr<FJsonObject>
ToJsonObject()
const override
372 TSharedPtr<FJsonObject> Result(
new FJsonObject);
374 Result->SetNumberField(
"ID", ID);
375 Result->SetStringField(
"Name", Name);
376 Result->SetStringField(
"Status", Status);
382USTRUCT(BlueprintType)
387 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|User Session Data")
389 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|User Session Data")
391 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|User Session Data")
393 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|User Session Data")
394 FString FirstName = TEXT("");
395 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|User Session Data")
396 FString LastName = TEXT("");
397 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|User Session Data")
398 FString Email = TEXT("");
399 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|User Session Data")
400 FString SessionToken = TEXT("");
401 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|User Session Data")
409 return (!SessionToken.IsEmpty());
414 SessionToken = TEXT(
"");
417 virtual void FromJsonObject(
const TSharedPtr<FJsonObject>& JObject)
override
419 ID = JObject->GetIntegerField(
"ID");
420 OrgId = JObject->GetIntegerField(
"OrgId");
421 if (JObject->HasField(
"OrgUnit"))
423 OrgUnit = JObject->GetIntegerField(
"OrgUnit");
429 FirstName = JObject->GetStringField(
"First");
430 LastName = JObject->GetStringField(
"Last");
431 Email = JObject->GetStringField(
"Email");
432 SessionToken = JObject->GetStringField(
"Token");
433 Organization.FromJsonObject(JObject->GetObjectField(
"Org"));
436 virtual TSharedPtr<FJsonObject>
ToJsonObject()
const override
438 TSharedPtr<FJsonObject> Result(
new FJsonObject);
440 Result->SetNumberField(
"ID", ID);
441 Result->SetNumberField(
"OrgId", OrgId);
444 Result->SetNumberField(
"OrgUnit", OrgUnit);
446 Result->SetStringField(
"First", FirstName);
447 Result->SetStringField(
"Last", LastName);
448 Result->SetStringField(
"Email", Email);
449 Result->SetStringField(
"Token", SessionToken);
450 Result->SetObjectField(
"Org", Organization.ToJsonObject());
456USTRUCT(BlueprintType)
461 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"Apex|User Data")
464 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"Apex|User Data")
467 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"Apex|User Data")
468 FString FirstName = TEXT(
"");
470 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"Apex|User Data")
471 FString LastName = TEXT(
"");
473 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"Apex|User Data")
474 FString Email = TEXT(
"");
476 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"Apex|User Data")
477 FString Username = TEXT(
"");
479 virtual void FromJsonObject(
const TSharedPtr<FJsonObject>& JObject)
override
481 Id = JObject->GetIntegerField(
"id");
482 if (JObject->HasField(
"orgunit"))
484 OrgUnit = JObject->GetIntegerField(
"orgunit");
490 FirstName = JObject->GetStringField(
"first");
491 LastName = JObject->GetStringField(
"last");
492 Email = JObject->GetStringField(
"email");
493 Username = JObject->GetStringField(
"username");
496 virtual TSharedPtr<FJsonObject>
ToJsonObject()
const override
498 TSharedPtr<FJsonObject> Result(
new FJsonObject);
500 Result->SetNumberField(
"id", Id);
503 Result->SetNumberField(
"orgunit", OrgUnit);
505 Result->SetStringField(
"first", FirstName);
506 Result->SetStringField(
"last", LastName);
507 Result->SetStringField(
"email", Email);
508 Result->SetStringField(
"username", Username);
514USTRUCT(BlueprintType)
519 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Report")
520 FString Id = TEXT("");
521 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Report")
522 FString EventType = TEXT("");
523 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Report")
525 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Report")
527 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Report")
529 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Report")
530 float SessionDuration = 0.0f;
531 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Report")
532 bool LessonStatus = false;
533 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Report")
534 FString CreatedAt = TEXT("");
535 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Report")
536 FString UpdatedAt = TEXT("");
537 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Session Report")
542 virtual void FromJsonObject(
const TSharedPtr<FJsonObject>& JObject)
override
544 if (JObject->HasField(
"id"))
546 Id = JObject->GetStringField(
"id");
549 if (JObject->HasField(
"eventType"))
551 EventType = JObject->GetStringField(
"eventType");
554 if (JObject->HasField(
"sessionId"))
556 SessionId = JObject->GetNumberField(
"sessionId");
559 if (JObject->HasField(
"userId"))
561 UserId = JObject->GetNumberField(
"userId");
564 if (JObject->HasField(
"moduleId"))
566 ModuleId = JObject->GetNumberField(
"moduleId");
569 if (JObject->HasField(
"createdAt"))
571 CreatedAt = JObject->GetStringField(
"createdAt");
574 if (JObject->HasField(
"updatedAt"))
576 UpdatedAt = JObject->GetStringField(
"updatedAt");
579 if (JObject->HasField(
"jsonData"))
581 TSharedPtr<FJsonObject> JsonDataObject = JObject->GetObjectField(
"jsonData");
582 JsonData.FromJsonObject(JsonDataObject);
583 if (JsonDataObject->HasField(
"sessionDuration"))
585 SessionDuration = JsonDataObject->GetNumberField(
"sessionDuration");
588 if (JsonDataObject->HasField(
"lessonStatus"))
590 LessonStatus = JsonDataObject->GetBoolField(
"lessonStatus");
596USTRUCT(BlueprintType)
601 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Top Ten Data")
603 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Top Ten Data")
604 FString Message = TEXT("");
605 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Top Ten Data")
607 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Top Ten Data")
613 virtual void FromJsonObject(
const TSharedPtr<FJsonObject>& JObject)
override
615 Error = JObject->GetBoolField(
"error");
616 Message = JObject->GetStringField(
"message");
618 TArray<TSharedPtr<FJsonValue>> SessionDataArray;
620 if (JObject->HasTypedField<EJson::Array>(
"data"))
622 SessionDataArray = JObject->GetArrayField(
"data");
626 auto DataObject = JObject->GetObjectField(
"data");
629 SessionDataArray = DataObject->GetArrayField(
"sessions");
633 for (
auto SessionData : SessionDataArray)
637 Sessions.Push(CompleteSessionData);
641 virtual TSharedPtr<FJsonObject>
ToJsonObject()
const override
643 TSharedPtr<FJsonObject> Result(
new FJsonObject);
651USTRUCT(BlueprintType)
656 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"PixoVR|Hearbeat Event")
662 virtual TSharedPtr<FJsonObject>
ToJsonObject()
const override
664 TSharedPtr<FJsonObject> Result(
new FJsonObject);
666 Result->SetNumberField(
"sessionId", SessionId);
virtual TSharedPtr< FJsonObject > ToJsonObject() const override
virtual ~FAPEXOrganization()
virtual void FromJsonObject(const TSharedPtr< FJsonObject > &JObject) override
virtual void FromJsonObject(const TSharedPtr< FJsonObject > &JObject) override
virtual TSharedPtr< FJsonObject > ToJsonObject() const override
virtual void FromJsonObject(const TSharedPtr< FJsonObject > &JObject) override
virtual ~FCompleteSessionData()
FXAPIStatement JsonData
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Apex|Complete Session")
virtual TSharedPtr< FJsonObject > ToJsonObject() const override
virtual void FromJsonObject(const TSharedPtr< FJsonObject > &JObject) override
virtual ~FHeartbeatEvent()
virtual TSharedPtr< FJsonObject > ToJsonObject() const override
int SessionId
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR|Hearbeat Event")
virtual TSharedPtr< FJsonObject > ToJsonObject() const
FXAPIStatement JsonData
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Apex|Join Session")
virtual ~FJoinSessionData()
virtual void FromJsonObject(const TSharedPtr< FJsonObject > &JObject)
virtual TSharedPtr< FJsonObject > ToJsonObject() const
virtual void FromJsonObject(const TSharedPtr< FJsonObject > &JObject) override
float Score
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Apex|Session Data")
float ScoreMin
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Apex|Session Data")
float ScoreScaled
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Apex|Session Data")
float ScoreMax
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Apex|Session Data")
int Duration
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Apex|Session Data")
FXAPIExtension AdditionalContextData
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Apex|Session Data")
virtual void FromJsonObject(const TSharedPtr< FJsonObject > &JObject) override
FXAPIExtension AdditionalResultData
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Apex|Session Data")
FSessionData(bool InComplete, bool InSuccess, float InScore, float InScoreScaled, float InScoreMin, float InScoreMax, int InDuration, FXAPIExtension InContextExtension, FXAPIExtension InResultExtension)
bool Success
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Apex|Session Data")
virtual TSharedPtr< FJsonObject > ToJsonObject() const override
FXAPIStatement JsonData
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Apex|Session Event")
virtual ~FSessionEventData()
virtual ~FSessionReportData()
FXAPIStatement JsonData
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Apex|Session Report")
virtual void FromJsonObject(const TSharedPtr< FJsonObject > &JObject) override
virtual TSharedPtr< FJsonObject > ToJsonObject() const override
TArray< FSessionReportData > Sessions
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Apex|Top Ten Data")
virtual void FromJsonObject(const TSharedPtr< FJsonObject > &JObject) override
FApexUserData User
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Apex|Top Ten Data")
virtual void FromJsonObject(const TSharedPtr< FJsonObject > &JObject) override
virtual ~FUserSessionData()
virtual TSharedPtr< FJsonObject > ToJsonObject() const override
FAPEXOrganization Organization
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Apex|User Session Data")
virtual bool IsEmpty() const override
virtual void FromJsonObject(const TSharedPtr< FJsonObject > &JObject) override
virtual TSharedPtr< FJsonObject > ToJsonObject() const override